Commit Graph

409 Commits

Author SHA1 Message Date
bjorn 7222d1fa26 Use same window hints for webgl and desktop;
It doesn't seem like this causes any problems anymore.
2018-08-30 21:43:30 -07:00
bjorn 7055875cfa rm unnecessary emscripten ifdef for glfw context;
Now that the bug is fixed!
2018-08-30 21:40:31 -07:00
bjorn 7c21d77a6e rm singlepass conf flag; Viewports; getSupported.singlepass; 2018-08-30 04:02:58 -07:00
bjorn ce2dfb523e Make window mono by default;
The window is now mono by default to make the error screen better and better enable non-stereo uses.  The Camera can now request that the window be treated as stereo.
2018-08-29 21:22:13 -07:00
bjorn a5f6ff506b MSAA resolve; 2018-08-29 21:22:12 -07:00
bjorn 590668a8d6 lovrGraphicsBlit; 2018-08-29 21:21:38 -07:00
bjorn 8bb45f4de4 Clean up viewports; 2018-08-29 21:21:07 -07:00
bjorn 21a869cc8b Clean up; 2018-08-29 21:19:41 -07:00
bjorn 1ea3c84be9 Ugly viewport stuff; 2018-08-29 21:19:07 -07:00
bjorn 3bf76e3497 Fix clear and canvas texture refcounts; 2018-08-29 21:18:33 -07:00
bjorn 7e74441afd getCanvas; setCanvas; Canvas attachments; 2018-08-29 21:18:33 -07:00
bjorn 7795bb9276 I came in like a wrecking ball; 2018-08-29 21:18:32 -07:00
bjorn 7569b7934f conf flag for singlepass; Shader fixes; 2018-08-23 12:52:18 -07:00
bjorn 6f72166f59 Only use 1 texture for skybox; 2018-08-22 12:09:51 -07:00
bjorn 3eca158025 ty compiler; 2018-08-16 17:54:48 -07:00
bjorn 3d691ed087 Use defines to shrink stb_image footprint; 2018-08-16 14:21:24 -07:00
bjorn 5c65fc811f Change "drawing" to "rendering" in comments; 2018-08-11 00:08:33 -07:00
bjorn 3dabe0cf34 setShader errors on compute shaders; 2018-08-11 00:08:33 -07:00
bjorn b8faff6986 Add writable and usage flags to ShaderBlock; 2018-08-02 05:04:40 -07:00
bjorn d7bb4321d0 Add parentheses around braced initializer lists; 2018-08-01 21:06:16 -07:00
bjorn 156c0cde5d Condense event code a bit; 2018-07-26 19:38:01 -07:00
bjorn 2dc79a48a8 Use single pass stereo rendering when supported; 2018-07-21 05:30:13 -07:00
bjorn 5641afee13 Remove isDefault flag from Material; 2018-07-18 00:34:21 -07:00
bjorn 317fa98bdd Fix sphere; 2018-07-17 19:20:40 -07:00
bjorn ea551203c0 Refcount pipeline objects properly; 2018-07-17 17:21:15 -07:00
bjorn f1f2c7b401 Yay all opengl is in opengl.c; 2018-07-17 17:21:15 -07:00
bjorn 2cf0e15eb0 Morganization; Fix some Canvas issues; 2018-07-17 17:21:15 -07:00
bjorn f57810cd7a Morganization; 2018-07-17 17:21:15 -07:00
bjorn 56bbf1cf56 Organization; 2018-07-17 17:21:15 -07:00
bjorn b4752dd6a1 Yay no GL in graphics.c; 2018-07-17 17:21:15 -07:00
bjorn 5c34406060 Use glfw constants instead of opengl constants for window hints; 2018-07-17 17:21:15 -07:00
bjorn 89fe9fa894 Organize limits; 2018-07-17 17:21:15 -07:00
bjorn 4239bc46ea Refactor graphics stats; 2018-07-17 17:21:14 -07:00
bjorn 0ee5d0b8f2 Anonymous materials for draw calls; 2018-07-17 17:21:14 -07:00
bjorn fe75c666a9 Simplify lovr.graphics.getWidth/Height; 2018-07-17 17:21:14 -07:00
bjorn b64489b020 Pipeline stack for graphics state; Simplify clearing; 2018-07-17 17:21:14 -07:00
bjorn 6933914650 Shift around glfw includes; 2018-07-17 17:21:14 -07:00
bjorn e0063995b3 More data driven primitives; 2018-07-17 17:21:14 -07:00
bjorn e6e8e137c0 Clean up drawing; 2018-07-17 17:21:14 -07:00
bjorn 322c0bdef7 GpuStats; 2018-07-17 17:21:14 -07:00
bjorn 7c7714214e Start gpuDraw; 2018-07-17 17:21:14 -07:00
bjorn c35415ba66 Move over texture binding; 2018-07-17 17:21:14 -07:00
bjorn 8bf60b73ec Add opengl header; Migrate relevant object implementations; 2018-07-17 17:21:14 -07:00
bjorn eb456f5b52 rm stdio from graphics; 2018-07-17 17:21:14 -07:00
bjorn c86bb419f1 Use indirection for graphics object access;
This will make it easier to move stuff around.
2018-07-17 17:21:14 -07:00
bjorn 89c8ee3d06 Begin OpenGL quarantine; 2018-07-17 17:21:14 -07:00
bjorn f903b6014c Use arrays for enums instead of maps; 2018-07-04 20:11:52 -07:00
bjorn 57c8dfe146 Clean up includes; 2018-07-04 13:51:35 -07:00
bjorn d71eccfd0b Ensure Mesh attachments are unmapped before drawing; 2018-06-12 02:05:19 -07:00
bjorn f4b9552052 Remove msaa check for framebuffer resolve;
Since resolve now does MSAA and mips.
2018-06-11 19:31:58 -07:00
bjorn b47e26e688 Disable GL clipping plane;
It was used for instanced stereo.
2018-06-11 19:31:35 -07:00
bjorn 26bb0ea1ac Reset canvas state in lovr.graphics.reset; 2018-06-11 19:00:43 -07:00
bjorn 54a9a8eb78 Fix lovrGraphicsSetCanvas framebuffer binding; 2018-06-11 19:00:43 -07:00
bjorn 17bf06b817 Fixes for openvr driver; 2018-06-04 19:49:36 -07:00
bjorn 183f6003e9 rm mapped buffers mostly; 2018-06-03 19:00:31 -07:00
bjorn 6ff7292333 Mostly remove instanced stereo rendering; 2018-06-03 17:18:42 -07:00
bjorn 7273811120 Some extra graphics state diffing; 2018-06-02 15:30:26 -07:00
bjornbytes 2b183a49be Work around emscripten window limitation; 2018-05-27 19:05:10 -07:00
bjorn bdc9b63b8a Fix lots of memory leaks;
Especially when restarting or using threads.
2018-03-23 19:31:45 -07:00
bjorn 1ad00328c1 Add a flag for autogenerating Canvas mipmaps; 2018-03-22 10:58:53 -07:00
bjorn 95da07d165 Stereo canvases;
Canvases can be created with the "stereo" flag to make it a stereo
Canvas.  If a Canvas is stereo, everything rendered to it will be
rendered to the left and right halves of it, using left/right
view and projection matrices.  Headset drivers will use stereo
Canvases to improve performance.
2018-03-22 09:57:44 -07:00
bjorn c0ea3240c3 Organize drawing code; 2018-03-22 09:57:44 -07:00
bjorn 8e5061f918 Disable depth test in lovr.graphics.fill; 2018-03-22 09:57:44 -07:00
bjorn be699aa132 Normal matrix is an array; 2018-03-22 09:57:44 -07:00
bjorn 334e218e4c Diff render target state better; 2018-03-22 09:57:44 -07:00
bjorn 988d8c7d23 Rename blit to fill; 2018-03-22 09:57:44 -07:00
bjorn db756f347f Add comment; 2018-03-22 09:57:44 -07:00
bjorn 3ed16a0a68 Work around driver bug to fix error screen; 2018-03-22 09:57:44 -07:00
bjorn b266d0316c Update camera UBO when popping a layer; 2018-03-22 09:57:44 -07:00
bjorn 8b201838b6 Add lovr.graphics.blit for fullscreen quads; 2018-03-22 09:57:44 -07:00
bjorn 8bcaacd63c Resolve MSAA properly; 2018-03-22 09:57:44 -07:00
bjorn 2cbd565522 Fix texture submit bounds; Fix layer canvas bug; 2018-03-22 09:57:44 -07:00
bjorn 4915ca41cc Make skyboxes really cool; 2018-03-22 09:57:44 -07:00
bjorn 8e0519058d Use quad for cube skyboxes; 2018-03-22 09:57:44 -07:00
bjorn e6a76e2a61 rm MatrixType; 2018-03-22 09:57:44 -07:00
bjorn d317502ffd Small UBO cleanup; 2018-03-22 09:57:44 -07:00
bjorn 2def650abd Refactor layers/displays; 2018-03-22 09:57:44 -07:00
bjorn 1f1232505e Uniform buffer objects for matrices;
Still hacky.
2018-03-22 09:57:44 -07:00
bjorn 3064eff017 Hack everything but it mostly works; 2018-03-22 09:57:44 -07:00
bjorn 1cd1b5e11d Use a Mesh for primitives; 2018-03-22 09:46:26 -07:00
bjorn e4618add55 Gamma correct background color correctly; 2018-03-10 20:59:36 -08:00
bjorn 7e58e265d6 Fix cube winding; 2018-03-03 17:19:12 -08:00
bjorn cb7b99f9a6 Optimize skybox rendering;
- Fix winding order of skybox cubemaps.
- Fix skybox image ordering in lovr.graphics.newTexture.
- Change skybox shader to allow rendering cubemap skyboxes last for
  early z rejection.
