Please sign in to comment.
Implement setting shader uniforms from script (#1206)
Uniform variables are read from the "Uniforms" proplist set on Scenario or on individual objects. Proplist keys are uniform names. Values can either be an int or an array of one to four ints in C4Script. In GLSL, the uniforms then need a matching type (int/ivec2/ivec3/ivec4). There is no error reporting; uniforms are only set if both name and type match. The implementation walks the "Uniforms" proplists on each Draw call. We may need to cache the uniform maps if this turns out to be too slow.
- Loading branch information
Showing with 153 additions and 0 deletions.
- +2 −0 src/game/C4Viewport.cpp
- +1 −0 src/graphics/C4Draw.cpp
- +1 −0 src/graphics/C4Draw.h
- +2 −0 src/graphics/C4DrawGL.cpp
- +2 −0 src/graphics/C4DrawMeshGL.cpp
- +96 −0 src/graphics/C4Shader.cpp
- +42 −0 src/graphics/C4Shader.h
- +2 −0 src/landscape/C4LandscapeRender.cpp
- +3 −0 src/object/C4Object.cpp
- +1 −0 src/script/C4StringTable.cpp
- +1 −0 src/script/C4StringTable.h