Unreal 5.3 - Making a volumetric ray marching shader from scratch (part 1)

  Рет қаралды 9,626

Enrique Ventura

Enrique Ventura

8 ай бұрын

In this new video series we will create a volumetric ray marching shader completely from scratch, including a pseudo volume texture editor that we can use in-engine.
Some notes:
- This is based on a tutorial series made by Ryan Brucks, Principal Technical Artist at Epic Games. Check out his blog at shaderbits.com/
- The volumetrics plugin has a pseudo volume raymarcher (also made by Ryan), but the VolumeBoxIntersect function doesn't work properly in Unreal 5.3.1, which causes graphical errors. This video shows how to fix the problem with the function's code.
Texture used in the video: www.dropbox.com/s/9h98z1mlhp1...

Пікірлер: 60
@christopherstrawley7024
@christopherstrawley7024 8 ай бұрын
Thank you for sharing these lessons Enrique! The videos you release always somehow line up with what I'm curious about learning in the engine and I could not be more grateful for your perspective and experience in these topics! Thanks so much!
@isaackershnerART
@isaackershnerART 7 ай бұрын
This Tutorial is amazing! Ive wanted to do something like this for a long time now but never had the will to delve into hlsl and raymarching. You gave me everything I needed to get started and then some!
@EnriqueVenturaGames
@EnriqueVenturaGames 7 ай бұрын
Glad to have helped get you started! Good luck and thanks for the comment!
@Cz_Dani
@Cz_Dani 8 ай бұрын
This is a goldmine for me! Thank you for teaching some really deep topics, volume rendering in unreal was always a scary thing for me that seemed too complex for me as an artist but you really break it to a logical explanation.
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
Thank you for the kind comment! :)
@AboutJOB-dq6pj
@AboutJOB-dq6pj 8 ай бұрын
Nice video!! Thank you for the sharing this!!
@matiasadrianmahler322
@matiasadrianmahler322 3 ай бұрын
This is insanely usefull Enrique, muchas gracias!!! Disabling the depth test means it will be calculated and rendered even when occluded? Or does the distance used to multiply the steps does that optimization by reducing the render calculations when occluded?🤔
@ooorc46
@ooorc46 6 ай бұрын
Love you! Great topic!
@sergiogonzalez2611
@sergiogonzalez2611 2 ай бұрын
WONDERFULL TUTORIAL MAN, JUST WONDERFULL
@EnriqueVenturaGames
@EnriqueVenturaGames 2 ай бұрын
Thank you kindly!
@elgabacho73
@elgabacho73 8 ай бұрын
Muy buenos tutoriales. Saludos!
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
Muchas gracias! Saludos de vuelta! :)
@skydek
@skydek 8 ай бұрын
Buenísimo ¡muchas gracias! tenia artefactos con lo del depth testing al intentar implementar el shader de Ryan Brucks, este tuto me lo ha arreglado :) Ahora a ver si encuentro forma de escalar las mallas de manera no uniforme, que por ahora se rompe la profundidad
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
Ayer estuve un ratillo intentando solucionar el escalado no uniforme y no lo consegui del todo, si das con una solucion sencilla avisa! :D
@skydek
@skydek 8 ай бұрын
​@@EnriqueVenturaGames por lo que he estado probando parece que al hacer la solucion para evitar los errores de depth testing se rompe, es decir, con lo que viene por defecto el plugin de volumetrics en la funcion de VolumeBoxIntersect parece que funciona bien el escalado no uniforme. Ahora bien, no se como, pero he vuelto a lo por defecto y he visto que no tengo el mismo error que pasa en el tutorial antes de hacer el fix; la profundidad funciona correctamente ya de base asi que no estoy seguro si al final este fix del VolumeBoxIntersect es necesario ( aunque no estoy en la 5.3 sino en la 5.1, puede ser que algo haya cambiado) Seguire mirando a ver...
@Froothy
@Froothy 6 ай бұрын
i dont get exactly how it works but it does and i like it
@Labo3D
@Labo3D 8 ай бұрын
Amazing! After a little bit of extra work i decided to integrate the shadows too , was wondering, do you think it would possible to take in consideration the the non uniform scale of the mesh? As for now if the mesh is not scaled accordingly, it seems it's getting distance faded out on Z axis
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
Yeah I'll look into it for the next video :)
@Labo3D
@Labo3D 8 ай бұрын
@@EnriqueVenturaGames you're magic ✨
@Labo3D
@Labo3D 8 ай бұрын
@@EnriqueVenturaGames Just wondering, do you have a good tutorial or course to learn HLSL? I can like revise a lil bit HSLS code (as i did with this project), but i'm not super fond with starting from scratch.
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
@@Labo3D sadly I don't (yet); I've been thinking about doing a series of videos for complete beginners (HLSL, niagara, materials, etc.) but I've been too busy with work and life :)
@Labo3D
@Labo3D 8 ай бұрын
@@EnriqueVenturaGames I totally understand ahah, takes a lot of time to prepare tutorials ^_^ Thanks a lot :)
@haikeye1425
@haikeye1425 6 ай бұрын
Nice!
@JesfNwje
@JesfNwje Ай бұрын
Any chance you could make a volumetric sphere cloud using materials?
@Stryper1456
@Stryper1456 7 ай бұрын
Really great stuff! Thanks for sharing! :) some help if I may? When I hook up the MF_VolumeBoxIntersect into the main shader, I can't see my cloud anymore, even though my Tex Object is hooked up. I end up seeing the box volume itself, as soon as I hook up the BoundingBoxBased UVWs, I can see the cloud once more. I don't have volumetrics enabled in this project, I did however copy and paste the MF from another project and remade it myself. All seems to compile, so I'm unsure where the error has come from :(
@EnriqueVenturaGames
@EnriqueVenturaGames 7 ай бұрын
The VolumeBox Intersect function has some errors in the current version (or at least, something in the LWC system has changed so it doesn't work now). I mention it in the video, including a temporary workaround, not sure if you have done that modification and still have the error.
@Stryper1456
@Stryper1456 7 ай бұрын
Ahh maybe it's further along in the video as I haven't encountered you saying that yet, or possibly I missed it, and if so I apologise. Really appreciate the rapid response by the way@@EnriqueVenturaGames
@Stryper1456
@Stryper1456 7 ай бұрын
Yeah the fix resolved it! 👍Really great content & Support. @@EnriqueVenturaGames
@fran.fndz.techart
@fran.fndz.techart 8 ай бұрын
this is great, i finish the shadow and lighting also, but im having trouble adding animation, i have added distortion effect to the volume but i want to rotate it, rotating the float3x3 WtoL = (float3x3)LWCToFloat(GetPrimitiveData(Parameters).WorldToLocal); in the Z axis does not work properly, but if i rotate the mesh in the editor it works with no issue. if u have spare time, can u try to rotate the mesh and the volume inside the material?
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
Sure, I'll give it a try!
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
Working on part 3, I'll do an entire section on animation because there are multiple options :)
@fran.fndz.techart
@fran.fndz.techart 8 ай бұрын
@@EnriqueVenturaGames glad to read that. I had some issues with animation so I jumped to volume fog / vdb
@hotsauce7124
@hotsauce7124 8 ай бұрын
Question, How would we render these clouds with an alpha background so they can be composited?
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
Haven't tried doing compositing using these yet, but in a worst case scenario you should be able to make a copy of the material that only outputs transmittance, and use that as the compositing mask. I'll look into it for a future video!
@hotsauce7124
@hotsauce7124 8 ай бұрын
That would be an AMAZING future video. Thank you! @@EnriqueVenturaGames
@EnjoyLife-233
@EnjoyLife-233 2 ай бұрын
I'm sorry I can only use software to translate the reply. Thanks for sharing, and I had some problems reproducing the project. When I hook up Color (purple) into the Emissive Color, there will be a light-purple-translucency cube outside the cloud. Then I used Color (purple) multiply Custom return accumdens, and content to Emissive Color, the cloud display is correct. I'm confused about that.
@EnriqueVenturaGames
@EnriqueVenturaGames Ай бұрын
If you just connect the color to the emissive output, the whole mesh (the cube) gets the color applied to it. By multiplying it by the accumulated density, you are only tinting the actual cloud, because the area outside of it has a value of 0 (accumdens)
@ashishthatipelli3279
@ashishthatipelli3279 5 ай бұрын
Can I disable the lightning in these volumes?
@daylight3d
@daylight3d 5 ай бұрын
Nice tutorial. But it would have helpe to paste the code into the video description to copy & paste. I am not a coder and have to check 10 times that every character is in its right place.
@lapotk.3150
@lapotk.3150 3 ай бұрын
@SilverEye91
@SilverEye91 6 ай бұрын
You mention the limitations of the volumetrics in the engine, however, do you need volumetrics activated for this to work anyway?
@EnriqueVenturaGames
@EnriqueVenturaGames 6 ай бұрын
I don't think you need the plugin activated to follow this tutorial. Good luck! :D
@SilverEye91
@SilverEye91 6 ай бұрын
@@EnriqueVenturaGames Thanks! I have some limitations for this project, unfortunately I'm also limited to UE4. I'll probably run into some issues because of that but hopefully I will learn some things. If nothing else for use in future projects with a more modern version :D
@importon
@importon 6 ай бұрын
Is the only geometric shape that contains it a cube? meaning, can I "fill" an object with this material? Basically I'm looking for a way to fill and arbitrary shaped object with smoke.
@EnriqueVenturaGames
@EnriqueVenturaGames 6 ай бұрын
Since volumetric raymarchers work in voxel grids, you still need to start with a cube (of voxels). To "fill an object with clouds", you would need to sample the mesh's surface and then use that information to generate a volume texture, but the texture would still be rasterized using a cube mesh.
@lapotk.3150
@lapotk.3150 3 ай бұрын
🎉
@Curryfishballa
@Curryfishballa 8 ай бұрын
I've got error on the PseudoVolumeTexture function where the TexSampler is unidentified. Any idea how you it worked for you and not me?
@EnriqueVenturaGames
@EnriqueVenturaGames 8 ай бұрын
That is a quirk of the custom node in Unreal. If your texture is not named "Tex", the default "TexSampler" won't work (and you get that "undefined" error). Depending on your Unreal version, you might be able to get it working with Tex.Sampler, but the easiest solution is just to make sure that your input texture is named "Tex"
@Curryfishballa
@Curryfishballa 7 ай бұрын
@@EnriqueVenturaGamesomg!! Thank you Enrique, your tutorials are amazing! I can continue with the tutorial now! Also, your technical art related tutorials on youtube are really something. I’ve learn so much from you with so less!
@EnriqueVenturaGames
@EnriqueVenturaGames 7 ай бұрын
@@Curryfishballa Hey thank you for the kind comments! Feel free to ask questions anytime!
@dusha3030
@dusha3030 7 ай бұрын
I can't manage to get the sampler even though my texture name is Tex. I tried both TexSampler and Tex.Sampler in UnrealEngine 5.3.
@selenepark40
@selenepark40 7 ай бұрын
in my case, I used TextureSampler node for Vol_texture, instead of TextureObject node. You may check that part too :)
How Big Budget AAA Games Render Clouds
10:45
SimonDev
Рет қаралды 258 М.
Её Старший Брат Настоящий Джентельмен ❤️
00:18
Глеб Рандалайнен
Рет қаралды 8 МЛН
🍟Best French Fries Homemade #cooking #shorts
00:42
BANKII
Рет қаралды 62 МЛН
ГДЕ ЖЕ ЭЛИ???🐾🐾🐾
00:35
Chapitosiki
Рет қаралды 12 МЛН
I Made A Blob Shooting Game With Ray Marching
13:33
Visionary 3D
Рет қаралды 36 М.
I went through ALL Unreal Engine Plugins, here is what I found
36:35
Tunnel Effect Niagara System easy to use on Unreal Engine 5
4:38
Studio Cloé
Рет қаралды 16 М.
An introduction to Raymarching
34:03
kishimisu
Рет қаралды 119 М.
The Fog You Didn't Know About in Unreal Engine (Probably)
8:24
VFX r u ok? Why It Feels Like the End of VFX
19:25
Crafthive
Рет қаралды 136 М.
Master Cinematic Fog & Volumetric God Rays in UE5
17:44
Josh Toonen
Рет қаралды 79 М.
Blender 4.2 Beta Is Here with New Features!
26:13
askNK
Рет қаралды 105 М.
Introducing EasyMapper for Unreal Engine 5
28:47
William Faucher
Рет қаралды 208 М.
skibidi toilet zombie universe 30 ( New Virus)
2:32
MonsterUP
Рет қаралды 3,2 МЛН