Where to get started with HLSL shader DEV

Hello guys,

I am a UE4 generalist, aspiring to be a tech artist.

I have an art background but have been using Blueprints for thew last 3 years and i am proficient in scripting game play logic and creating tools that aid look Dev.

However, i would like to gain a better knowledge of shader maths and have the ability to code ray marching and liquid simulations aswell as custom functions in HLSL.

Does anyone know where i can get started on this?

Kind regards

“GPU Gems” books from NVidia.

You can start from basic to specifics… because you need to master concepts and the math behind it and later understand how to apply in UE. I would suggest:

It is a lot of material already to keep you busy for weeks of experimentation.


You mean this: Yet another blog...: Adding Global shaders to UE4 v2.0

Thank you very much guys!!! time to get stuck in!

Does the book of shaders have an answer sheet so i can check my code?

I don’t recall, but you can try your code in shadertoy.com with some modifications in order to show the results, but it is a fast way to do it. I would recommend try do it already in UE using custom nodes, so the early you get used, the better. When getting used, watch this video to learn some tricks here and there:

i’m reading up alot of material on the subject, and im surprised how undocumented learning HLSL shaders from scratch is. I.E taking you from ground floor creating a basic lambert to a PBR material and onto ray marching and beyond.

The book of shaders is a great resource, but i think it assumes C++ knowledge. - To which i have some but not really enough to confidently follow along by myself. The challenges are a great learning device but without a section at the end that reveals the answer to you it’s hard to know whether you fore filled the challenge properly and with the best technique.

Do you think i should first tackle gaining a intermediate C++ understanding first before trying to tackle UE4 Shader dev.

I watched that video before, it was very insightful. But seems more like video aimed at people who can already code HLSL shaders who want to know who to code into UE4, rather then a ground floor introduction to the subject matter.

Sorry if this post seems a little ignorant. maybe i have a lot of study to do.

1 Like

Anything regarding C++ in development for any area (not only game development) requires a lot of understanding. Even on other game engines which has some sort of facilities to work with shaders, will end up needing C++ knowledge to fill the gap between average and astounding solutions. The problem with working with C++ is that when comes any issue, intermediate knowledge will not be enough. As I was already C++ developer prior entering gamedev it is difficult to me to tell how much you need (I have almost 30 years experience with it), but all I can tell is that some errors, being my mistakes or engine source changes producing it, requires all my experience to figure out whats wrong.

The documentation is not enough, but I can tell you that there are not many people out there with all the stuff together (C++, math (deep and a lot of it), HLSL and gamedev knowledge), so it is rare also for a large industry like this one to show so few great work out there.

It is a lot of things to study and you will fill many times your efforts are not producing anything yet, but it will happen and those effort will worth it! I came from a completely different area when started with gamedev and if I recall the 1st very thing worth of a wow (at least my opinion) took almost 2.5 years of study on my spare time when I decided to make the switch to gamedev. Took another year to develop something worth of selling and another year to start receiving proposals into the area. The destination is good, but the fun is really sometimes the trip itself!

1 Like

Thanks for your feedback Nilson! My start is to just refresh my math skills as primer before learning shader specific maths. Im currently following;

Next i shall tackle C++ ive brought and have started following Ben Tristem’s course.

After that i shall take a stab at shader HLSL dev again and see where that takes me. :slight_smile:

I come from eletronic engineering background (emphasis on digital area) and even thou I have to work on the development of something specific with Fast Fourier Transforms and have to read again old books to refresh knowledge I already have touched in the past (25 years ago to be precise), so no worries, the best you can do is to look after the stuff you need at the exact moment the need appears. It is more beneficial to your brain learn different things at a period of time than just only one thing at each same period… it is just how the brain works, you will not overload it, even thou you might think it is too much. We handle this since birth.

1 Like

Hello, if anyone else stumbles across this page trying to learn the basics of vectors and matrices then I encountered some problems with the resource suggested above: Vector Math Tutorial for 3D Computer Graphics

My experience going through this resource is that, although it explains what vectors are and how to work out the Dot and Cross products, it says very little about when and how they’re actually used in 3D graphics.

A bigger problem is that, when it finally gets to talking about matrices, it simply doesn’t tell you how they relate to the vectors they represent. So the matrices sections don’t mean much unless you already know how to convert vectors into matrices, at least as far as I could see.

I’d be left wondering what the point of all this was if I hadn’t also looked at this series on matrices and vectors: 3Blue1Brown

I’d strongly suggest looking at that instead (or at least together with the above).

Nelson and Malak, if u want focus on shader development what you need is only basic understanding of C .both HLSL GLSL are C based languages with out pointers.
Ben cloward will hold ur hand and teach u about HLSL youtube channel https://youtube.com/playlist?list=PL78XDi0TS4lEDHfahG4ddRwZ3AUrOIYcq . Read a couple of HLSL books like Development Cookbook pucket books.I also recommed that u start small with forward shaders, forward lights and the forward rendering pipeline. Then move to deferred rendering . If you have photoshop experince then u already know image kernal convulsion(gussien blur, bloom) it is in par related the concept of spherical harmonics ,circular function, fourier serious