Ray Marching Shader pt.5 (Colors)

These ray marching shader examples show a couple of different methods of adding colors to ray marched objects. The first example shows how instead of returning only floats for distances with the distance functions from previous examples we can also include colors into the calculations by using a vec4 data type to store a color... Continue Reading →

RayMarching Shader pt.4 (3D Primitive Shapes)

These examples show a collection of different distance functions for basic 3D primitive shapes and how they can be implemented in a ray marching shader. Keep in mind that many more shapes can be created by combining them together with other distance functions like boolean and smooth blending operators. All of the distance functions can... Continue Reading →

RayMarching Shader pt.3 (Smooth Blending Operators)

These ray marching shader examples show smooth blending versions of the boolean distance functions for intersection, union and subtraction. These functions can be used to blend different objects together smoothly to create complex organic looking shapes. The functions can be used in the same way as the boolean intersection, union and subtraction operators but have... Continue Reading →

RayMarching Shader pt.2 (Boolean Operators)

These examples show how boolean operators can be used to create complex shapes from simple ones. This 3d-modelling method is called CSG (Constructive solid geometry). CSG is primarily built on 3 primitive operations named intersection ( ∩ ), union ( ∪ ), and difference ( − ).The diagram below shows an example of what is possible with using this technique: source:... Continue Reading →

RayMarching Shader Pt.1 (GLSL)

On this page, the coding steps to produce a basic Ray Marching fragment shader, that creates a ray marched scene of a sphere and a plane, with basic diffuse directional lighting and shadows.If you quickly want to try out the examples I recommend the web based GLSL editor from the book of shaders over here:... Continue Reading →

Powered by WordPress.com.

Up ↑