jfcameron / gdk-graphics

3D Rendering using OpenGLES 2.0/WebGL1.0. Platforms: Linux, Windows, Mac, x86 64bit, arm64, wasm
MIT License
1 stars 1 forks source link

material: prevent different uniform types from being assigned to the same name #54

Open jfcameron opened 3 years ago

jfcameron commented 3 years ago

material holds uniform name-value pairs for all the different uniform value types. Currently nothing stops a user from assigning e.g: a float to "my_uniform" then later assigning a texture or vector to it. They will all be collected in the different maps, the value which will be available to the shader will be whichever one happens to line up with the type of the uniform declared in the shader. This isnt a big deal but could be a source of confusion

jfcameron commented 3 years ago

should be done after #36 since that ticket will result in refactoring part of material