Don't disable shaders when rendering shadow volumes
This commit is contained in:
parent
a7a5ae60e4
commit
0f6fb2617e
3 changed files with 4 additions and 5 deletions
|
@ -39,7 +39,7 @@ Game::Game() : playerPos(vmml::vec3f::ZERO), playerRotY(vmml::mat4f::IDENTITY),
|
|||
|
||||
glEnable(GL_MULTISAMPLE_ARB);
|
||||
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, vmml::vec4f(0.1, 0.1, 0.1, 1).array);
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, vmml::vec4f(0.05, 0.05, 0.05, 1).array);
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_AMBIENT, vmml::vec4f::ZERO.array);
|
||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, vmml::vec4f::ONE.array);
|
||||
|
@ -93,8 +93,8 @@ void Game::turn(float x, float y) {
|
|||
}
|
||||
|
||||
void Game::run(int delta) {
|
||||
lightPos += delta;
|
||||
lightPos %= 24000;
|
||||
lightPos += delta*0.5;
|
||||
lightPos = std::fmod(lightPos, 24000);
|
||||
|
||||
vmml::vec3f playerMove(vmml::vec3f::ZERO);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class Game {
|
|||
|
||||
unsigned input;
|
||||
|
||||
int lightPos;
|
||||
float lightPos;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -68,7 +68,6 @@ class Renderer {
|
|||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
glDepthMask(GL_FALSE);
|
||||
Shader::disable();
|
||||
|
||||
glFrontFace(GL_CCW);
|
||||
glStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
|
||||
|
|
Reference in a new issue