CQ5
CQ5
Before you begin the programming portion of this homework assignment, read and answer the following conceptual questions. Your answers should be submitted on Canvas.
- (5 pts) Given the method by which we divide our 2D space into a 2D grid when computing FBM, Worley noise, and Perlin noise, how might we extend this process into three dimensions? In the case of 3D Worley noise, how many cells would we have to examine to find the closest cell point?
- (5 pts) In at most three sentences, describe the general steps one would need to take in order to render a 3D model with a screen-space post-process effect applied to it using OpenGL.
Extending the 2D grid to 3D in noise generation:
To extend the process into three dimensions for FBM, Worley noise, and Perlin noise, we divide the 3D space into a 3D grid, creating cubic cells rather than square ones. Each point in space belongs to a specific cell, with additional surrounding cells that influence the noise computation based on their distance. In the case of 3D Worley noise, you would typically need to check the closest points in up to 27 neighboring cells (3x3x3 grid) to find the nearest feature point.
Rendering a 3D model with a screen-space post-process effect in OpenGL:
First, render the 3D model to a framebuffer texture instead of directly to the screen. Next, apply the desired post-process effect (such as bloom, blur, or depth of field) by sampling and manipulating the texture in a fragment shader. Finally, render the processed texture onto a screen-aligned quad to display the final output.
Extending 2D Grid Division for FBM, Worley Noise, and Perlin Noise into 3D:
To extend the process into three dimensions, instead of dividing a 2D space into a grid of squares, we divide the 3D space into a grid of cubes. For 3D Worley noise, each point lies within a 3D grid cell, and to find the closest cell point, we typically examine the 27 surrounding cells (the current cell plus 26 neighboring cells), as the closest point could lie in any of these cells.
Steps to Render a 3D Model with Screen-Space Post-Processing in OpenGL:
- First, render the 3D model to a texture (Framebuffer Object, FBO) instead of directly to the screen.
- Then, apply the desired post-process effect (e.g., blur, edge detection) by using a screen-space shader that operates on the texture.
- Finally, render a screen-aligned quad with the processed texture to display the result on the screen.