Jump to content

Detecting Stacked UVs | Baking texture issue


mrkmmvl

Recommended Posts

Hi guys. I'm working on a game asset.

In short: I would like to find a solution for detecting stacked UVS of multiple same objects, and then group those UVs except the UVs of the first instance.

Example: Imagine 20 knobs in an airplane cockpit. They all have the same UVs, and when I use the UV layout, with Stack Identical Islands, all 20 knobs share the same exact UV Island. However, when I then go to bake the textures for this in Substance, Substance will bake 20 times into that same one UV space.

So for that reason, I am trying to find a way in which I can detect stacked UVs, and then hopefully also group 19 of them. I will then change the UVs to zero so that Substance doesn't bake the textures into that again.

Possible solution (?):
In the process of writing this, I found out that the UVLayout node can output a @target prim attrib. Now it seems that this is either 0 or -1 and initially it seemed that it actually does exactly what I needed, it applied 0 to non stacked UVs and -1 to stacked UVs except one. However this does not seem to work always, sometimes the target misses stacked things, and sometimes it applies it to also nonstacked things. Plus, it doesn't apply target=0 to only islands from the first object, but rather it picks UV islands from random instances and then puts 0 on those.

I attached a simple example of what I need and what I am getting right now. Hopefully, that will make things clearer.

2 questions:
Does anyone know what is the actual "target" and how does it work exactly?

If not, can anyone think of any better solution?

I've been trying to solve this for years and so far I've been having to group the objects manually. And there are hundreds of objects... Anyway, thanks!

Stacking UVs.hipnc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...