0
\$\begingroup\$

I am using Unity's URP Decal Projector to display an oval shaped blob shadow texture.

The image's dimensions are 227 x 70. However, when I use it as a base map for my Shader Graphs/Decal material, it just displays as a small circle. The only scaling options I see are Width and Height, which work similar to a Transform's X & Y scale. These can be adjusted to "estimate" the correct size, but it seems very far from precise.

Is there anyway that I can preserve the texture's aspect ratio/native size so that I can display it properly?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Textures are mapped in normalized coordinates, so 1.0 is the far side of the texture, no matter whether it's 2 pixels wide or 2000.

But you van easily achieve an exact aspect ratio by scaling the with:height values to have the same 227:70 ratio as your base map.

Any multiple of 227/70 = 3.2428571428571:1.0 will work.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Just a typo on my part when I plugged it into my calculator, I'm guessing. Width divided by height is the calculation you want here. \$\endgroup\$ Commented Feb 28, 2024 at 20:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.