diff --git a/documentation/Nodes/RayMarching/Expression.jpg b/documentation/Nodes/RayMarching/Expression.jpg new file mode 100644 index 0000000..4ff096c Binary files /dev/null and b/documentation/Nodes/RayMarching/Expression.jpg differ diff --git a/documentation/Nodes/RayMarching/GlobalExpression.jpg b/documentation/Nodes/RayMarching/GlobalExpression.jpg new file mode 100644 index 0000000..6632369 Binary files /dev/null and b/documentation/Nodes/RayMarching/GlobalExpression.jpg differ diff --git a/documentation/Nodes/RayMarching/RayMarch.md b/documentation/Nodes/RayMarching/RayMarch.md index 3b7d7c5..e7ce218 100644 --- a/documentation/Nodes/RayMarching/RayMarch.md +++ b/documentation/Nodes/RayMarching/RayMarch.md @@ -1,5 +1,5 @@ # Ray March node -A simple ray marcher. +A simple ray marcher for primitive shapes.
**Controls** @@ -23,21 +23,17 @@ A simple ray marcher. |cube pos|vec3|SDBox|Position offset of the box shape| |cube eulers|vec3|SDBox|Rotation of the box shape in Degrees| |cube scale|vec3|SDBox|Scale of the box shape| -|---|---|---|---| |sphere pos|vec3|SDSphere|Position offset of the sphere shape| |sphere eulers|vec3|SDSphere|Rotation of the box sphere in Degrees| |sphere scale|vec3|SDSphere|Scale of the sphere shape| -|---|---|---|---| |capsule pos|vec3|SDCapsule|Position offset of the capsule shape| |capsule eulers|vec3|SDCapsule|Rotation of the capsule shape in Degrees| |capsule height|float|SDCapsule|Height of the capsule shape| |capsule radius|float|SDCapsule|Radius of the capsule shape| -|---|---|---|---| |cylinder pos|vec3|SDCylinder|Position offset of the cylinder shape| |cylinder eulers|vec3|SDCylinder|Rotation of the cylinder shape in Degrees| |cylinder height|float|SDCylinder|Height of the cylinder shape| |cylinder radius|float|SDCylinder|Radius of the cylinder shape| -|---|---|---|---| |torus pos|vec3|SDTorus|Position offset of the torus shape| |torus eulers|vec3|SDTorus|Rotation of the torus shape in Degrees| |torus small radius|float|SDTorus|Small radius of the torus shape| @@ -47,4 +43,17 @@ A simple ray marcher. |Name|Type|Binding|Description| |---|---|---|---| |distance|float|None|Ray intersection distance| -___ \ No newline at end of file +___ + + +**Extras** +This node is only simple ray marching example, the true power of raymarching can only be achieved by custom SDFs. At the moment I am unable to inject the custom code via visual shaders, so I have provided the custom template at the following location.

+ +The default location can be found at
+`res://addons/ShaderLib/RayMarching/RayMarchCustom.gdshaderinc` + +You can copy the code from `RayMarchCustom.gdshaderinc` and then create a Global Expression/i> node and paste it in your visual shader.
+![Global Expression Node](GlobalExpression.jpg)
+Lastly you also need to create an Expression/i> node, define required input and output parameters and call the custom ray marching function as below.
+![Expression Node](Expression.jpg) +___