Skip to content

abhishtagatya/mirror_scene

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mirror Scene in OpenGL

Mirror Scene in OpenGL using Stencil and Object Masking.

Approach

To create a mirror in OpenGL, I have used the following approach:

  1. Create a Mirror Camera UBO and Set the View Matrix to a Mirrored Version of the Main Camera's View Matrix. Formula Given (V * M * R_z * M^-1);
  2. Create a Real Framebuffer Object (FBO) and Attach a Texture to it for the Real World (Visible in Real View in Display);
  3. Create a Mirror Framebuffer Object (FBO) and Attach a Texture to it for the Mirrored World (Visible in Mirror View in Display);
  4. Create a Mask Framebuffer Object (FBO) and Attach a Texture to it (Masking Certain Objects to not be Blurred).
  5. Compose the Scene together in the Shader to be rendered as a full-quad as the Final Scene. Mirror Scene is Blurred if its not within the Mask (using Gaussian Blur).

Performance

Machine Specification : Intel Core i5-1335U, Intel Iris Xe Graphics, 16GB RAM

Scene FPS CPU-GPU
Composed Scene 90-250

About

🪞 Mirror Scene using Stencil in OpenGL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published