Hi friends:
I’ve wrote a DXUT demo to visualize implicit surface, just like autodesk 123d sculpt+, now I need to do it in UE4, for performance issue, my program will heavily depends on GPU, including shaders and computer shaders.
http://image17.poco.cn/mypoco/myphoto/20150826/00/6208406920150826004758051.gif
Currently I need to pass the local space position from vertex shader to pixel shader, which means I need a customize a v2f struct, also I need to calculate normal vector in pixel shader, means I need to create a customized material, and a compute shader to calculate the vetex’s position before it is sent to vertex shader ( for some reasons I cannot do it in vertex shader). All of these are so easily done in an effect file in DirectX program, but looks like it will be a little diffcult in UE4.
so my questions are:
1 how to customize a v2f struct?
2 how to create a new pixel shader which reads my customized v2f struct?
3 how to apply this new pixel shader to a material and apply this material to my procedural mesh???
I’ll be grateful if someone can give me an answer…
Thanks.