x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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!

alt text

Product Version: UE 4.17
Tags:
capture.png (419.7 kB)
more ▼

asked Sep 22 '17 at 05:19 AM in Rendering

avatar image

grygabrielphon
21 2 3 5

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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. alt text

more ▼

answered Oct 09 '17 at 08:39 PM

avatar image

grygabrielphon
21 2 3 5

(comments are locked)
10|2000 characters needed characters left

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.

more ▼

answered Sep 22 '17 at 10:01 AM

avatar image

Deathrey
7.7k 129 29 289

avatar image grygabrielphon Oct 09 '17 at 08:40 PM

Good idea - this was a helpful suggestion.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question