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"

Change color in material with many textures

So I have a texture with 14 buttons on it and I need it so if I click button 1 it will turn green, so I have one texture for each button(everyone of these textures are in one material connected to alot of lerps). As you can see in the picture(Blueprint part) level 1 event was just for troubleshooting and level 2 event alt textwas my original idea

Product Version: UE 4.7
elevatorbutton.png (654.5 kB)
more ▼

asked May 15 '15 at 05:34 PM in Blueprint Scripting

avatar image

4 2 4 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi there,

Let's simplify, and move most everything into the shader!

alt text

On the far left of the material window, you can see two variables. Column and row. It should be pretty self explanatory, but you simply put in a 0 in column to keep it in the left column, and then pick a row by number. In this image, you can see I have column zero, row 1 (this is 0 based, you could always fix it to start at 1). There is also a parameter for brightness, and color as well. This should help you simplify things greatly!

Here is the texture I used. Notice I put the "glow mask" in the red channel, and kept the circles themselves in the green channel. This saves us texture memory by packing the information into one texture.

alt text

I hope this helps!

elevator.png (436.9 kB)
more ▼

answered May 15 '15 at 06:17 PM

avatar image

266 6 4 13

avatar image Teodor May 15 '15 at 06:53 PM

Thank you for the answer! But i have a questions,as you can see in the picture below i have replicated what you did(just saying I am very new to Unreal) and I did not get the same resultalt text

materialtest.png (346.7 kB)
avatar image nickpetersonfx May 15 '15 at 07:00 PM

Judging by the texture on the right, you've cut the texture down from being square. This is likely why. It is (generally) good practice to make sure textures are square. You can make it work this way with some changes, however the shader wasn't designed for that. You can use the texture I made if you'd like. You'll also need to be sure you adjust your texcoordinate on the top texture to .25, 1. Since we were only using a quarter of the width of the texture I attached. You could absolutely use the rest of the black area for other textures in your elevator buttons, and should do so!

Hope that helps


avatar image Teodor May 15 '15 at 07:04 PM

oh no the texture is square just that i put it there to show you my texture, it is 2048x2048 alt text

avatar image nickpetersonfx May 15 '15 at 07:05 PM

Ah ok :) In any case, make sure you set the top textures UV to .25 on U, and 1 on V. That should fix ya up! Also, 2048 is probably overkill for how big this thing will be on the screen, unless of course, again, you use up the black space that isn't currently being used!

avatar image Teodor May 15 '15 at 07:14 PM

Yeah! thank you so much! and I would presume that the texcoord on the far left should be U:.25 and V:1...right?

avatar image nickpetersonfx May 15 '15 at 07:16 PM

No, it should just stay as 1 and 1, because it has other math adjusting it, based on the parameter values you are changing. Does that make sense? If you need an explanation, lemme know.

Also, when this is working for you, you should mark this as answered ;)

avatar image Teodor May 15 '15 at 07:18 PM

Ofcourse Thank you!

avatar image nickpetersonfx May 15 '15 at 07:22 PM

My pleasure! Enjoy your day.

avatar image Teodor May 15 '15 at 07:45 PM

Have another problem here(hopefully it is not annoying that I ask so much) as you can see here...alt text

avatar image nickpetersonfx May 15 '15 at 08:36 PM

I don't have your files and didn't know your exact setup, so if you were to change it over to something more like I wrote up for you, you'll likely have to change things to make it work.

avatar image Teodor May 15 '15 at 08:38 PM

Yeah I was affraid of that... anyways Thanks for you time!

avatar image nickpetersonfx May 15 '15 at 08:40 PM

If I were you, I'd just unwrap the object you have to make it work with what I've shown you. It'll make things lots easier on you, I'd bet. Best of luck!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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