コード例 #1
0
ファイル: tutorial37.cpp プロジェクト: leloulight/ogldev
    virtual void RenderSceneCB()
    {   
        CalcFPS();
        
        m_scale += 0.05f;

        m_pGameCamera->OnRender();

		m_gbuffer.StartFrame();

        DSGeometryPass();

		// We need stencil to be enabled in the stencil pass to get the stencil buffer
		// updated and we also need it in the light pass because we render the light
		// only if the stencil passes.
		glEnable(GL_STENCIL_TEST);

		for (unsigned int i = 0 ; i < ARRAY_SIZE_IN_ELEMENTS(m_pointLight); i++) {
			DSStencilPass(i);
			DSPointLightPass(i);
		}

		// The directional light does not need a stencil test because its volume
		// is unlimited and the final pass simply copies the texture.
		glDisable(GL_STENCIL_TEST);

		DSDirectionalLightPass();

		DSFinalPass();
        
        RenderFPS();
        
        glutSwapBuffers();
    }
コード例 #2
0
ファイル: VRSim.cpp プロジェクト: nburfield/VirtualReality
void VRSim::render(){
  m_gbuffer.StartFrame();

  // perform geometry pass
  DSGeometryPass();

  //fix this plz
  skybox->render();

  //perform point light pass
  glEnable(GL_STENCIL_TEST);
  for (unsigned int i = 0 ; i < m_pointLight.size(); i++) {
    DSStencilPass(i);
    if(!Engine::getEngine()->dirlight){
        DSPointLightsPass(i);
    }
  }
  glDisable(GL_STENCIL_TEST);

  DSDirectionalLightPass();

  DSFinalPass();




  // Get the Error
  // auto error = glGetError();
  // if ( error != GL_NO_ERROR )
  // {
  //   string val = ErrorString( error );
  //   std::cout<< "Error initializing OpenGL! " << error << ", " << val << std::endl;
  // }

}
コード例 #3
0
ファイル: main.cpp プロジェクト: LIngBY/ogldev
    virtual void RenderSceneCB()
    {   
        CalcFPS();
        
        m_scale += 0.05f;

        m_pGameCamera->OnRender();

        DSGeometryPass();
        
        BeginLightPasses();

        DSPointLightsPass();

		DSDirectionalLightPass();
               
        RenderFPS();
        
        glutSwapBuffers();
    }