In my cubic voxel surfaces project I want to make sunlight transition (day to night and vice versa) work via a sunlight level scalar shader uniform. Each vertex will also have a secondary color for the sunlight (in addition to the torchlight (first) vertex color already working).
My understanding of techniques and shaders is rudimentary and I’m looking for some helpful/insightful direction on how to go about this. If someone has relevant code in an open source Urho3D project accessible online, please point me to it so I can study the relevant code.
This is the “DiffUnlitVCol.xml” technique (credit @Tinimini) I’m using:
<technique vs=“Unlit” ps=“Unlit” vsdefines=“VERTEXCOLOR” psdefines=“DIFFMAP VERTEXCOLOR”>
<pass name=“base” />
<pass name=“prepass” psdefines=“PREPASS” />
<pass name=“material” />
<pass name=“deferred” psdefines=“DEFERRED” />
Do I need to change/add anything in this technique for it to be able to pass the secondary color from the vertex buffer object to the shader as well as expose the sunlight scalar shader uniform? Furthermore, do I need to make modifications to a copy of the “Unlit.glsl” shader? It looks to me like “Unlit.glsl” only makes use of one vertex color (VERTEXCOLOR) and I’m unclear how I would make it access the uniform for scaling the secondary vertex color (sunlight).