Questions tagged [raymarching]

38 questions
0
votes
1 answer

Normal estimation of signed distance function just won't work

I'm trying to create a compute shader in Unity that performs raymarching. So far I have an SDF of a box and a ray generation / marching function all of which seems to work fine: struct Ray { float3 position; float3 direction; }; Ray…
0
votes
0 answers

x87 - Issue in raymarcher

Below is my raymarcher, mostly adapted from https://www.shadertoy.com/view/llt3R4# The expected behavior is a projection of a sphere on the screen, but instead it projects empty space (signified by a yellow pixel, instead of a purple one). This is…
Qh4os
  • 23
  • 4
0
votes
0 answers

GLSL black screen, shader doesn't do anything

I am writing a basic Sphere-Tracer in a fragment shader, everything is doing fine if I just color points according to their surface normals, but as soon as I try to implement the reflecting algorithm, it takes a bit longer to compile, and just…
NatMath
  • 78
  • 6
0
votes
1 answer

Raymarching on rasterized shape

I have been wondering how I can combine two methods of rendering in a way that the rasterized on-screen shape serves as a canvas for ray-march based rendering in fragment shader. Take these beautiful examples: https://www.shadertoy.com/view/XsjXRm…
lhog
  • 105
  • 1
  • 8
0
votes
1 answer

Why am I getting a for-loop error in Unity RayMarching shader?

This is my first shader so it's probably some dumb tiny error. I'm following a tutorial on YouTube: https://www.youtube.com/watch?v=S8AWd66hoCo&t=83s&pbjreload=10 I'm stuck with the distance function (for a sphere) and simply can't get it to work…
0
votes
0 answers

Remove fisheye distortion when calculating vectors for raymarching

I am trying to write an opencl kernel for raymarching. Everything works except there is noticeable fisheye distortion in the resulting images, as seen in this example: (This is supposed to be a cube) The problem lies in the way I construct the…
Plasmabot
  • 23
  • 4
0
votes
1 answer

what's wrong with it - or how to find correct THREE.PerspectiveCamera settings

I have a simple THREE.Scene where the main content is a THREE.Line mesh that visualizes the keyframe based path that the camera will follow for some scripted animation. There is then one THREE.SphereGeometry based mesh that is always repositioned to…
wothke
  • 130
  • 1
  • 8
0
votes
1 answer

Integrating multiple raymarching samples

Let's say I'm using raymarching to render a field function. (This on the CPU, not the GPU.) I have an algorithm like this crudely-written pseudocode: pixelColour = arbitrary; pixelTransmittance = 1.0; t = 0; while (t < max_view_distance) { point =…
David Given
  • 13,277
  • 9
  • 76
  • 123
1 2
3