Example #1
0
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;
  // }

}
Example #2
0
    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();
    }
Example #3
0
    virtual void RenderSceneCB()
    {   
        CalcFPS();
        
        m_scale += 0.05f;

        m_pGameCamera->OnRender();

        DSGeometryPass();
        
        BeginLightPasses();

        DSPointLightsPass();

		DSDirectionalLightPass();
               
        RenderFPS();
        
        glutSwapBuffers();
    }
void GLWidget::paintGL()
{
	//Clear the buffers
    gbuffer.startFrame();

    //Draw the sky
    drawSkyBox();

    //Render the Textures for DeferredShading
    DSGeometryPass();

    //Shadow map pass. Render them and blur
    shadowMapsPass();

    //Use of the Textures to Render to the Magic Quad
    DSLightPass();

    getSceneIntensity();
    blurIntensity();

    paintSceneToCanvas();

}