Skip to main content
GameDev.net gamedev.net
🔒 Locked

Scale World Position According to Object Size?

Started by Shem_Namo Aug 23, 2021 at 1:54 PM 0 replies 3.5k views
Original Post
Shem_Namo
Shem_Namo

Hi everyone, how are you doing?

I am working an a Tri-Planar Map shader and it uses the object space world position to create uv maps.

I ran into a little issue that if I scale the object to be larger the tiling of the texture is effected.

Is there any way to scale the position according to the size of the object?

The goal is for the position to always be between -1 and 1.

I would assume that I need to scale the position by components of one of the scene matrices, but I don't know which one.

Can someone please point me in the right direction?

Thanks in advance.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.