Creating a Volumetric Ray Marcher in UE51

Anyone managed to reproduce Creating a Volumetric Ray Marcher (shaderbits.com) in unreal engine 5.1? Trying to recreate this shader to study how volumetric clouds work.

  1. Where do I put this part of the code?

  1. After this step:

The shader works in shader and shader instance viewport but just doesn’t work in actual viewport. Any reasons for that?

Does it work when the object is at the world origin and has a scale of 1?

1 Like

It worked, thank you! Any idea what to change to make it work in the local coordinates instead of local?

The next section of code on the blog starts with the following comment

//bring vectors into local space to support object transforms

So if you haven’t implemented that yet, you’ll want to review it as it seems this will have your answer.

This code actually results in the shader only working in world coordinates :face_with_diagonal_mouth:

Enable volumetrics plugin-> check plugin folder → find this shader. Problem is lwctofloat conversion (ue5 lwc feature), as you will find out from this plugin.

1 Like

It worked, thank you!
The problem was that I was using LWCToFloat3x3 with GetPrimitiveData(Parameters).WorldToLocal instead of LWCToFloat and I guess it was discarding translation bit :grimacing:

2 Likes