TL;DR
Experimenting on Texture Raymarching to Create Depth on Materials for Texturing. Texture can be both Procedural & Images and will orient itself towards the normal direction to raymarch.
Introduction
Texture Raymarching is a technique to create volumentric effects from a given texture. Whether given through procedural generation or images, it is quite versatile and considerably fast with minor tweaks. In this article, I demonstrate that approach to create opaque objects looks volumetric, how it can be done, and what’s the limitation in my approach.
Development
Raymarching Texture

Raymarching requires us to iterate over a compile-time defined step to shift the UV towards some defined depth (Gap). In my approach, I raymarch towards the normal direction of the mesh by first calculating its Bitangent from its Vertex Normal and Vertex Tangent. I proceed every iteration by checking whether the Grayscaled Texture is below a certain threshold for it to return a value. This threshold is made bigger each step so we can see a progression of slices of the depth. Here, I simply made it so the values get small each step all normalized to (0-1) w.r.t to the Step.
The code is available Github
Shading

For the shading, I decided to make this effect shine by making a gem stone. Technically, it requires some rather chaotic yet interesting volumetric texture which is achieved with Raymarching. Then, I added some rim lighting and make it interpolate between the Highlight and Depth color. Additionally, I like to make this gem stone emissive so that whether in low-light environment it shines.
Limitations
Because we are using Distance Fields that were originally designed for Distance Field Ambient Occlusion (DFAO), this approach repurposes the technique beyond its intended use. One major limitation is that translucent materials do not support distance fields, meaning this method cannot be used when blending with translucent surfaces. However, if a workaround is implemented using masked materials with temporal dithering, this approach can still be viable. In short, if an object does not have Distance Fields, this effect is unusable.
Another issue is the difficulty of achieving smooth deformations on rapidly moving objects. Since DFAO was not designed for continuous, high-speed real-time updates, this can lead to deformation artifacts that degrade the visual quality of the effect.
Raymarching Textures with the current approach requires a threshold which discretize values. This can make the effect look rough with the color banding visible when the observer is too close to the object.
Another thing worth mentioning is that if you plan to use this technique to manipulate any World Position Offset, it will not work. Because it requires the Camera Vector node for the Ray Direction. You can of course use any other Vector for this, but it will diminish or complicate the Parallax Effect that Camera Vector requires.
Conclusion
Creating Fake Volumetric Effect is rather simple through Raymarching. When use efficiently, it can be not such an expensive trick to achieve beautiful effect. Though its limitation, many workarounds are available to make it your own.



