Home Unreal Engine

Trying to make a texture of a window into outer space, need help with scaling.

Offline / Send Message
Pinned
Hello! I'm making a window into space and I would like the texture of the stars to look like it's always the same distance away, so it would need to shrink as the player gets closer, and increase as the player backs up. So far I have the texture move horizontally with the player, but I can't figure out the scaling thing at the same time. It appears to work at a far distance, but fails when the player gets really close. Please help! For bonus I would also love for rotation to affect the texture toooooo. Thank you!

Update!: I made it work, but only for X facing walls Here's how and maybe you can help from here:

Absolute World Position (subtract) Camera Position = A
A --> Split Components R, G, B.
G (divide) A = X
B (divide) A = Y
X and Y --> MakeFloat2
Result --> UVs

This method totally explodes for Y and Z facing walls.
...hope this makes sense.
...hope there's a better method.

Replies

Sign In or Register to comment.