stevenarella/src/render/shaders
iceiix 22f6c83d59
WebGL fixes after disabling threaded chunk builder (#451)
At this point, the UI renders in the browser through WebGL, with no GL errors.
Progress towards #446 🕸️ Web support

* main: enable render loop on wasm, disable events_loop on wasm for now
Allow for testing rendering on WebGL

* chunk_builder: disable on wasm due to no threads on wasm
Chunks will not be correctly rendered, but other parts of the program now can be tested instead of crashing in std::thread

* chunk_frag: glBindFragDataLocation is only on native, WebGL 2 uses in-shader specification layout(location=), which works on native in OpenGL 4.1 but we're on OpenGL 3.2 - see https://www.khronos.org/opengl/wiki/Fragment_Shader#Output_buffers

* std_or_web: always fail File::open() to avoid servers.json empty string JSON parse failing

* www: update installation instructions

* render: fix apparent TEXTURE_MAX_LEVEL -> TEXTURE_MAG_FILTER typo

* render: correct type for internalFormat DEPTH_COMPONENT24
Valid combinations of format, type, and internalFormat are listed at https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf#page=124&zoom=100,168,206. We had UNSIGNED_BYTE for DEPTH_COMPONENT24, but only UNSIGNED_INT is a valid type for this internal format.

Fixes texImage: Mismatched internalFormat and format/type: 0x81a6 and 0x1902/0x1401
and fixes the subsequent GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT error.

* render: gl::MULTISAMPLE (0x809d) is not available on WebGL
Fixes WebGL warning: enabled: cap: Invalid enum value <enum 0x809d> 0.bootstrap.js line 11 > eval:851:21

* gl: replace set_float_multi_raw with a safer set_float_multi
Removes use of passing raw pointers in set_float_multi_raw parameters
Instead, casts raw pointers to flatten, similar to set_matrix_multi
Fixes uniform setter: (uniform colorMul[0]) values length (1) must be a positive integer multiple of size of <enum 0x8b52>.

* render: model: send BYTE to id attrib, fixes type mismatch
Fixes drawElementsInstanced: Vertex attrib 0 requires data of type INT, but is being supplied with type UINT
2020-12-31 14:35:30 -08:00
..
chunk_frag.glsl WebGL fixes after disabling threaded chunk builder (#451) 2020-12-31 14:35:30 -08:00
chunk_vertex.glsl Use web-sys for web backend (#444) 2020-12-26 13:43:21 -08:00
clouds_frag.glsl Add fancy clouds 2016-04-01 20:01:10 +01:00
clouds_geo.glsl Fix uninitialized texP and heightP in clouds_geo. Closes https://github.com/iceiix/steven/issues/32 2018-11-28 16:45:25 -08:00
clouds_vertex.glsl Add fancy clouds 2016-04-01 20:01:10 +01:00
get_light.glsl Implement block shading 2016-03-21 19:53:00 +00:00
lookup_texture.glsl Use web-sys for web backend (#444) 2020-12-26 13:43:21 -08:00
model_frag.glsl Implement models and a sun/moon 2016-03-27 23:31:57 +01:00
model_vertex.glsl Use web-sys for web backend (#444) 2020-12-26 13:43:21 -08:00
sun_frag.glsl Implement models and a sun/moon 2016-03-27 23:31:57 +01:00
sun_vertex.glsl Use web-sys for web backend (#444) 2020-12-26 13:43:21 -08:00
trans_frag.glsl Disable multisampled textures, glTexImage2DMultisample (#447) 2020-12-27 10:14:39 -08:00
trans_vertex.glsl Add last state before I stopped 2016-03-16 17:33:06 +00:00
ui_frag.glsl Work on login screen, added ui buttons and textboxes (plus tab fixes) 2016-03-20 20:17:21 +00:00
ui_vertex.glsl Use web-sys for web backend (#444) 2020-12-26 13:43:21 -08:00