Mercurial > hg > forks > gldragon
comparison gldragon.cpp @ 57:3f635b7ea2cf
Back out changeset 73fa5fb437a0.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 07 Dec 2019 00:01:35 +0200 |
parents | bf73a2a70ec7 |
children | 801d4c5c0f23 |
comparison
equal
deleted
inserted
replaced
56:8b335eb444ae | 57:3f635b7ea2cf |
---|---|
238 glEnable(GL_DEPTH_TEST); | 238 glEnable(GL_DEPTH_TEST); |
239 | 239 |
240 // Enable normal rescaling | 240 // Enable normal rescaling |
241 glEnable(GL_RESCALE_NORMAL); | 241 glEnable(GL_RESCALE_NORMAL); |
242 | 242 |
243 glEnable(GL_COLOR_MATERIAL); | |
244 | |
243 // Setup depth buffer | 245 // Setup depth buffer |
244 glClearDepth(1.0f); | 246 glClearDepth(1.0f); |
245 | 247 |
246 // Set the depth buffer function | 248 // Set the depth buffer function |
247 glDepthFunc(GL_LEQUAL); | 249 glDepthFunc(GL_LEQUAL); |
267 glUseProgram(model.id_prog); | 269 glUseProgram(model.id_prog); |
268 glUniform1i(glGetUniformLocation(model.id_prog, "nlights"), scene.lights.size()); | 270 glUniform1i(glGetUniformLocation(model.id_prog, "nlights"), scene.lights.size()); |
269 } | 271 } |
270 | 272 |
271 // Set the material of the model | 273 // Set the material of the model |
272 glEnable(GL_COLOR_MATERIAL); | |
273 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); | 274 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); |
274 glMateriali(GL_FRONT, GL_SHININESS, model.material.shininess); | 275 glMateriali(GL_FRONT, GL_SHININESS, model.material.shininess); |
275 glMaterialfv(GL_FRONT, GL_SPECULAR, model.material.specular.values); | 276 glMaterialfv(GL_FRONT, GL_SPECULAR, model.material.specular.values); |
276 glColor4fv(model.material.diffuse.values); | 277 glColor4fv(model.material.diffuse.values); |
277 | 278 |