Questions tagged [raymarching]
38 questions
10
votes
2 answers
GLSL cube signed distance field implementation explanation?
I've been looking at and trying to understand the following bit of code
float sdBox( vec3 p, vec3 b )
{
vec3 d = abs(p) - b;
return min(max(d.x,max(d.y,d.z)),0.0) +
length(max(d,0.0));
}
I understand that length(d) handles the SDF case…

Fab Castel
- 552
- 5
- 18
2
votes
1 answer
Raymarching Clamping coordinate makes weird streched artifacts
I am trying to render a grid of spheres using ray marching. The SDF function looks like:
float sq_layer(vec3 p, vec3 bounding_box_min, vec3 bounding_box_max)
{
float cell_size = 4.0 / 16.0;
vec3 p0 = clamp(p.xyz, bounding_box_min,…

Jaysmito Mukherjee
- 1,467
- 2
- 10
- 29
2
votes
1 answer
GLSL artefacts when ray marching
In the following shadertoy I illustrate an artefact that occurs when raymarching
https://www.shadertoy.com/view/stdGDl
This is my "scene" (see code fragment below). It renders a primitive "tunnel_fragment" which is an SDF (Signed Distance Function),…

buddhabrot
- 1,558
- 9
- 14
2
votes
0 answers
Exact signed distance function of a rhombic dodecahedron
I'm playing around with a ray marcher engine with voxels shaped as rhombic dodecahedra since they can tessallate the 3D space perfectly like hexagons do for the 2D space.
The thing is that I only managed to come up with an approximation of the…

selimbat
- 21
- 5
2
votes
0 answers
Simple, most basic SSR in GLSL
I'm experimenting trying to implement "as simple as possible" SSR in GLSL. Any chance someone could please help me set up an extremely basic ssr code?
I do not need (for now) any roughness/metalness calculations, no Fresnel, no fading in-out effect,…

Jack
- 73
- 1
- 5
2
votes
0 answers
Traverse octree using Revelles algorithm in a dynamically uniform way GLSL
I am trying to traverse my octree in my compute shader in GLSL (v450) using the revelles algorithm with ray marching in real-time. I have managed to traverse it and I get an image but my fps is extremely low, around 0-5 fps. As the algorithms…

Tothema
- 31
- 4
2
votes
1 answer
Large execution time of OpenCL Kernel causes crash
I'm currently building a ray marcher to look at things like the mandelbox, etc. It works great. However, with my current program, it uses each worker as a ray projected from the eye. This means that there is a large amount of execution per worker.…

Jonathan Pearl
- 711
- 8
- 21
1
vote
1 answer
How to "fly through" volumetric cloud
I am trying to create a Three.js experience (projected on a Mapbox map) in which you can move through the volumetric cloud (I used ray-marching but any other algo you think is better works).
But whenever I move the camera through the cloud, the…

daumann
- 37
- 1
- 11
1
vote
1 answer
GLSL Raymarching special camera setup
I've been fiddling a little into raymarching SDFs in GLSL ES (Shadertoy) and found myself wanting to describe a camera as follows:
vec2 VISIBLE_SIZE = vec2( 20.0, 15.0 ); // how much World Resolution should be visible
vec3 CAM_POI = vec3(…

St0fF
- 1,553
- 12
- 22
1
vote
0 answers
Raymarching - Artifacts when rendering 3D texture
I am working on a project for a client and I am trying to replicate the 3D volume rendering done in the Unity Inspector so I can view changes to 3D volume data in real-time.
Here is an example of what the final output should look like (with and…

Kyle Jensen
- 419
- 9
- 27
1
vote
0 answers
How do I compute ray origin and direction for raymarching using a model view projection matrix?
I am trying to render a raymarched scene in a GLSL fragment shader. I am able to draw the scene successfully when not using a MVP matrix and just marching a ray from a specified camera position in a direction Scene rendered with fixed view, however…

0x003
- 65
- 9
1
vote
0 answers
OpenGL eye position to texture space
I'm following this tutorial by nVidia for implementing a fluid simulation, however i'm confused about this part in the the ray marching algorithm section.
The ray direction is given by the vector from the eye to the entry point (both in texture…

Gianluca Iacchini
- 31
- 1
1
vote
0 answers
Shadow on ray marching volume material
I'm trying to implement shadows in the beam material from UE4 DMX Plugin, so I can use it with a flashlight and stop worrying about light trails cause by volumetric fog, the problem is that I really don't know how, actually, I don't know anything…

Gustavo Moraes
- 11
- 2
1
vote
0 answers
OpenGL: Rotate lookAt camera axis in a compute shader
I'm making a ray marching demo and I have a problem rotating the camera axis. I'm using quaternions to rotate the mouse and casts rays to that direction just fine. An example of the problem: If I turn 180° on yaw and press W it goes backwards…

Kiriakos
- 11
- 4
1
vote
0 answers
Ray marching using depth Buffer
I'm trying to create some screen space effects such as SSR and Global ilumination. I've already noticed that it is donne using rayMarching and depth buffer.
I am familiar with rayMarching algorithm in context of unity and shadertoy . However I'm…

Icaro Amorim
- 385
- 1
- 3
- 13