How to both crop and pan a texture in material
I have padded / atlas textures I would like to use in a billboard material I am making. I am trying to figure out a way to both isolate the correct part of the texture, and be able to do operations like panning and tiling on it without getting the rest of the texture in the image. Right now, I can get the cropping looking correct, but then when I offset it or pan it, I see the rest of the cropped part of the image.
I tried passing my UVs through to a custom UV channel but that didn't seem to help.
I would greatly appreciate any guidance!
asked Sep 22 '17 at 05:19 AM in Rendering
I figured this out. The key piece of knowledge for me was that the panner does not output a value between 0 and 1 - it outputs a value that grows with time. Frac was the solution - I just take the decimal portion from the panner to give me a UV between 0 and 1, feed that into my cropping logic before passing those UVs along to the texture.
answered Oct 09 '17 at 08:39 PM
Frac, Floor and Ceil material expressions will help you. You can take a look at flibook material function and adapt what is in there for your needs.
answered Sep 22 '17 at 10:01 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here