HLSL documentaiton

Hey there!

Is there some kind of documentation where one could read up what and how things can actually be done inside HLSL?

I have no clue whatsoever about the library and I’d like to, for example, find out what the Grid2dCollection.SetGridValue Method is supposed to be passed as parameters…

Thanks and cheers!

Will this do?

Thank you for your reply! As a documentation of HLSL itself, it might even help a bit, but I was actually talking about the library provided by Unreal. I don’t know if they maybe correlate a lot but I will take a look. I do think though that most functionality is actually UE specific.

Currently there is no exposed functionality through blueprints to execute HLSL, but at the material editor you can place a node called “Custom” which enables you to write HLSL code (you can edit the code in an outside editor and paste it inside the node) or if the work you are currently doing is a lot more complex you have two choices:

  • There is an Epic plugin called Lens Distortion (found alongside with engine, even the installed via Launcher) which has everything you need to understand how to use large portions of HLSL code to implement a Pixel Shader and how the work is done with UE4 library (most of it are macros to hide details).
  • Check the UE4 source code to find how Compute Shaders are done, mostly you will find good code which implements the Bloom effect with Convolution Kernel (uses Fast Fourier Transform - adv math) and currently I could say it is a good reference.

HLSL is quite easy as a language, but the trickery you can do with it requires a large amount of 3D computing graphics, and depending on the level of usage you seek, even a more than average math knowledge to master it.

GL on your endeavours!

I am not talking about blueprint, I was mainly referring to the “Custom Hlsl” Node in Niagara modules.

Thanks for the examples however!

Hmm… Niagara was not mentioned thou, but I see that this particular Data really refers to Niagara. Hmm… While inside the emitter editor:

SetGridValue seems to be those 3 attributes: Num Cells X, Num Cells Y and Num Attributes… so likely if you navigate through the editor you will see any how they are composed to get as much clue when doing it with C++. As for accessing those with HLSL I don’t have tried myself it would be better to look at some examples somewhere… I will try to look on other sources and see if I can give any more clues.