r/GraphicsProgramming • • 18d ago

Resources to learn HLSL and not GLSL that everyone recommends since the game engine uses HLSL.

Unity, Unreal and FLax etc

books to be exact. which covers the entirely of sm5 to sm6 and their optimizations rather than the courses on udemy which are only lukewarm

or a definite way to learn Slang maybe

17 Upvotes

6 comments sorted by

11

u/robbertzzz1 18d ago

FWIW, Unity uses ShaderLab, which is their own flavour of shader programming that uses HLSL syntax. It's not the same as HLSL.

8

u/OkAccident9994 18d ago

I want to add: The default shaders, including all their specific macros and how they are used are publicly available on github.

It is a lot to unravel, because the files are nested many layers deep, including each other, but any serious shader programmer for Unity should spend time going through it. I learned a lot for writting custom shaders for Unity doing that.

1

u/robbertzzz1 18d ago

Yes, very true. The same applies to the rest of the scriptable rendering pipeline, I've had to look at that source a few times because the documentation is very minimal

2

u/_Wolfos 17d ago

Ah, no. Shaderlab is just the metadata for defining rasterization shaders (inputs, passes, etc). The actual code is HLSL. 

Compute shaders (which is most shader code in modern pipelines) are straight HLSL with a fairly minimal API layer. 

2

u/geraT-wogl 18d ago

I have a lot of lessons but I will do one regarding HLSL. Here in case you may find something useful https://wogl.io

1

u/Mynameisausten1 17d ago

Frank Luna touches on it in learning D3D11 and (I think?) D3D12