HLSL Shaders in UE4 | Tutorials | R&D | Practice

hlsl

Hi, guys, i am learning hlsl for the last couple of months and I realized that there are not many resources available on the internet. I learned basic from Ben Cloward youtube playlist hlsl in 3ds max . then I tried to convert shadertoy’s glsl to hlsl in ue4 material custom node and also in Niagara hlsl node. and this was the best way to practice hlsl. so now I have created basic tutorials and some more hlsl video on my youtube channel so I thought there should be one place where all artist can share and find resources for hlsl in ue4.

24 Likes

here is my first video of hlsl in ue4

3 Likes

I will share many more hlsl videos and gifs in the coming days. I am hoping people will start publishing resources here so I will learn more from that.

1 Like

here is one more video in this I am showings how did I convert shadertoy’s glsl to hlsl in ue4 material custom node and niagara hlsl node

1 Like

raymarch_morph

simple morph using raymarch hlsl code in ue4 material custom node. just took sphere function and cube function from this site then used lerp to morph from sphere shape to cube shape.

blob

simple morph using raymarch hlsl code in ue4 material custom node. just took sphere function and cube function from this site then used smoothunion function from same site.

7 Likes

here is the Parallax Plexus HLSL Shader in UE4 Material Custom Node. check HQ video

7 Likes

here is one more HLSL Shader for the Parallax effect I used the virtual plane 3 times with different offset. HQ Video

3 Likes

Snowfall HLSL Shader in UE4 Material Custom Node. HQ Video

3 Likes

Voronoi HLSL Shader in UE4 Material Custom Node. I have added some parameters to change the pattern, distort mesh value, and color temp. HQ Video

2 Likes

Really good stuff!

I have stumbled with translating Shadertoy’s (and HLSL in UE4) in general for a long time. I know the different syntax etc. but there is still so many obstacles, for example I can’t for the life of me figure out how to define UV’s in HLSL.

Would you ever consider recording a walkthrough of sorts on how you go about when translating a shadertoy to HLSL in UE4? would be very much appreciated!

EDIT: nevermind, just saw that you had a video posted about this above.

I have the same situation as you. I know many syntaxes but still sometimes I got a weird error. like ufloat in glsl and sometimes it compiles but does not show the same output as in shadertoy.

I have followed this guy for a while back when i was tinkering with shaders for fun on Shadertoy and he’s absolutely amazing. I managed to follow along in UE4 just fine for most of his videos. As long as he’s not creating his own functions it’s fairly easy to convert to UE4 custom HLSL.
I know that technically you can add your own functions but you need to edit the shaders file in the Project folder which is a bit too ambitious for what i’m doing.

1 Like

i have seen his videos. yes, he is amazing. it took me very long how to use the function in hlsl ue4.

Blur HLSL Shader in UE4 Material Custom Node. it gives different cool outputs with different images. HQ Video

1 Like

tried this cute little effect with HLSL in ue4 custom material node. HQ Video

1 Like

Rays HLSL Shader in UE4 Material Custom Node. HQ Video

1 Like

This all looks awesome, thanks for taking the time to post what you’ve learned!

I was curious if you have experience with GLSL and what difficulties there may have been learning HLSL to make these shaders. I’m still relatively new to shader development and I’ve only worked in Unity with GLSL, however I’d like to branch out to be more diverse when it comes to writing shaders.

I faced lots of problems when converting glsl to hlsl. like how to use mat2 in hlsl and how to multiply matrix with vectors and still facing problem with texture sampler.

Good to know! Are there any resources you’d be willing to share about dealing with those issues?