6.3 Element to support a ray marching algorithm
<Raymarch /> is a special element that creates and renders a signed distance function using the ray marching algorithm, similar to shadertoy. *NOTE: This element is unfortunately not included in the current version as it requires a number of shader sources and image files. It will be released as an addon to threefy soon.
<Raymarch
vshader={vertexShader.glsl}
fshader={fragmentShader.glsl}
uniforms={uniforms}
defines={defines}
textures={[ textureURL1, textureURL2, … ]}
/>
Here vshader and fshader refer to GLSL code. If not set, the following default GLSL codes are used.
// vshader default
void main() { gl_Position = vec4( position, 1.0 ); }
// fshader default
void main() { gl_FragColor = vec4(0.0); }
Previous6.2 Elements for mesh, instanced mesh and merged meshNext6.4 Elements to support nature modeling
Last updated