Download

World Space nodes in Material Editor

Does anyone have any resources that better explain how to use the world space nodes in the material editor? I understand that world space is the absolute coordinate for objects and such but putting that in practice in the material editor I just draw a blank on how to use them.

Thanks in advance

IT can be used for various things, the major one I know of is changing objects color based on world position. This is helpful for adding variety to the level’s foliage.

https://www.youtube.com/watch?v=W2fN9r4MfLY

There are lots of different ways of utilizing these nodes. Here’s just 3 material graphs I’ve posted lately, all of them including ‘world space’ nodes.
Terrain Texturing: https://forums.unrealengine.com/showthread.php?16532-World-Browser-Auto-texturing-the-Terrain-via-materials&p=92322&viewfull=1#post92322
Foliage Vertex Shader: https://forums.unrealengine.com/showthread.php?1795-Foliage-collision-foliage-bend-on-collision-In-engine-feature&p=91355&viewfull=1#post91355
Auto-Blend Textures: https://forums.unrealengine.com/showthread.php?16944-Z-Axis-Oriented-Material-Issues&p=91784&viewfull=1#post91784

Oh very nice. Thank you for the responses guys! This helps a lot.

@ Malkav!an: I noticed in the examples as well as other examples I’ve seen people use a clamp node a lot. Why is that? Do the world coordinates or certain nodes only go from 0-1 or something?

Certain nodes yes, but the world coordinates go from something like -524288 to 524288.

Quite often it’s because Lerp nodes need the alpha input to be within 0-1 range. Sometimes it’s just to have a good value to work with since anything in world space tends to return some pretty large numbers, so you clamp it to 1 or another reasonable value. Also the values might be negative so you clamp the minimum to zero.

Interesting, that’s good to know. Thank you for the explanation! I never realized how much truth there is in the saying “the more you know the more you realize how much you don’t know” till I entered game development.