Share Your Experience: Take the 2024 Developer Survey

# Tag Info

### Is there a method to do ray marching style modulus repeat with raytracing?

I've tried to figure this out as well, but I don't think there is a solution that is just as performant as tracing one sphere. Basically you would want to cast one ray to hit a infinite set of ...
Accepted

### Volume Rendering (Path Tracing & Real-Time)

Ray marching is a ray tracing method where you take multiple steps along a ray to find intersection with geometry or to perform integration of in-scattered light from participating media (fog, clouds, ...
• 3,636
Accepted

### Volumetric integration in Frostbite

What is wrong with it seems to be explained on the next two slides: it leads to non-energy-conserving results, where the apparent brightness of the volume changes depending on the scattering ...
• 25k
Accepted

### How to compute normal of surface from implicit equation for ray-marching?

The usual way of doing this with raymarching is to define your surface as a signed-distance field and use finite differences to get the gradient of the distance function at the point you’re sampling. ...
• 2,222
Accepted

### How to align Ray Marching on top of traditional 3D rasterization?

The problem, I think, is that you are comparing two different kinds of depth values. For want of better terms, the rasterizer's depth buffer stores 'parallel' depth, whereas raymarching calculates '...
• 2,392
Accepted

### Why is the z coordinate simply set to 1 for setting up direction of a ray in ray marching

It depends on your setup. Of course you can normalize the direction to have length 1, but it is usually unnecessary. The following figure depicts the differences: Round frustum end face Flat frustum ...
• 952
Accepted

### mapping 3d texture on view frustum (or part of it)

In techniques I've seen that use a frustum-aligned voxel grid (so-called "froxels"), it looks like option 2 in your diagram. The voxels are cuboids in post-projective screen space, so when transformed ...
• 25k

### Vulkan Ray Tracing analogue of Optix's OPTIX_BUILD_INPUT_TYPE_CURVES

I don't think vulkan has any way of natively doing curves. I think you will need to program it yourself using VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, by providing your own bounding ...
• 529
Accepted

### Ray Tracing With Continuous Refraction

You can refer to the available literature on the topic. The papers I am aware of are: Ray Tracing in Non-Constant Media and Interactive Rendering of Non-Constant, Refractive Media Using the Ray ...
• 2,226
Accepted

### Is there a better, more elegant way of translating/rotating my camera in my 3d raymarched world or am I stuck with trigonometry?

A reliable way of getting the forward/left directions relative to the view is to use the camera rotation matrix itself to produce forward, Up and right vectors. ...
• 2,322
Accepted

### Rendering a particle system as a smooth blob

For culling faraway particles: as lightxbulb said, the keyword to search for is "acceleration structure". There are a variety of options: BVH, octree, kd-tree, uniform grid, or some ...
• 25k

### How can I convert signed distance field to a mesh?

with CGAL you can generate mesh by implicit function. https://doc.cgal.org/latest/Mesh_3/index.html Search for "implicit". There is an example of generating meshes from the funciton of a sphere.

### Is there a method to do ray marching style modulus repeat with raytracing?

If you want to warp the space as in the raymarching infinite spheres example, ...
• 121
Accepted

### Reading thesis on cone tracing, did the author make a mistake?

It’s kind of inaccurately stated—by comparing the SDF with a linearly increasing radius, the shape that’s being traced out is a cone with a hemisphere on the end, something like this: At any point ...
• 2,222

### How can I convert signed distance field to a mesh?

After many research I figured out how it works: he defined three buffer in glsl and i get 3 sampler2D for multipass, in each fbo attachments. the params are (buffer : file : id) file is the targeted ...
Accepted

### Why does UV tiling affect performance in volumetric ray marching?

It sounds like you are experiencing a loss of texture cache hit rate on your 3D texture. As with any modern processor, GPUs have a cache hierarchy. Texture units typically read from a local L1 cache, ...
• 25k
1 vote
Accepted

### understanding SDF[Signed Distance Functions] for a torus

This turned into a rabbit hole for me hopefully it helps answer your question, I recommend trying out the various functions on the ShaderToy website. Just drop them in and change the call to "...
• 3,219
1 vote

### understanding SDF[Signed Distance Functions] for a torus

The following video discusses the SDFs of various primitives (linked to torus section): https://youtu.be/Ff0jJyyiVyw?t=491 It discusses a torus but not the capped variant. The rest of the channel has ...
• 113
1 vote

### How to calculate ray-origin and ray-direction in vertex shader working universally for any projection and using interpolators for performance

There is no universal solution here since there are many different small variations that can be applied to get a specific result. One of the things that trips people up when computing ray's in the ...
• 3,219
1 vote

The code isn't taking enough steps for the ray to hit anything where the sphere and the floor meet. minF is smaller in that region, so the ray marches forward until it runs out of steps and then gives ...
• 3,219
1 vote

### Porting from DXR/HLSL to Vulkan Ray Tracing Extension/GLSL

As I understand GLSL_EXT_ray_tracing.txt, gl_RayTmaxEXT contains the current t in intersection shaders, due to the following pieces of information given in ...
• 131
1 vote

### Porting from DXR/HLSL to Vulkan Ray Tracing Extension/GLSL

According to this document, one should be able to extract those values through gl_RayTminEXT and gl_RayTmaxEXT GLSL built-ins for intersection shader. Further comments are welcome.
• 299
1 vote
Accepted

### SSR/RTLR - hitting object/ending condition

The termination condition is that the ray passes through the surface represented in the depth buffer. To track this, you have to calculate the z position of the ray at the current step, and compare it ...
• 25k
1 vote

### Parallax/relief mapping with gl_FragDepth and conservative depth

Unfortunately, gl_FragDepth won't enable you to write outside of the rasterized triangle's screen-space bounds. All it enables is to modify the values written to ...
• 25k
1 vote

### Volume Rendering: Implementation

For your first question, the basic process should be (simplified version): ...
• 952
1 vote

### Frustum aligned volume integration - aliasing issue - temporal reprojection

You can look into alias-free volumetric sampling algorithm by Huw Bowles for potential solution to the ray marching aliasing issues. The basic idea is to snap your samples to planes based on the ray ...
• 3,636
1 vote

### Frustum aligned volume integration - aliasing issue - temporal reprojection

Well actually I think I was doing it wrong. I stored raymarching effects in 2D texture. This is not correct because it suffers from issues. Correct way is store raymarching effect in 3D texture, to ...
• 2,169

Only top scored, non community-wiki answers of a minimum length are eligible