GhGl shader respecting lights in the scene


Could someone help me to understand how I can modify the code in the GL Mesh Shader button to respect the lights in a scene? Or am I just missing how the GL Mesh Shader works?



Resources GHGL


GhGL grabs the lights in the display pipeline and sets them up as uniforms available in the shader

Ok, I think I understand now. Do I just need to work within those 4 light direction options? Or is there another way to override this and tell it to use the scene lights for the lighting?


I was able to manipulate the direction of the lighting by creating a vector input (as an MD Slider) named lightdir and then multiplying it by the _lightDirection in the Main function in the fragment portion of the shader. I hope this helps someone else.

vec3 l = normalize(_lightDirection[0]*lightdir);

The code in the shader needs to decide if ift is going to support more lights. I never got around to writing a sample that used more than the standard camera oriented light.