Implement raymarching surfaces in GLSL

I read many different articles regarding ray marching in GLSL shaders (for example, this article: http://www.iquilezles.org/www/articles/rmshadows/rmshadows.htm ) and he raised some questions that I wanted to ask.

In my application, I show a scene with several grids, and I wanted to experiment with shadows. Although I seem to understand somewhat the concept of raymarching, I don’t quite understand how to properly implement this in GLSL. I know how to calculate the intersection of a ray and a plane, but how will this be processed through the GLSL shaders?

According to this topic here: ( https://gamedev.stackexchange.com/questions/67719/how-do-raymarch-shaders-work ) it mentions that you measure the distance between the beginning of the beam and the surface. Is the surface a mesh reference? Do I need to send an array of planes / points that make up the grid for the shader to calculate the ray intersection test? Do I need to use a depth buffer to determine the distance to the surface?

+4
source share
1 answer

, . -, shadertoy (. ), , ( ).

, . , ( ). , SVO , . , Z- , voxel cone-tracing () (. * Voxel Cone Tracing * : http://gigavoxels.imag.fr/publications.html (, , ). . GigaVoxels: Ray-Guide Streaming Voxel. , BSP, . SVO (perfs, ).

0

Source: https://habr.com/ru/post/1538321/


All Articles