Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The last lines of the fragment shader:
" vec3 specular = specularStrength * spec * lightColor;\n"
" vec3 result = (ambient + diffuse + specular) * objectColor;\n"
" FragColor = vec4(objectColor * lightColor, 1.0);\n"
Check that the shader is actually applied as expected.
1. If you set FragColor to a constant color, does the picture change?
2. If you change the ...Strenght constants in the shader, does the picture change?
For debugging shaders, it is useful to display the values of intermediate variables as the color of the dot. To do this, they need to scale their values in the segment 0..1 which sets the color components. So by the color of the picture it will be possible to understand what kind of value you got.
Well, you should start with something simple. specular component can definitely be removed for a start.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question