Shader execution order

Hi! I was just wondering about the order of execution of the shaders in UE4? By shader I mean the actual text files with the .usf file extension.

Yes, but in the actual source, where does execution start. I haven’t found a ‘main’ function yet.

What do you mean by order? There is no definable order of the USF’s. They are used depending on different situations. ie. The LocalVertexFactory usf would be used when rendering an object that uses the specified factory. Where as the DepthOfField shaders are used during post processing.

Ah I see. Well for Vertex Factory shaders you will find the Main in the BasePassVertexShader, BasePassPixelShader USF. As for other shaders, such as Post Process, do a search through the Engine source code for IMPLEMENT_SHADER_TYPE, The 2nd variable will tell u the USF, the third variable the Entry Point.

Thank you so much!