Material - Draw 3 Overlapping Textures?

Basically I’ve got an eye. I want to draw, in this order, back to front:
White (eyeball; vector color)
Iris
Highlights (bc they can move)
Eyelid
Maybe Eyebrow

Is there a cheap way to just draw the textures one after the other in order?

If not I think I can just get creative with UVs and overlapping duplicates of geometry… but that’ll cost more textures, resolution, ect.

You could make a Mask texture of your eye with:

R: Iris
G: Highlights (bc they can move)
B: Eyelid
A: Maybe Eyebrow

Multiply each channel with a color value
Then, if the areas do not overlap, you can simply add them together, or if blending is desired use lerps (more expensive).

Is the suggestion to somehow create the mask each frame using a render target? Because at the moment I’m not terribly sure?

To clarify, the whole thing is to be animated using parameters. So the textures will be panning individually of one another. The iris will move to imitate looking around. The highlights will move with the Iris by default but also be setup to “wiggle” (same with the Iris actually) in order to add some motion and life. The eyelid will close (just texture swaps) and be used for other stuff on occasion. This all means that I’ll be dealing with 3 RGBA textures as far as I can tell.

Basically yes.
In this case I would suggest to use a flipbook for the mask(s).

Hmm… That could work if I just broke it down into a few set positions for each thing. the problem is that in order to have all of that work I’d be using a lot of texture memory and enjoy the complicated process of moving the iris, masking out where it should be, adding that to a channel… Overall, for a lot of reasons, I’ll have to say that it’s not a viable solution. Simply put even if I just ate 5 draw calls to “brute force” make the eyes work that would be better than spending ages making masks like that work and maybe having it perform similarly or worse overall.

Like I appreciate your response - normally I don’t even get a reply - but for what I have in mind it’s not reasonable. Was mostly posting hoping to find out “Yeah no if you just add them together in order it’ll magically work” :stuck_out_tongue: I’m confident in my solutions; I just don’t want to reinvent a wheel that may already exist. It’s not that you can’t mask out an eye and make it work! You could even do it with Vertex Colors. The problem is that I need my eyes to look AT things and generally look alive. Let’s say I have 6 positions I need the eyes to look in, 3 eyelids (open, half-open, closed), and 3 places the highlights wiggle.

That’s 3 * 3 * 6 = 54 possibilities and thus 54 masks I’d need to make. Not to mention I need my iris to wiggle as well (it’s a thing eyes do… like a vibration thing) D: so that’s even more.

Then I need to keep all of my painted textures the same shape - if I have an iris that’s round vs oval, highlights that are stars vs circles, ect. Then I have to make an entirely new set of masks for them.

Additionally I’ll need to make a system to support all of this using Render Targets, ect. D: Just overall it’s looking pretty heavy handed.

Thinks some more Unless the idea is to use a Render Target to hold the textures dynamically?
Like. I have an Iris, Highlight, and Eyelid Texture. I draw them to a Render Target as individual masks at X position. I then somehow use that… and ugh this hurts my sleep-deprived brain D: ; And Render Targets are a pain in the butt to draw stuff to in a precise manner - last I checked there is no “draw Iris.png at 5x,52y” ; not that it would be any easier as I’ll still be doing the same thing in the normal material - guess, check, write down the answers for my particular case and then use them. I’m just not sure if this is worth the time to do / performs better than the alternative. I’ll look around. It might be worth it? Frankly at this point I’m even considering just sticking in Epic’s eyes :stuck_out_tongue: Only reason I haven’t is because I don’t have a facial rig and would need to set some stuff up but… maybe it’s worth it. Much to look into.

Again, thank you for your time. I don’t want to discount its usefulness - I may even just be looking past what you’re suggesting.

Just lerp them together in some order (maybe Eyelid - White - Iris - Highlights) using grayscale masks so you can use the UV input of the texture sampler to move the iris/highlights. You can just paint the masks, no idea how your UVs are set up though.