119 013- 0 039

Steps to render the above sunrise rendering from one viewport to three viewports, to compare three elements of sunrise – Rayleigh, Mie, Rayleigh and Mie:

  • In fragment shaders of the skydome and the area light, set three outputs
  • In CPU, configure three textures for a framebuffer, each of which is rendered from a color attachment [1]. The three color attachments take values of the three outputs from the fragment shaders [2]
  • In the framebuffer, render the two fragment shaders of the skydome and area light to the three textures
  • Render the three textures to three viewports on the screen [2]
image from ios


[1] Fragment Shader Output Buffers. https://www.khronos.org/opengl/wiki/Fragment_Shader#Output_buffers

[2] Render To Texture. http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-14-render-to-texture