- Home /
SetFloat Shader Value question/issue
Firstly, I'm using Strumpy, so if my nomenclature isn't quite accurate, my apologies. The concept/idea of what I'm trying to accomplish should be easily understood.
I've got a texture panning effect set up in a shader. I've been messing around with manipulating a rate variable in my shaders that get multiplied by the Time variable. I use the resulting value in a UV Pan node to move the texture across the service at a certain rate. It works fine in theory, but I've noticed that when I set the value of my "_Rate" it seems to force an update instantly or something that appears to have that look.
To detail it a bit further, I wanted to slow that rate value down to 0, so I used iTween to tween it down using a ValueTo tween. On the "onupdate", I use the new value, which is my rate getting decreased, as the 2nd parameter in my SetFloat for my shader. The result is not only the wheel starts spinning faster and faster despite the number multiplier approaching 0, but also it starts spinning the opposite direction.
I'm wondering if there's something weird about shoving so much changing information into a shader so quickly. Anyone else experience this? I feel as though the offsets are getting compounded for some reason, though I have no clue why.
I had to rework my logic and just use Material.SetTextureOffset instead, which works perfectly, with the same tween doing the manipulation and no UV panning in the shader being used.
Thanks for the help.
I would be interested to know why my question was voted down? Some constructive feedback on what I could do to better word my question would be great. Thanks again.
Your answer
Follow this Question
Related Questions
loop a chain of iTween actions 0 Answers
What is wrong with my shader? 1 Answer
Help Fixing Warnings in this Shader? 2 Answers
How to avoid iTween's AddComponent 0 Answers
Shader Fallback Windows Store App 1 Answer