Wanting to move and rotate a material based on distance from player

I have a straight tunnel made of different segments but I need to bend into the distance .

I know I need to use the “world position offset” node to handle this in the material, but apart from that, I have no idea where to start.

Can anyone give me some pointers, as someone who is just starting out in Material editing and coding? Thanks.

Can you show the tunnel, or draw a pic of how you want it to turn?

This should not be hard (rough version of it) to make.

Get world position, substract from it camera position (you may update that as parameter trough blueprints and dynamic instanced material). Then calculate length of that difference.

And you should have distance

Like this:

Isn’t that just perspective?

The artist who made that has a thread which explains how he did it and has a download to the demo: Eternal apex // ambient cyberpunk megastructure endless rider.
Edit: Oh, but it doesn’t show any of the world position offset stuff…

Everything is described in post he gave link to:

Actually I don’t think I went into the World Position Offset details in the thread (just World Origin Shifting, another unrelated concept I was trying to tackle) – I had intended to, sorry :wink:

I’ll see if I can come up with a breakdown on my specific WPO implementation and add a post in that thread. In the meantime I think this is what got me pointed in the right direction:

Beware that WPO isn’t currently supported by any raytracing tech in UE 4.x, or Nanite/Lumen in UE 5, and may have some other rendering gotchas that I can’t recall off the top of my head (I have pages of notes for that project that I’ll have to sift through).

Good luck!

2 Likes

Acatelept himself comes in

IT’S THE MAN HIMSELF!!!

You inspire me acatelept. I eagerly await the possible (but not inevitable) WPO info if you are able to shed some light on it. Your project introduced a lot of concepts to me that I would have never thought about initially, so thank you for posting that thread :slight_smile:

1 Like