- Home /
URP material set texture scale
I am getting this weird issue while applying
material.SetTextureScale("_BaseMap", new Vector2(-1, 1));
The right(normal) one is when texture scale is set to normal (1,1); and left one (stretched) is when I try to flip the texture around x by using (-1,1).
This issue only happens in the build! In editor the flip and texture works just fine! Any ideas, what could be wrong here?
For ref. I am using standard URP unlit texture shader. https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@10.2/manual/writing-shaders-urp-unlit-texture.html
Here are couple of things that I've tried
Uncheck UV0 compression from player settings
Disabling mipchain and linear parameter while creating the texture.
This is an RGBA32 type texture which is loaded at runtime. so can't update any of the texture import settings. Further this the texture resolution is a power of 2 as well... so I don't expect any compression setting to cause this!
Your answer
Follow this Question
Related Questions
Using Color.Lerp with Lightweight Render Pipeline 1 Answer
How does Material's "SetShaderPassEnabled" work? 1 Answer
Is there any way to test to see if the project is uing the URP/HDRP? 2 Answers
How to set pre-render properties to UGUI Image? 0 Answers
How to know if my Shader Graph is supported by the SRP Batcher? 1 Answer