-
3D Boat Physics
In a Nutshell When an object is submerged in a fluid, it displaces the surrounding fluid. This displacement results in the elevation of the fluid around the object. As the fluid is lifted against gravity, it gains potential energy. The source of this potential energy is the work done by the object in displacing the…
-
3D Airplane Physics
In this post, I’ll discuss simple 3D aerodynamics which can be used in video games & simple simulations. Forces on a Plane There are four important forces acting on an airplane. Weight This acts on airplane’s center of gravity, downward towards the center of the earth. It is constantly acting on a body. So with…
-
Pathfinding Using A* Algorithm
In a Nutshell A* algorithm for finding shortest path is, in simple words same as Dijkstra algorithm with a slight difference. In dijkstra, the algorithm considers edge cost only to determine which node to jump next. In A* however, the algorithm also considers (in addition to edge cost) an estimated value of cost from current…
-
3D Grass Shader with Distortion & Wind
In a Nutshell Player interact distortion: Calculate a vector that points away from player position & assign it to the vertex. This will move the vertex away from player position. This is the core concept behind grass distortion due to player standing on it. (Yes, in reality, you’ll need to normalize this vector, and only apply…
-
Pixelization Shader
Pixelization shader can add a pixel art touch to your game, however it is not pixel art since there are many other things to consider when creating pixelart which pixelization shaders don’t’ do. In a nutshell It is a very simple shader. You need to round off the UVs in order to achieve the blocky…
-
Sea Sickness Shader (Underwater View Shader)
This is one of the simple screen space post processing shaders that you can apply to your game if you want to simulate sea sickness feeling or the feeling of being under the water. If you reduce the strength of the motion, you can apply it to our simple scene to simulate some motion instead…
-
3D Refraction Shader
After you have created vertex part of ocean shader using gerstner waves, you can make your ocean look more better by adding refraction effect for objects under the surface. Bird Eye’s View We need to sample screen texture with distorted UVs based on normals of object. Then we mix the screen texture color with object’s…
-
3D Ocean Shader Using Gerstner Waves
Sine wave displaces vertices up and down. Gerstner wave, in addition to this sine-based y-axis displacement, also does horizontal-axes displacement of vertices using same sine-wave. Imagine a surface made up of many points. Suppose we apply sine function like this:
-
Film Grain Shader
Film grain is one of the final effects that you apply to add a bit of stylized look or realism to your game. The slight imperfections it adds makes scene look more natural. How it works? Film grain is post processing screen space shader; which takes whole rendered scene as texture & applies grains to…
-
Pathfinding Using Dijkstra’s Algorithm
Today, you can use Dijkstra’s pathfinding algorithm to find the shortest path from the gate to cafeteria. After understanding what it is & how exactly it works, we’ll implement it using Python. Later, we’ll implement a more better variant of it called A* algorithm. But in this post, we’ll keep ourselves to Dijkstra algorithm. If you…