Commit Graph

79 Commits

Author SHA1 Message Date
bjorn 83b2f8d745 Add uniform for controlling light color and intensity; 2019-08-09 00:27:17 -07:00
bjorn 30ea8995d2 Fix view vector; 2019-08-07 17:53:38 -07:00
bjorn 2c115ce66e Automatically detect mipmap count for IBL; 2019-08-07 15:56:52 -07:00
bjorn fe939213be Initial standard shader flags;
- normalTexture = true
- indirectLighting = true (requires uniform setup!)
- occlusion = true (only affects indirect lighting)
- emissive = true
- tonemap = true
2019-08-06 14:39:14 -07:00
bjorn b08d9d0b30 Standard shader: Add tonemapping;
ACES.
2019-08-05 15:34:21 -07:00
bjorn 96c47d590c rm lovrEnvironmentTexture from Material; 2019-08-05 15:20:17 -07:00
bjorn e4ab5aa85a Standard shader: Add image-based lighting;
Very WIP, still need to add the BRDF lookup table.
2019-08-05 14:49:09 -07:00
bjorn bff9399308 Rename skinned flag to animated; 2019-08-04 15:08:21 -07:00
bjorn 06fb8b2503 Simplify fill;
lovr.graphics.fill renders a fullscreen quad, it's convenient because
you don't need to set up a mesh and toggle all the pipeline states.

However, if you are dealing with copying/rendering between stereo
textures, you have to write your own shader for that.  For now.
2019-08-03 16:03:13 -07:00
bjorn e9fd052fc6 Start fixing lovr.graphics.fill; 2019-08-02 15:48:35 -07:00
bjorn aab987dbef Fix WebGL gamma correction;
Ugh, WebGL doesn't have sRGB backbuffers.
2019-08-01 13:26:45 -07:00
bjorn 4b9e6849c8 Better boolean shader flags; Multicanvas flag;
Instead of boolean shader flags turning into actual booleans defines
in the shader source, for GLSL they turn into defines.  This lets you
use ifdef, which is the more common intended usage.

Also MULTICANVAS is now a boolean shader flag.  The old MULTICANVAS
define is deprecated.
2019-07-28 18:08:23 -07:00
bjorn f564444641 Fix some WebGL issues; 2019-07-28 17:28:18 -07:00
mcc d391a4750f Use base diffuse color from materials in Standard shader 2019-07-25 15:08:53 -07:00
bjorn 4222be88b5 Use UBO for Camera matrices;
Ugh I don't like the "Camera" concept anymore, but I can't figure
out how to easily get rid of it.  Maybe wait till displays are a thing.
2019-06-27 22:17:50 -07:00
bjorn 928ccee5f1 Multiview; 2019-06-25 01:21:59 -07:00
bjorn 807c519397 Fix typo; 2019-06-20 21:36:07 -07:00
bjorn b6d65922af Standard shader: spherical harmonics irradiance; 2019-06-20 21:17:32 -07:00
bjorn 286cb711e4 Standard shader: emissive; 2019-06-20 18:22:49 -07:00
bjorn a9241e781b Standard shader: emissive; 2019-06-20 18:20:07 -07:00
bjorn 179071023f Standard shader: diffuse, specular, normal mapping;
No shader flags yet.  Still need occlusion, emissive, configurable
lighting, IBL.
2019-06-20 17:46:22 -07:00
bjorn 4611b1c9a3 Add no-op standard shader; 2019-06-20 14:21:35 -07:00
bjorn 612f699aa4 Rename default shader to unlit; 2019-06-20 14:09:55 -07:00
bjorn 06e3ef702c Add built-in ShaderFlag for skinning vertices;
Now you can pass in the { skinned = true } flag when creating a Shader
to get skinning behavior without needing to write it yourself.  The
default is still false.

Need to profile to make sure the if is getting optimized out.
2019-05-28 03:43:54 -07:00
bjorn a28b333899 Split draw data stream into two streams;
Also the max number of draws can be hardcoded to 256 now.
2019-04-05 00:49:50 -07:00
bjorn 94ac64e7f4 Add std140 layout qualifier to DrawData block; 2019-03-13 09:20:33 -07:00
bjorn 1d3b05a515 Make bone IDs unsigned for WebGL; 2019-02-14 09:49:31 -08:00
bjorn 6b323e3476 Start parsing glTF; 2019-02-13 15:10:52 -08:00
bjorn f53f64933c WebGL fixes; 2019-02-08 10:32:05 -08:00
bjorn 3aec7f7767 Fix struct definition in UBO;
You can't define a new struct in an interface block.
2019-01-29 19:57:18 -08:00
bjorn ea3a77a73a Many batching improvements; Refactoring; 2019-01-04 18:01:01 -08:00
bjorn e6b7c41860 Improve lovrDrawData uniform names; 2018-12-14 16:02:25 -08:00
bjorn c531852932 Refactor rendering; 2018-12-10 23:05:02 -08:00
bjorn 40454d1380 Use ShaderBlock for transforms/colors; 2018-12-07 18:19:03 -08:00
bjorn a06734ae97 Use alpha to coverage and alpha test for text; 2018-11-08 11:58:43 -08:00
bjorn 1b3e8c9766 Flip cubemap x texture coordinate; 2018-09-04 06:42:04 -07:00
bjorn 4e1757210e Load cubemap images better; 2018-09-03 20:59:12 -07:00
bjorn b959c30424 lovrPoseMatrix; 2018-09-01 02:52:02 -07:00
bjorn c584354c92 lovrInstanceID; 2018-09-01 02:09:59 -07:00
bjorn 8b9e9eba9e Use GLSL 430 when available; 2018-09-01 01:57:38 -07:00
bjorn 4e61d2ea3b Really icky conditional shader compilation;
But I can't think of another way to do it.
2018-08-31 19:52:03 -07:00
bjorn 7b9a0ba048 Organize uniforms better; 2018-08-31 16:45:05 -07:00
bjorn a5256aaa27 Happy little graphics refactors; 2018-08-31 06:03:35 -07:00
bjorn 0ce6e046a6 lovrViewportCount; Multiply vertex divisors; 2018-08-31 02:41:50 -07:00
bjorn b7faeb8c44 Add precision for ints; 2018-08-30 21:37:45 -07:00
bjorn 5ab15e36a8 Declare extension before in; 2018-08-30 03:43:41 -07:00
bjorn 4631d2dacc Test shader extension fallback; 2018-08-30 03:38:31 -07:00
bjorn e6a7a4f922 Redo singlepass; 2018-08-30 00:52:38 -07:00
bjorn a97c8e2266 Fix skybox texture mapping; 2018-08-30 00:06:29 -07:00
bjorn 7569b7934f conf flag for singlepass; Shader fixes; 2018-08-23 12:52:18 -07:00