tests/cuda3.2/tests/smokeParticles/SmokeRenderer.cpp
void SmokeRenderer::beginSceneRender(Target target)
{
    if (target == LIGHT_BUFFER) {
        m_lightFbo->Bind();
        glViewport(0, 0, m_lightBufferSize, m_lightBufferSize);

        glMatrixMode(GL_MODELVIEW);
        glPushMatrix();
        glLoadMatrixf((GLfloat *) m_lightView.get_value());

        glMatrixMode(GL_PROJECTION);
        glPushMatrix();
        glLoadMatrixf((GLfloat *) m_lightProj.get_value());
    } else {
        m_imageFbo->Bind();
        glViewport(0, 0, m_imageW, m_imageH);
    }
    glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
    glDepthMask(GL_TRUE);
    glClear(GL_DEPTH_BUFFER_BIT);
}
// render scene depth to texture
// (this is to ensure that particle are correctly occluded in the low-resolution render buffer)
render scene depth to texture
(this is to ensure that particle are correctly occluded in the low-resolution render buffer)
render scene depth to texture ( this is to ensure that particle are correctly occluded in the low - resolution render buffer )
void SmokeRenderer::beginSceneRender(Target target)
{
    if (target == LIGHT_BUFFER) {
        m_lightFbo->Bind();
        glViewport(0, 0, m_lightBufferSize, m_lightBufferSize);
        glMatrixMode(GL_MODELVIEW);
        glPushMatrix();
        glLoadMatrixf((GLfloat *) m_lightView.get_value());
        glMatrixMode(GL_PROJECTION);
        glPushMatrix();
        glLoadMatrixf((GLfloat *) m_lightProj.get_value());
    } else {
        m_imageFbo->Bind();
        glViewport(0, 0, m_imageW, m_imageH);
    }
    glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
    glDepthMask(GL_TRUE);
    glClear(GL_DEPTH_BUFFER_BIT);
}
void SmokeRenderer :: beginSceneRender ( Target target ) { if ( target == LIGHT_BUFFER ) { m_lightFbo -> Bind ( ) ; glViewport ( 0 , 0 , m_lightBufferSize , m_lightBufferSize ) ; glMatrixMode ( GL_MODELVIEW ) ; glPushMatrix ( ) ; glLoadMatrixf ( ( GLfloat * ) m_lightView . get_value ( ) ) ; glMatrixMode ( GL_PROJECTION ) ; glPushMatrix ( ) ; glLoadMatrixf ( ( GLfloat * ) m_lightProj . get_value ( ) ) ; } else { m_imageFbo -> Bind ( ) ; glViewport ( 0 , 0 , m_imageW , m_imageH ) ; } glColorMask ( GL_FALSE , GL_FALSE , GL_FALSE , GL_FALSE ) ; glDepthMask ( GL_TRUE ) ; glClear ( GL_DEPTH_BUFFER_BIT ) ; }
render scene depth to texture
(this is to ensure that particle are correctly occluded in the low-resolution render buffer)
render scene depth to texture ( this is to ensure that particle are correctly occluded in the low - resolution render buffer )