4
votes

Alright, I've seen there's a number of threads about scaling a Texture2D both on here and the Unity forums. That line of searching brought me to now being able to scale Texture2Ds by using this class: http://wiki.unity3d.com/index.php/TextureScale

Now, what I'm currently working on is applying decals directly to the targeted texture. That's working fine. BUT, depending on the texture size and how much it's being scaled over it's geometry, the decal appears at different sizes (without any scaling, see attached image). That's what lead me to even look into scaling a Texture2D.

The mystery is, I'm not sure what kind of math to throw at the scale function to make the decal appear the same size visually no matter which mesh and texture it's on.

decal diff size based on mesh

Any help is much appreciated : ]

1

1 Answers

0
votes

If the texture is twice as large, the decal will be twice as large. So, scale the decal by half, and it will be normal size.

In general, every place you multiply the scale for the texture, divide the scale for the decal by the same amount.