Geometry shader

Hi, I can’t find how I can write shaders in UE4. Especially geometry and compute shaders. Maybe someone has any tutorials or articles about how to implement hlsl code.

There’s the custom node in the material editor that will allow you to write your own HLSL code, but if you’re wanting to make your own shader models, then you’ll need a copy of the Github version of UE4 which would allow access to the engine’s shader directory. From there you would write your own HLSL code, save it as .usf and then go into the engine code and add your references to the new shader so that you can open it in the material editor.

Be warned, that adding your own files will lead to very time consuming shader recompiles.

Goto and search ue4 shader ,you will find fist demo.That’s what you want.I’m also finding out how to get the mesh (vertex and index) from the character.If you got it , could you get me a tip also?

To modify the rendering pipeline, which you would need to do in order to utilize new shader stages, you will need to get into the engine code. Compute shaders are relatively simple because they depend on nothing, but you would still need to put your hlsl code in with the engine shaders.

Hello, You can visit my blog. I have written a 虚幻4渲染编程专题概述及目录 - 知乎

1 Like

Thanks a lot, man!!!
You are amazing!!!