In an effort to understand Urho3D’s rendering, I’ve decided to try and write my own custom renderpath, technique and shader. My aim right now is to implement simple phong shading with parallax mapping using forward rendering.
Everything works, except that it only works for one light. If my scene has 2 (or more) lights, how do I tell Urho to render the scene as many times as there are lights, use a different light every pass, then blend them together?
Custom.xml
<renderpath>
<command type="clear" color="fog" depth="1.0" stencil="0" />
<command type="scenepass" pass="base" />
<command type="forwardlights" pass="light" />
</renderpath>
Parallax.xml
<technique vs="Phong_VS" ps="Phong_PS">
<pass name="light" />
</technique>
I don’t think there’s any need to post Phong_VS.glsl and Phong_PS.glsl at this point, but I should note that I am using cLightPosPS and cLightDirPS for my lighting calculations, and I am not using GetVertexLight().