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"

move texture with mouse y input

Dear develpers

I like to make a texture move with mouse input I like to work with material instance (so it updates instantly)

kindly regards

Product Version: UE 4.19 Preview
Tags:
more ▼

asked Jan 22 '18 at 09:44 AM in Using UE4

avatar image

Ingmar Brauns
25 5 6 11

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

2 answers: sort voted first

You can use a Panner node inside your material, drive it through 2 parameters which you can then update in your Material Instance at runtime.

https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/HowTo/AnimatingUVCoords/

more ▼

answered Jan 22 '18 at 09:50 AM

avatar image

vr_marco
2.2k 10 6 12

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

I deleted my initial comment and then I think you commented on it so now nothing shows up. (I have it the e-mail, though) :| So how would you set up a panner to offset a texture by a constant value without animating it? Because I think that's what OP needs - to drive it only by a parameter.

I'd normally just offset it like this:

alt text

capture.png (194.0 kB)
more ▼

answered Jan 22 '18 at 10:32 AM

avatar image

Everynone
12.5k 72 24 51

avatar image vr_marco Jan 22 '18 at 11:00 AM

Sure, no problem. Yes, I think I understand what the OP is asking and it works also with a Panner, so I fully confirm my answer above.

With a Panner you just have to use Time as a parameter so you can set it through the Material Instance. As you change Time in relation to the mouse movement, the texture pans accordingly.

As usual in UE4 there are multiple ways to do things.

alt text alt text

avatar image Everynone Jan 22 '18 at 11:08 AM

I hooked up a value to time before (and now again) but it does absolutely nothing. Does it really work on your end? Your image does not really show it working. Or am I missing something obvious?

My texture remains as is, no matter what value I feed it. I also tried it with Shared: Wrap/Clamp.

edit: when applying logic here - you're providing a single param - so which direction are you panning then? How would that even work? Confused.com.

edit2: I got it to work but not as you've shown at all - this would do nothing, unfortunately. You cannot change the Time parameter - it has to remain constant. And only then you adjust the coordinates in the panner. Kind of an over-engineered solution unless you want both manual UV shifting and the animation.

edit3: Ok, I take the Edit2 back. You can use Time to shift it around but you need to punch in the coords first. This works.

avatar image vr_marco Jan 22 '18 at 11:43 AM

You set the panning direction through the Speed properties in the Panner. You can also parametrize them if needed.

avatar image Everynone Jan 22 '18 at 11:49 AM

I got it to work the way I was expecting it to but it offers no advantages over the method I suggested and needs 1 extra param to work and a panner node to boot.

Thanks for the input, at least I understand the versatility of the panner - that's gonna be useful at some point! I guess you can pack it all in a v4 and just go with that.

Thanks again.

(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