comparison gldragon.cpp @ 54:73fa5fb437a0

Fumbling around.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 06 Dec 2019 22:41:33 +0200
parents d871e4b24328
children bf73a2a70ec7
comparison
equal deleted inserted replaced
53:d871e4b24328 54:73fa5fb437a0
222 glEnable(GL_DEPTH_TEST); 222 glEnable(GL_DEPTH_TEST);
223 223
224 // Enable normal rescaling 224 // Enable normal rescaling
225 glEnable(GL_RESCALE_NORMAL); 225 glEnable(GL_RESCALE_NORMAL);
226 226
227 glEnable(GL_COLOR_MATERIAL);
228 227
229 // Setup depth buffer 228 // Setup depth buffer
230 glClearDepth(1.0f); 229 glClearDepth(1.0f);
231 230
232 // Set the depth buffer function 231 // Set the depth buffer function
253 glUseProgram(model.id_prog); 252 glUseProgram(model.id_prog);
254 glUniform1i(glGetUniformLocation(model.id_prog, "nlights"), scene.lights.size()); 253 glUniform1i(glGetUniformLocation(model.id_prog, "nlights"), scene.lights.size());
255 } 254 }
256 255
257 // Set the material of the model 256 // Set the material of the model
257 glEnable(GL_COLOR_MATERIAL);
258 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); 258 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
259 glMateriali(GL_FRONT, GL_SHININESS, model.material.shininess); 259 glMateriali(GL_FRONT, GL_SHININESS, model.material.shininess);
260 glMaterialfv(GL_FRONT, GL_SPECULAR, model.material.specular.values); 260 glMaterialfv(GL_FRONT, GL_SPECULAR, model.material.specular.values);
261 glColor4fv(model.material.diffuse.values); 261 glColor4fv(model.material.diffuse.values);
262 262