- Remove overriding of depth write and depth test state for cubemap
  skyboxes.
2018-02-26 02:10:53 -08:00
bjorn 4df836727c Simplify refcounting; 2018-02-26 00:59:03 -08:00
bjorn 9ca743dc1a Headset module can be restarted; 2018-02-23 18:38:53 -08:00
bjorn f5fa9a4e5c Make modules more restartable;
Except headset.  Screw you, headset.
2018-02-23 18:38:53 -08:00
bjorn 640c4e715c rm extra lovr.h includes; 2018-02-23 18:38:34 -08:00
bjorn f75530b9e1 Add support for 2d array textures; Improve mipmaps;
lovr.graphics.newTexture has been changed.
2018-02-20 17:15:47 -08:00
bjorn 17c81a3502 Clear HMD canvas properly; 2018-02-18 16:15:12 -08:00
bjorn 7cecc1489e getCanvas; setCanvas; MRT; MULTICANVAS define; 2018-02-15 19:58:35 -08:00
bjorn cca1f32d10 PBR material properties; 2018-02-11 19:16:40 -08:00
bjorn d5a1928b3d Rename a bunch of files; 2018-02-11 15:22:04 -08:00
bjorn 18be34a903 Expose depth write setting; 2018-02-08 21:50:47 -08:00
bjorn 3fd6f27768 Allow custom values when clearing color, depth, and stencil buffers; 2018-02-08 21:26:53 -08:00
bjorn 14a54fa7b0 rm MaterialData; 2018-01-29 21:44:32 -08:00
bjorn 84de048fa3 Fix warnings; 2018-01-26 19:11:42 -08:00
Bjorn Swenson 1f3deae6ec
Merge pull request #32 from mcclure/reload-support-2
Restart-without-quit support: lovr.event.quit("restart")
2018-01-25 19:08:30 -08:00
mcc 8052896b33 Restart-without-quit support: lovr.event.quit("restart") and return-from-run() both support the string "restart" in place of an exit code. When this happens, the program reruns itself in a new, isolated environment. In Emscripten, no reboot occurs and the program only quits. 2018-01-25 21:32:16 -05:00
bjorn a22740084c Rename FontData to Rasterizer; 2018-01-22 08:28:33 -08:00
bjorn 7b58012854 Flip sphere uvs; 2018-01-01 20:39:50 -08:00
bjorn 77d8b96cfd lovr.graphics.stencil; 2017-12-18 19:48:28 -08:00
bjorn 8acd7444af lovr.graphics.getStencilTest; lovr.graphics.setStencilTest; 2017-12-18 18:37:03 -08:00
bjorn 72aa7e858a Rename loaders to data; 2017-12-10 12:41:43 -08:00
bjorn 4a2cc56fef Move shaders into resources; 2017-12-10 12:41:43 -08:00
bjorn 6f58b758e3 Fix texture coordinates; 2017-12-09 20:09:27 -08:00
bjorn 8eec247adb lovr.graphics.getStats; 2017-12-09 20:07:42 -08:00
bjorn c6b7d9729d rm lovrGraphicsGetWindow; 2017-12-03 15:23:38 -08:00
bjorn da0afb487c Small fixes for WebVR; 2017-12-01 19:59:55 -08:00
bjorn cb2265e547 Remove material from graphics state;
It is now local state to models and meshes and can be passed as
an optional first argument to most primitives.
2017-11-25 19:02:28 -08:00
bjorn 093ef37bf3 Gamma correct colors correctly; 2017-11-25 17:57:59 -08:00
bjorn fd9c714d0f Ask glfw for an srgb capable window; 2017-11-24 00:17:52 -08:00
bjorn 1662e79f0e Use srgb formats for textures; 2017-11-23 14:19:20 -08:00
bjorn 3c6437fb20 lovr.graphics.isGammaCorrect; conf.lua t.gammacorrect; 2017-11-22 20:26:01 -08:00
bjorn 5c45282d9b lovr.graphics.arc; 2017-11-22 11:32:30 -08:00
bjorn b540fdbfdb Forgot line draw mode for circle; 2017-11-21 20:56:47 -08:00
bjorn 81c29176ab lovr.graphics.circle; 2017-11-21 20:53:45 -08:00
bjorn 602e0ced7d Floating point colors;
This is a breaking change.
2017-11-20 21:47:36 -08:00
bjorn 652c31f8d4 Optional pose; 2017-11-20 21:16:16 -08:00
bjorn 227dd67c00 Set default shader properly to avoid crash; 2017-10-31 01:33:16 -07:00
bjorn ecde864ec4 Use spooky BOOleans everywhere; 2017-10-31 01:14:09 -07:00
Bjorn Swenson 618be7b51d Merge pull request #24 from bcampbell/fake-headset
Fake headset
2017-10-23 11:24:03 -07:00
bjorn 00726fe89e Fix pointsize limit for WebGL; 2017-10-22 16:26:48 -07:00
bjorn cc651e7b4e Set point size in vertex shader for WebGL compatibility; 2017-10-22 16:14:53 -07:00
bjorn 076b378b80 Report correct line numbers for shader errors; 2017-10-22 15:39:21 -07:00
Ben Campbell 54a0077356 oops - re-enable icon setting
(I was using GLFW 3.1 and had to disable the icon-setting code)
2017-10-23 09:38:24 +13:00
Ben Campbell a22a9ed1f4 Merge branch 'master' into fake-headset 2017-10-23 09:32:32 +13:00
bjorn 51ceb2a199 Rename shape data to stream data; 2017-10-22 07:37:31 -07:00
bjorn e8e09c425e Reset material in lovr.graphics.reset; 2017-10-22 04:11:39 -07:00
bjorn d5b3a2243e Rename internal canvas to view; 2017-10-22 03:34:45 -07:00
bjorn 5498a4e13e Fix fullscreen textures; 2017-10-22 03:23:58 -07:00
bjorn dece1d896f Update skybox and font rendering; 2017-10-21 14:59:34 -07:00
bjorn 16915e4fa2 Material graphics state; 2017-10-21 14:32:41 -07:00
bjorn 4935816457 Remove texturing from primitives; 2017-10-21 13:54:50 -07:00
bjorn 54533351bb Generalize Shader to support more types of uniforms; 2017-10-21 13:39:50 -07:00
bjorn 32b05cb15d Support multiple texture slots; 2017-10-21 13:21:28 -07:00
bjorn a2860361e9 Consolidate Texture and Skybox; 2017-10-21 13:00:13 -07:00
bjorn 0d3bc4cfaa Disable depth mask when drawing text; 2017-10-15 09:16:13 -07:00
Ben Campbell 8f97384951 cheesy hack to module load order to get fake headset running 2017-10-12 23:04:18 +13:00
bjorn 9202b42d8d Try to enable antialiasing in WebVR; 2017-08-27 13:23:21 -07:00
bjorn 9fd4030f47 Tweak sphere coordinates; 2017-08-15 21:21:49 -07:00
bjorn e4a7c6bb47 Fix WebVR; 2017-08-15 01:05:18 -07:00
bjornbytes 3c3076f8c4 Fix VR rendering; 2017-08-12 20:43:23 -07:00
bjorn 0311232ae1 Add lovrModel and lovrView matrices; 2017-08-10 22:23:19 -07:00
bjorn 74f585ca8d Use lovrAssert and lovrThrow for better errors; 2017-08-10 01:05:04 -07:00
bjorn 3cd245f2b0 Window customization via conf.lua; 2017-08-09 20:02:02 -07:00
bjorn 6c316c7587 Fix Shader bugs; 2017-08-09 00:56:13 -07:00
bjorn 9dd9678077 Fix default font bug; 2017-08-08 23:49:17 -07:00
bjorn c76df39407 Organize lovrGraphicsReset; 2017-08-08 22:39:00 -07:00
bjorn d849f2429c Everything is probably broken; 2017-08-08 21:10:56 -07:00
bjorn 76f94e8ade Rename primitive data structures; 2017-08-08 18:57:41 -07:00