R E A L T I M E R E N D E R I N G ( S H A D E R T O Y)
Using WebGL, I recreated ObiWan’s lightsaber using :
Ambient Occlusion
Penumbra Shadows
Worley Based Noise function
SDFs
Post Process light calculations
R A Y T R A C E R E N G I N E
M I N I M I N E C R A F T F I N A L D E M O
1. NPC’s- Modelling a 3D pixelated penguin in MagicaVoxel, I then exported an OBJ and added a parser so that the penguin could be generated in game. Using a simple AI based on time and rand(), it changes directions, and can interact with the terrain through grid marching-based collision testing.
2. Post-Process Shaders - Using a render pass, I created a post process shader whenever the player in LAVA or WATER, that is calculated based on a distance Worley noise function similar to a Voronoi diagram.
3. Texturing - Using UV mapping, I add textures to corresponding block types. They also include Blinn-Phong with a cosine power-based specular intensity.
4. Transparency - enabled alpha blending to support transparent blocks (WATER/ICE/GLASS). Ordering issues were solved by drawing all the opaque objects first, and then the transparent second. Two draw functions were created, and two VBO’s are generated and binded.
5 Interweaved VBO - Instead of having a VBO per attribute (position/color/normals/uv/etc.) I implemented a single VBO that determines attributes based on the GL vertex attribute pointer.
6. Chunking - Because terrains have hundreds of thousands of blocks, I optimize rendering time by only drawing the faces that are visible. If a block is empty, then we draw nothing and move on. This saves a lot of time rendering for stuff we don’t need to see.
7. Dynamic Adding of Terrain - To go in line with chunking, I added a dynamic method to add terrain with a setBlockAt() function, which uses an unordered map of coordinates of x, z positions and Chunks to properly add a block for procedural placement.
M I N I M A Y A
Features:
1. Vertex/ Half-Edge/ Face Selection: You can click on the list on the right and the selected attribute will appear.
2. Adding Midpoints: Once a half edge is selected, you can add a midpoint, which will update the half edges list and the vertex list.
3. Triangulating: Given a face of n edges, it can triangulate to n-2 triangles.
4. JSON/ OBJ loading: The program features its own OBJ and JSON parser, which allows objects of the two file types to be loaded.
5. Skinning/ Binding: Once a JSON & OBJ have been loaded, using a distance based binding function, it will attach the joints and the obj to each other using weights.
6. Joint Manipulation: You can now manipulate joints based on rotation or translation.
7. Catmull-Clark Subdivision: Using the subdivision formula, you round out sharp edges of an object.
S H A D E R S
Manipulation of UVs, vertices, and camera through OpenGL shaders and C++.
R A S T E R I Z ER
A rasterizer for drawing scenes composed of 2D and 3D polygons. Coded in C++.