Solution

Files changed (1) hide show
  1. lab5-rendertotexture/lab5_main.cpp +11 -0
lab5-rendertotexture/lab5_main.cpp CHANGED
@@ -356,6 +356,17 @@ void display()
356
356
  ///////////////////////////////////////////////////////////////////////////
357
357
  // Task 2
358
358
  // ...
359
+ FboInfo& securityFB = fboList[0];
360
+ glBindFramebuffer(GL_FRAMEBUFFER, securityFB.framebufferId);
361
+ glViewport(0, 0, securityFB.width, securityFB.height);
362
+ glClearColor(0.2f, 0.2f, 0.8f, 1.0f);
363
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
364
+
365
+ drawScene(securityCamViewMatrix,
366
+ securityCamProjectionMatrix); // using both shaderProgram and backgroundProgram
367
+
368
+ labhelper::Material& screen = landingpadModel->m_materials[8];
369
+ screen.m_emission_texture.gl_id = securityFB.colorTextureTarget;
359
370
 
360
371
  ///////////////////////////////////////////////////////////////////////////
361
372
  // draw scene from camera