Custom material in C++
I have a custom shader/material question I cannot seem to find an answer to. Basically, I have three shaders - vertex, geometry and pixel. I also have geometry I need to render using these shaders. I get to the point where I am calling FPrimitiveDrawInterface::DrawMesh - however, the 'FMeshBatch' expects a FMaterialRenderProxy* parameter to be set that I would expect to contain those shaders I need. What I need to know is: how to create a custom FMaterial (or whatever) from my shaders?
I only found two questions on this site to this topic and none really answered the question I have so I am trying to post my own to get a definitive answer. Thanks in advance for any input!
asked Jan 07 '15 at 05:21 AM in Rendering
Unreal only provides graph material editing unlike text for that Unity have, but both just add to deeper more complex shader system that engine habe. if you want to add any shader code in UE4 you need to write usf file and some C++ code to control it, but ofcorse this won't avoid you to make material.
Material editor also provides code node allowing to add the code
Not ot mention you can just make graph doing exact same thing as your shader code, all code material graph is converted to HLSL code so there is no performance impact. Only downside of using material graph is lack of ability to loop and fact you are limited to nodes that there is.
Follow this question
Once you sign in you will be able to subscribe for any updates here