I ues DistanceCullFade node in Emissive,that’ perfect,fade is working.But I want to use this node to World Positon Offset,then it desn’t work.
I don’t what DistanceCullFade ruturn? float or something?
Hello Eisenhower Jam,
The Distance Fade Cull, outputs a 1-dimensional value in range of [0; 1]. Additional info you might want to consider, the node will always return 1 if the object isn’t culled, and 0 if it is fully culled, and it will transition between those values once the cull distance threshold is passed. However this information is not available to the vertex shader (the part of the shader which can manipulate the vertices), as far as I understood and will always output the value 1 for this part of the shader.
You could use the camera position node and calculate the distance to it, and use that as the lerp alpha.
Hope that helps. Just let me know if you have any questions.
Regards,
Vecherka.
But why it can fade in or fade out with emissive ?Just like the value is 0 to 1 and linear.
The emissive property is part of the fragment shader program, which gets executed after the vertex shader program. In the UE4 material editor those aren’t distinguished to the user, a material consists of a vertex and fragment shader program. In which I don’t want to go into detail, but the vertex shader program get’s some input data and will be executed per vertex, it will then provide calculated data (from the input data) to the fragment shader program which will be executed per fragment (pixel).
I haven’t taken the logic behind this node apart, so I can’t give you any details on exactly how this node works, sorry about that. All you should know about the node is, it will not output the correct value at the point of the vertex shader program execution.
OK~Thanks~