I am trying to use material to color a surface based on the the angle between its normal and a given vector representing the vertical (I am computing a slope). I have gotten that to work correctly by creating a simple material with a vertex and fragment shaders, but I am not doing any shading or anything fancy, so its looks, well, flat.
What I would like to do is to add the color computed by my normal material to be added as a semi-transparent color on top of what the Common/MatDefs/Light/Lighting.j3md is providing (shading, etc). So I am looking at getting the rendering of provided by using the Lighting.j3md and then mixing an additional color on top based on some other calculations (here I have started by looking at the slope)
I do not know how to approach this ?
I was thinking of creating a new material by copying the Lighting.j3md and its associated (many) vertex and fragment shaders and adding in the shaders what is required to compute the slope derived color and add it add to the gl_FragColor computed by the Lighting.j3md shaders, but this seems to be not trivial (I am a beginner in shaders).