Tag: 3d
-
Simulating Hydraulic Erosion of Terrain
Hydraulic erosion is a nature-based algorithm that simulates erosion caused by water on terrain. It is useful to make procedurally generated terrains look more realistic & interesting. Hydraulic Erosion Overview Water from mountains come down through slopes, forming creases along the way. This water is then accumulated as is travels, causing the formations of streams.…
-
Marching Cubes Algorithm
Marching Cubes is a meshing algorithm, used to create mesh surface from a scalar field. The scalar field is just a scalar value associated with each point in a space. In simple words, visualize it as an algorithm to convert volume data into a mesh surface. This technique is often used in 3D procedural generation…
-
3D Procedural World Generation
I was making my bird game & the player should be able to fly tens of kilometers to any direction, above the rich forests & deserts. There should be different species of birds flying in beautiful patterns and should interact with the world in a good way. I knew that the answer is procedural generation,…
-
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 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…
-
3D Refraction Shader
My focus is not on realistic refraction, but rather on cheaply computed distortion of screen texture on objects that looks like refraction as in the image. It looks good if applied on ocean shaders, glasses or crystals in games. Cheap Refraction The simulation is done by simply distorting screen UVs using the normal map. And…
-
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: