fbo pose pb ik
This commit is contained in:
parent
52c5aa2d55
commit
9f055704fa
2 changed files with 4 additions and 1 deletions
|
@ -91,6 +91,8 @@ static void transition_draw(void (*a0)(int), void (*a1)(int), Uint32 t,
|
||||||
_transition_tId, 0);
|
_transition_tId, 0);
|
||||||
|
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, tex[0]);
|
glBindTexture(GL_TEXTURE_2D, tex[0]);
|
||||||
glActiveTexture(GL_TEXTURE1);
|
glActiveTexture(GL_TEXTURE1);
|
||||||
|
|
|
@ -91,16 +91,17 @@ static void draw(void) {
|
||||||
bindAndLoadf(matrix_lview);
|
bindAndLoadf(matrix_lview);
|
||||||
gl4duLookAtf(9, 6, 0, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
|
gl4duLookAtf(9, 6, 0, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
|
||||||
glCullFace(GL_FRONT);
|
glCullFace(GL_FRONT);
|
||||||
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, _fbo);
|
glBindFramebuffer(GL_FRAMEBUFFER, _fbo);
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D,
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D,
|
||||||
_shadow_map_tex, 0);
|
_shadow_map_tex, 0);
|
||||||
glViewport(0, 0, SHADOW_MAP_SIDE, SHADOW_MAP_SIDE);
|
glViewport(0, 0, SHADOW_MAP_SIDE, SHADOW_MAP_SIDE);
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT);
|
||||||
for (int i = 0; i < HEROS_NUMBER; ++i) {
|
for (int i = 0; i < HEROS_NUMBER; ++i) {
|
||||||
|
|
||||||
drawManifestant(matrix_model, &_herosId[i], deplacement, GL_TRUE);
|
drawManifestant(matrix_model, &_herosId[i], deplacement, GL_TRUE);
|
||||||
}
|
}
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
|
|
||||||
glCullFace(GL_BACK);
|
glCullFace(GL_BACK);
|
||||||
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
glDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||||
|
|
||||||
|
|
Reference in a new issue