Mercurial > hg > forks > gldragon
comparison dmglrender.cpp @ 65:71f6c5cc8eec
Add 'ftime' uniform for shaders, which is time in milliseconds from start of rendering loop.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 15 Dec 2019 02:54:39 +0200 |
parents | d6ffc59bb84d |
children | 701bef61dcf1 |
comparison
equal
deleted
inserted
replaced
64:e8100c1c5d99 | 65:71f6c5cc8eec |
---|---|
250 if (useShaders) | 250 if (useShaders) |
251 { | 251 { |
252 // Enable shader program | 252 // Enable shader program |
253 glUseProgram(model.id_prog); | 253 glUseProgram(model.id_prog); |
254 glUniform1i(glGetUniformLocation(model.id_prog, "nlights"), scene.lights.size()); | 254 glUniform1i(glGetUniformLocation(model.id_prog, "nlights"), scene.lights.size()); |
255 glUniform1f(glGetUniformLocation(model.id_prog, "ftime"), time); | |
255 } | 256 } |
256 | 257 |
257 // Set the material of the model | 258 // Set the material of the model |
258 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); | 259 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); |
259 glMateriali(GL_FRONT, GL_SHININESS, model.material.shininess); | 260 glMateriali(GL_FRONT, GL_SHININESS, model.material.shininess); |