Commit Graph

409 Commits

Author SHA1 Message Date
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
bjorn 88a32fd951 Simplify Skybox stuff; 2017-08-08 18:52:28 -07:00
bjorn 45618f819e Fix Skyboxes; 2017-08-08 18:24:29 -07:00
bjorn 58931f01e2 Allow lovr.graphics.setFont(nil); 2017-08-08 18:01:39 -07:00
bjorn abbe5e36d0 Canvas state is internal; 2017-08-08 02:20:55 -07:00
bjorn c89301c284 Texture is internal state; 2017-08-08 02:14:50 -07:00
bjorn fe570e19f1 Diff vao, vbo, and ibo; 2017-08-08 02:13:07 -07:00
bjorn dfd0926fab Diff framebuffer; 2017-08-08 02:05:30 -07:00
bjorn ef58eea4b8 Projection is transform state; 2017-08-08 01:37:23 -07:00
bjorn 6077cae95a Font state; 2017-08-08 01:36:29 -07:00
bjorn 80c9d7f4d8 Shader state; 2017-08-08 01:33:52 -07:00
bjorn 3da48027ce Use struct for shape state; 2017-08-08 01:33:52 -07:00
bjorn b65673bc3f Color object; 2017-08-08 01:33:52 -07:00
bjorn 9efa89768c Organize graphics state; 2017-08-08 01:33:52 -07:00
bjorn ef06a19fa4 Refactor texture filter structure; 2017-08-08 01:33:52 -07:00
bjorn bb2ec5b49c No pointers for CanvasState; 2017-08-08 01:33:52 -07:00
bjorn f649a50264 rm lovrGraphicsSetPerspective; 2017-08-08 01:33:52 -07:00
bjorn 38c5342d8a Private lovrGraphicsEnsureFont; 2017-08-08 01:33:52 -07:00
bjorn 1402213029 Clean up system limits; 2017-08-08 01:33:52 -07:00
bjorn fd176a608a Private graphics primitive functions; 2017-08-08 01:33:52 -07:00
bjorn 0e474ad6af Reorganize lovrFontPrint; 2017-08-08 01:33:52 -07:00
bjorn 6b0f903b2e rm lovr.graphics.getColorMask; rm lovr.graphics.setColorMask; 2017-08-08 01:33:52 -07:00
bjorn ed25eef2d3 rm lovr.graphics.getScissor; rm lovr.graphics.setScissor; 2017-08-08 01:33:52 -07:00
bjorn 146d037cae Simplify lovrGraphicsClear; 2017-08-01 13:11:32 -07:00
bjorn 48733f87c4 Just use EMCSRIPTEN instead of LOVR_WEB; 2017-08-01 12:16:09 -07:00
bjorn 416f6f7216 Default to LEQUAL CompareMode; 2017-07-31 02:42:44 -07:00
bjorn 8464463d4e Set default texture filter before creating texture; 2017-07-31 02:41:13 -07:00
bjorn 6a8e22f5be Don't check for ubiquitous extension; 2017-07-23 16:24:43 -07:00
bjorn a1007a1545 Add anisotropy system limit; 2017-07-23 16:24:43 -07:00
bjorn 7d31410c8c New Texture filter modes; lovr.graphics.setDefaultFilter; 2017-07-23 16:24:43 -07:00
bjorn b25d345e72 Add compressed texture formats; 2017-07-23 16:24:43 -07:00
bjorn 8ad3e64a2d Font shader; 2017-07-19 07:00:11 +09:00
bjorn 800d07a0de Use msdfgen; 2017-07-19 07:00:11 +09:00
bjorn 41210b1bd0 lovr.graphics.plane takes regular transform; 2017-07-19 05:07:18 +09:00
bjorn e5a311af09 Add glad for windows; 2017-06-23 19:35:49 -07:00
bjorn 83118a5012 lovr.graphics.sphere; 2017-06-21 23:10:45 -07:00
bjorn dd1db4c86f lovr.graphics.box; Better non-uniform scale; 2017-06-21 19:42:34 -07:00
bjorn dfd6c91dec lovr.graphics.cylinder; 2017-06-20 20:54:22 -07:00
bjorn 8beac66db0 OpenGL ES3; Remove glad;
Stop using OpenGL extensions and drop support for OpenGL ES2,
WebGL 1, and OpenGL 2.  Remove glad.
2017-06-18 15:55:01 -07:00
bjorn 613b1ea67f Refactor GL extension code; 2017-06-10 16:25:46 -07:00
bjorn 265a81c411 Add window title; Improve initial error handling; 2017-06-10 15:34:35 -07:00
bjorn 10ddc06c13 No resizable window; 2017-06-01 23:52:37 -07:00
bjorn 08a5259aec Minor lovr.graphics.clear optimization; 2017-05-16 23:43:47 -06:00
bjorn a2400e9876 WebVR fixes; 2017-04-29 13:33:59 -07:00
bjorn 0f1acae42a WIP; 2017-04-16 16:56:49 -07:00
bjorn 9eb4d7b393 Move all window code into graphics module; 2017-04-12 19:48:47 -07:00
bjorn 7f687f9732 No game screen; 2017-04-02 05:55:21 -07:00
bjorn 3977db7249 Don't mess with depth test when rendering fonts; 2017-04-01 15:33:32 -07:00
bjorn a04e5013ad lovr.graphics.getSystemLimits; 2017-03-31 04:22:18 -07:00
bjorn 9d89ea5634 Allow custom fullscreen shaders; 2017-03-30 18:56:51 -07:00
bjorn fbc9805ab1 Allow custom skybox shaders; 2017-03-30 18:54:39 -07:00
bjorn 847a01b76f Fix skyboxes; 2017-03-30 18:48:03 -07:00
bjorn 390220f945 Font alignment; 2017-03-15 20:46:01 -07:00
bjorn 37c2a11172 Fix panorama Skyboxes I promise; 2017-03-12 17:31:06 -07:00
bjorn 5bd364f65f Fix skybox math; 2017-03-12 17:13:50 -07:00
bjorn a4257378f0 Panorama Skybox fixes; 2017-03-12 16:57:27 -07:00
bjorn 4feeb4d4ab Equirectangular Skybox rough draft; 2017-03-12 16:45:50 -07:00
bjorn 062086991e Blend modes; 2017-03-12 04:03:36 -07:00
bjorn c6b635a2ec rm lovr.graphics.setProjection; 2017-03-11 21:19:26 -08:00
bjorn f46339c336 Reset coordinate system on lovr.graphics.reset; 2017-02-18 15:29:32 -08:00
bjorn cce3445f9b Fix memory management; 2017-02-18 14:44:52 -08:00
bjorn aa470d6fab Fix vive rendering; 2017-02-17 00:48:43 -08:00
bjorn ce89900dcc Improve newFont API; 2017-02-16 16:41:46 -08:00
bjorn ebb40867e0 lovr.graphics.print geometry; 2017-02-16 16:23:52 -08:00
bjorn 1b2527db18 Center lines by default; 2017-02-16 15:42:33 -08:00
bjorn ff5a114e65 Font transforms; Font refcounting; 2017-02-10 03:24:13 -08:00
bjorn 458aa43700 Default font; 2017-02-09 21:06:07 -08:00
bjorn f80e3e5a13 More font rendering; 2017-02-09 21:06:07 -08:00
bjorn ab2d0ee79a Really terrible font rendering; 2017-02-09 21:06:07 -08:00
bjorn 721102456a Disable culling while drawing skyboxes; 2017-01-28 23:19:28 -08:00
bjorn 492a75acba Properly destroy modules on exit; 2017-01-21 18:18:12 -08:00
bjorn 666a3a23d7 Remove assimp includes from lovrGraphics; 2017-01-21 17:12:08 -08:00
bjorn 9e0d8801b6 mat4_setTransform; 2017-01-20 20:43:00 -08:00
bjorn 8a3d52b3c6 Cleanup ugh; 2017-01-20 19:55:54 -08:00
bjorn 5e2cfcc9bd graphics.cube and Model:draw accept Transform; 2017-01-20 18:39:49 -08:00
bjorn a118a6bff5 Cleanup; 2017-01-20 18:39:49 -08:00
bjorn 3dbafc8214 Cleanup; 2017-01-20 18:39:48 -08:00
bjorn e8e2a99e5b Finish internal math library; 2017-01-20 18:39:46 -08:00
bjorn 38768afda1 Sort out texture coordinates;
I hope
2017-01-15 13:49:46 -08:00
bjorn 392962eb2b Remove unused lovrGraphicsSetShapeData; 2017-01-13 02:01:56 -08:00
bjorn a8b7af311e Improve graphics primitives; 2017-01-13 01:59:00 -08:00
bjorn af3957d3c3 Perspective projection textures; 2017-01-12 01:26:44 -08:00
bjorn 09fdb72d5c Start texture projections; 2017-01-11 23:38:28 -08:00
bjorn eba3996984 Improve CanvasState; 2017-01-11 20:26:08 -08:00
bjorn b05e2630dd CanvasState; 2017-01-11 09:25:43 -08:00
bjorn 1ad0ac557b Basic framebuffers; 2017-01-08 22:51:43 -08:00
bjorn 2a8d40abd6 Deprecate Buffer Textures; 2017-01-08 21:29:16 -08:00
bjorn 83fb958ac0 Simplify rotations; 2016-12-01 17:32:58 -08:00
bjorn 40eeeabcff Optimize matrix stack; 2016-11-27 10:57:36 -08:00
bjorn cf6c862aaa TextureType; 2016-11-27 10:34:22 -08:00
bjorn d44cbfa5e7 Clean up textures; 2016-11-27 02:06:47 -08:00
bjorn 9b0712bb66 Add default texture; 2016-11-26 18:58:58 -08:00
bjorn 9f4a441bf1 Allow disabling of depth test; 2016-11-24 15:45:59 -08:00
bjorn a5fd7962f4 Organize lovr.graphics; 2016-11-22 21:16:13 -08:00
bjorn f18ee761cd lovr.graphics.setWireframe; 2016-11-22 21:07:33 -08:00
bjorn 15174b8299 lovr.graphics.setDepthTest; 2016-11-22 20:59:11 -08:00
bjorn 3d89338fec lovr.graphics.triangle; 2016-11-22 20:43:22 -08:00
bjorn 0eea694bdd Small reference count fixes; 2016-11-19 18:26:10 -08:00
bjorn c41204f876 Shader reference counting; 2016-11-19 14:06:41 -08:00
bjorn a743cfd3b6 Initial reference counting system; 2016-11-19 13:33:40 -08:00
bjorn 7e4e9a6108 Clean up includes; 2016-11-19 01:28:01 -08:00