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"

Add Texture To Material At Point

I would like to allow for some super basic character customization in my game. I would like to be able to choose from different eyes and mouth. The eyes and mouths will just be images/textures. Instead of making a different texture for every permutation (which would be silly), I would like to be able to create a material instance and set the textures of selected eyes and mouth via blueprint.

Can I take the texture as a 2d texture parameter and add the texture at a set x,y that won't repeat? Of course I'll need to add eyes, mouth and maybe more. I have tried adding, multiplying, lerping and much more on texture nodes with no luck.

I wasn't sure if this belongs in Blueprints or Rendering as it is a question regarding materials. I've been googling around all night and I'm not sure if I should be using a mask, painting or something completely different.

I am not great with material nodes and I really need to learn more. Thanks so much for the help in advance :).

Product Version: UE 4.15
more ▼

asked May 02 '17 at 11:05 AM in Blueprint Scripting

avatar image

199 31 29 51

avatar image tehhax May 03 '17 at 12:03 AM

So I just learned about decals. Is it poor design to use a decal on a character as a feature? I'm only going for a basic cartoon look and I'm not sure if it's bad practice to do so. I'd much prefer having a dynamic material but I probably won't be able to accomplish that without a helping hand.

avatar image dillzilla May 03 '17 at 02:08 AM

what you want to do first is setup the UVs for the character in whatever modeling program you decide to use. you want to make each editable part have it's own material. once you do this you can apply a material for each part of the character. your alternative to this would be taking the image you want and adding a vector2 constant that puts it in the position of where you want it on your character but this way involves lots of trial and error.

avatar image tehhax May 03 '17 at 02:49 AM

Thanks for the response! I wanted to take the vector2 route but was unable to accomplish it in a material. I'm not great with anything beyond basic materials and I was unable to find an example of such a material anywhere.

I never considered the UV route to just map different parts of the face. It seems like the "best" solution but I may want to allow the user to move the eyes up/down/closer together. I'm not sure the UV route would let me accomplish that.

I'm playing around with decals on the actor now but I feel like that's an unnecessary performance hit. It seems to be working.

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

1 answer: sort voted first

Ok what you want to do can get pretty complex pretty fast but, here is some answers for you :

  • For the eyes it could make things easier to separate them from the body and give them their own Shader. This ways you could use high resolution texture and you wont have to worry about your mesh UVs. Then making things parametric is pretty easy it should look something like this :

shader : http://imgur.com/kyeaEVT

Blueprint : http://imgur.com/FZcrERt

Now for the mouth its going to be a bit trickier, you will need another texture and then mask the area of the mouth on your UV so that this new texture doesn't affect the whole body. For the blueprint its the same logic as the eyes, you just change the alternative mouth in blueprint, the base texture and mask doesn't need to change unless you have very different face textures.


Now if you want to actually be able to move the eye and mouth position and then save those new position, you need to look for morph target, but its much more advance.

Hope this helped.

more ▼

answered May 03 '17 at 11:08 AM

avatar image

1 1 2 2

(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