I am learning Opengl and is on spot light now. I got this code
vec3 lightDir = normalize(light.position - FragPos);
// Check if lighting is inside the spotlight cone
float theta = dot(lightDir, normalize(-light.direction));
if(theta > light.cutOff)
{
// Do some spotlight code here
}
But what if for example you want to see whats going on inside the fragment shader? Say I want to get the value of
theta and light.cutoff
just to be sure I am right? How can i get their value back to my .cpp file? because right now the only thing I know is to send a value to fragmet shader but not get the value back from the fragment shader. I want to get the value before the fragment shader output the colors. Just for debugging purposes and also to better understand what is going on.