[VIDEO + IMAGES] Help Me Solve This (Probably Simple) shader math problem?

[QUOTE=Eric Ketchum;134098]
Hey TheJamsh -

I didn’t get a good look at your UV Math from your earlier post but I believe if you Take Absolute World Position and subtract Object Position WS and plug the results instead of your Reflection Vector into your UV math you will get the results you are looking for.

EDIT - Nope never-mind thought I had it found my error
[/QUOTE]

Haha, thanks for looking anyway Eric :slight_smile: I need the likes of Ryan Brucks or to help me out on this one…

Basically thinking about it another way, I want to render a UV-gradient on an object that is always aligned to the screen, and also respects how large it is on-screen. So regardless of size, the left-most pixel of the object would always be black (in the green channel) and the right-most pixel would always be white, and map a gradient in-between them. Reflection vector gets fairly close, and I tried feeding it a camera-aligned flat normal but that didn’t quite work either.

The extra part of the problem, is that the gradient needs to map the object the same way regardless of how much of it is on-screen, so I can’t really use screen-space math to do it (I don’t think), because as soon as part of it goes off-screen, the pixel shader will just take left-most pixel that’s on screen, not on the object if that makes sense.