Unreal 5.3 - Making a volumetric ray marching shader from scratch (part 3)
Вставка
- Опубліковано 2 жов 2024
- In this video we will finish our volumetric raymarcher material by adding some animated noise, and make a pseudo volume texture editor that works in runtime, so you can modify these clouds with gameplay effects.
As a remainder, this whole series is based on work by Ryan Brucks; check out his blog at shaderbits.com/
Hola Amigo! Loving this series. Thanks for taking the time! I've been scouring the web all week and this is the first tut that makes sense.
I have to ask because I can't find info on it anywhere... Do you know of any resources that go over creating a Pseudo Volume Texture from a mesh? I am very comfortable in Blender, so that would be a bonus! I am wanting to turn models into textures to use as volumes in UE5 for a current project.
Hi Enrique,
first of all, thanks a lot for the tutorial series, it was really great to watch, good explained, and easy to follow.
I just wanted to ask, if you found a solution for the non-uniform scaling issue in the meantime
How does this compare to the new VDB rendering in UE 5.3, and if I have a VDB, how can I convert it into the texture suitable for this rendering method?
Thank you for this tutorial series! I learned so much about raymarching and materials in general.
Would it be a simple modification to have the material be affected by the light from a spot light instead of or in addition to the sky light?
It is not impossible but it needs a couple changes: the main one is that the traces from a spot light are not parallel, but instead they all come from the same origin; the other change is that the intensity of the light also decreases with the distance (usually squared distance), which must be incorporated when calculating the absorption. Hope this helps! :)
How come UpdateTreaces draw box extend even if it have 0 time 0 thikness and is not connected to any execution? or it should be connected to event tick?
Ahh it is, but it is showed way later
Is it possible to make a shadow cast onto the ground?
Yeah but projected shadows, much like depth sorting between multiple volumes, will need a separate tutorial. Maybe once I finish the ones I'm working on I'll have time to go back to this and add those effects.
Thanks for your answer, can't wait to see your next tutorial~
I would also love to see this project continued. Just about finished with this video, very cool stuff!
hey enrique thank you so much for this series, took me a lot of rewatches but understanding more every time :) but was also wondering how come we weren't using the volume material domain and if the code/theory we went through would apply similarly in that domain too.
Thank you! Yeah, for rendering volumes you can use true volumetric materials and it is a bit more efficient than using pseudo volume textures. The reason for the tutorial to use the pseudo volume approach is that in order to modify these textures in engine you need the appropriate type of render target (and we don't have volume RT in Unreal yet)
@@EnriqueVenturaGames hey Enrique thanks for the reply :) was wondering if you’re able to give a quick breakdown of all the volume rendering capabilities of UE at some point…as someone just starting to look into it it’s all very daunting. Pseudo volume textures, SVTs, VBDs…it’s all so cool but makes my head hurt
Hey, i have problem with this function Texture3DSample() "error: no matching function for call to 'Texture3DSample'", UE 5.4.1, any solution?
I had trouble with that function until I changed TexSampler to texSampler. Maybe it's similar for you.
@@colepeterson5392 still nothing, no matching function, only Texture2DSampler works, but the effect is strange
@@2BRE- Try this: noiseTexure.Sample(texSampler, (pos * 4.0) + noiseOffset); This method works for me with the volume texture but weirdly does not work with 2D textures. Hopefully they sort it out soon.
You are probably not uot using a Volume Texture as the Texture input, make sure you are using VT_PerlinWorley_Balanced
Que crack!!!. jajaja.. y yo sin parar de estudiar no llego a esto ni con programación ni matematicas.. soy un profe y profesional mediocre sin me mido contigo.. si señor!!!!.
Todo es ponerse a ello! Mucho ánimo! :)
This series is hands down the coolest Unreal material tutorial ever. Learned a ton of useful tricks I can apply to any of my future materials. Can't thank you enough for breaking it down the way you do!
btw、it works in editor mode (no need to press play). using utility widge focus to get keybpard click (like Shift for Paint), the mouse position is editor camera vierport forward vector.
so can we make use of render target to mimic smoke effect using some fluid simulation (pseudo fluid simulation)
Hey, when i paste this 2 lines of code on ue5.3.2 im getting error and warning
float4 noisesample = Texture3DSample(NoiseTex,TexSampler,(CurPos*4)+NoiseOffset);
cursample -= max(noisesample.g*(5-cursample),0.0);
"[SM5] D:\Engine\Private\BasePassPixelShader.usf.intermediate.hlsl(231,23-148): warning X3570: gradient instruction used in a loop with varying iteration, attempting to unroll the loop
[SM5] D:\Engine\Private\BasePassPixelShader.usf.intermediate.hlsl(211,5-102): error X3511: unable to unroll loop, loop does not appear to terminate in a timely manner (99 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number"
is there any way around it?
Not sure why you are getting that error, but the most probable cause is that the compiler is trying to unroll the loop because there is something funky going on with the mip mapping level of your texture 3D sample. As the error suggests, you can try [unroll(n)] with the number of steps to force the compiler to write separate, non-branching loops, but I would look into the texture that you are sampling from, maybe you can change the mip settings or force a sample at a specific detail level. Hopefully this helps!
How do I use the material for Niagara particles?
Good content!I have learned a lot from it,How do we handle non-uniform scaling?
Great content! I wil definetly be trying this out.
Our game has an aurora (borealis) in the sky at all times once the light drops. Its a VR game and i would love to be able to find a way to have something like that but with the aurora affecting scattered clouds. Its a near future bumper jumper. :)
That is a good question... once you mix different volumes the depth sorting becomes much more complicated and expensive. At this point simulating an actual aurora effect as part of the atmospheric simulation could be a better approach; I might make a tutorial on something like this in the future, I'll add it to the list of ideas!
Amazing tutorials !
What is this sorcery?
Magic! 🪄🧙♂️
Fantastic!
Thank you! Cheers!
Amazing