Now, I’m not so much interested in porting this example (in link), but some directions on how to do this effectively.
Example Maya Shader File
Underneath the covers, materials are HLSL files…
So I was interested in trying to port examples into Unreal, just to test out how to do it, and to see if the results were good…
Now, most examples out there, are in *.fx formats, what few Shader editors there are mostly export to *.fx formats. But in general *.fx formats are just variations of HLSL files.
They usually have a vertex shader portion…
And then there is a pixel shader portion.
So, I just created an Unreal *.usf, and copy pasted some examples, and was very surprised that for the most part, I got no HLSL compiler errors. For some examples I did get errors, that were mostly from missing functions. That’s another matter.
- My first question is this, does Unreal use any vertex shaders at all? Or are the materials exclusively pixel shaders? Early shaders always had a vertex shader part, and a pixel shader part,
I am not sure, are modern shaders exclusively pixel shaders?
For those that compiled with minimal or no errors, I thought, it should be straight forward to convert into a usable Unreal custom HLSL based material.
My two main issues
- vertex shaders, I don’t know if Unreal handles those at all?
- the inputs into the shader, were the real hard part. How and from where do I source those input values from?
Most require just inputs, but just for the vertex shader, and the results from the vertex shader are then passed to the pixel shader, so that I only need to supply the inputs to the vertex shader, but I don’t know if Unreal deals with vertex shaders?
(continued in next post)