-
Notifications
You must be signed in to change notification settings - Fork 19
Description
This is a brilliant piece of code!
However, the OpenGL renderer does not seem to use the material constants, even though they are being read from the OBJ file. As a test, I commented out all of the texture maps in the example Chest.mtl file, leaving only the material constants Kd, Ka, Ks, Ke. For extra confirmation I changed the "diffuse" constant Kd to 0.0 1.0 0.0, to make the treasure chest appears in bright green. In every other OBJ viewer I have tried, this has the intended effect: the treasure chest appears bright (non-textured) green. However, in the example renderer provided here, the treasure chest appears featureless black.
Looking into the code, it seems that the material constants are not being passed into the vertex or fragment shaders anywhere. This is a problem for us because we have to render models that contain a mixture of textured and non-textured surfaces.
Can you provide some guidance on how to use the material constants Kd, Ka, Ks, Ke in the shaders? Or even better, add the code needed to pass them into the shaders, so they can be used for surfaces which are not textured?
Thanks again for a fantastically useful piece of work.