1
\$\begingroup\$

I've made a snooker table in Maya for use in a game in Unity. The felt texture on the table is a tiled texture, I used Blinn, and 'place2dTexture' node to do the tiling.

It all looked great. Except I had hoped to 'overlay' another texture on top of the felt which is the straight line and semi-circle drawn across the table.

I couldn't use the same texture with UV mapping because the felt texture is tiled, and of course the lines texture is not (ie. It is intended to fill the whole plane on 1 to 1).

Is there a solution to this? Basically I need to know a way to overlay a non-tiled, partly transparent texture, on top of a tiled one.

Thanks for any help.

\$\endgroup\$
5
  • \$\begingroup\$ If the image isn't too large / expensive you could probably manually tile the base texture in an image editor and overlay the other texture atop it, making one final "baked" texture to use. \$\endgroup\$ – Ethan McTague May 8 at 4:06
  • \$\begingroup\$ Thanks for this suggestion. I have considered doing this workaround. But it seems odd that this isn't possible in Maya already. Can we confirm first that it is not possible to do this using nodes in the HyperShade etc (excuse if this is a noobie question, I truly dont know if mulitple materials per face is do-able or not. (Or perhaps mulitple Textures per Material). The workaround of manually tiling the felt texture below my lines texture is not desirable. I am doing this purely to learn techniques anyway. Thanks for the help though \$\endgroup\$ – I_Keep_Trying May 8 at 12:46
  • 1
    \$\begingroup\$ I haven't worked with Hypershade much but I know it's a pretty standard node graph - it's definitely possible to overlay two textures atop each other using blend nodes. (knowledge.autodesk.com/support/maya/learn-explore/caas/…) This wouldn't help you with your Unity export, though - you'd have to write a Unity material shader (or find an existing one) that accepts two input tx and combines them in the particular way you want. Hence using image editor is easier \$\endgroup\$ – Ethan McTague May 8 at 17:49
  • \$\begingroup\$ All in all, adding the extra material would probably be similarly 'expensive' on performance and/or way more effort than just making a slightly bigger texture for the model. You could also just add a second quad overtop of your table with the transparent texture on that, now that I think about it, and keep them close enough together nobody can tell. \$\endgroup\$ – Ethan McTague May 8 at 17:51
  • 1
    \$\begingroup\$ The Blend node was what i was originally looking for.... nice! \$\endgroup\$ – I_Keep_Trying May 8 at 23:19
1
\$\begingroup\$

There are a few ways you could accomplish this effect, likely more ways than I can list here:

1. Manual Tiling

Open your tiled felt texture in an image editor like Photoshop, tile it manually to the size of the overlaid texture, producing a single texture, like so:

A manually tiled felt texture

Then, simply apply this one texture to your model. This approach shouldn't be too expensive in the long run if your textures aren't insanely large, although it doesn't feel very elegant or flexible.

2. A Second Plane

This is a bit of a 'hack' solution: In your model, create a second plane very close to the first, and apply the translucent texture to that instead (make it much closer than in this screenshot, and allow the top texture to be transparent):

Two images overlaid

One possible downside of this solution is that, at further distances, your near-together planes may begin to z-fight.

3. A custom Unity shader

Unity has introduced a shader graph system that makes it easier to author shaders by connecting nodes together, similar to how you define materials in rendering software. You would likely simply need to source two textures, using two different sets of UVs on your model, and blend the two textures for your albedo output. You could also author Unity shaders manually to serve this purpose, if you prefer.

This may or may not be more expensive than the above two solutions, on either file size or performance - if you're concerned about that, you could simply test each solution to see what works best for your problem.

One thing to keep in mind when approaching problems like this is that materials authored in programs like Maya using their own material editors, intended for use with their own renderers (i.e. Arnold), can't necessarily map 1:1 to the behaviour of game engines like Unity when you actually go and import your asset - if you spend lots of time trying to get the perfect Hypershade material, chances are you'll have to do a lot of that work over again in your engine.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Thank you so much for the ideas and techniques for doing this. Happily for me, I had already considered option 1 and 2, and indeed I already had a try of doing option 3 (but inside Hypershade only so far not Unity itself). I think i will attempt option 3 first and do the custom Unity shader. Failing that I will go for the two planes approach. Many thanks! \$\endgroup\$ – I_Keep_Trying May 8 at 23:15
  • 1
    \$\begingroup\$ Just a final update after I have now attempted these. As you stated the BlendColors done my blend (or overlay) of the two textures inside Maya BUT the BlendColor node was not able to be exported to FBX. I am sure i could have just exported it with the tiled felt texture only and as you say do the overlay inside Unity. But in the end the duplicate plane is what I went with and it looks great. \$\endgroup\$ – I_Keep_Trying May 9 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.