Jamez0r

Are attachments rendered if their Slot has its color alpha value set to 0?

Mostly just curious - I have a Slot that has a couple attachments, and in Unity I'm checking which attachment is selected and doing stuff based on that. Also in Unity, I'm setting the Slot's color alpha to 0, since I don't want to actually see the attachments (just using them to drive some code). So was wondering if the selected Attachment is still getting rendered.

This is only being used for 2 Slots, so it isn't an optimization crisis or anything if they are still being rendered with 0 alpha haha :D

Thanks!
Avatar utente
Jamez0r
  • Messaggi: 358

Harald

Unfortunately no, an alpha value of 0 still adds the attachment with the respective vertex colors. You would need to disable the attachment to prevent it from being drawn. I would immediately add such a check, but unfortunately it would not be semantically correct, since the alpha value means that the vertex color gets a certain color.A value assigned, which could still be interpreted specifically in a custom shader. While it's an unlikely use case, we can't quite be sure that no-one uses it that way. But of course feel free to modify the MeshGenerator class accordingly! 8)
Avatar utente
Harald

Harri
  • Messaggi: 4320

Jamez0r

Thanks Harald! Yeah, was thinking the exactly same thing with a custom shader still potentially doing stuff. Thanks for the info! :nerd:
Avatar utente
Jamez0r
  • Messaggi: 358

Harald

You're very welcome! :)
Avatar utente
Harald

Harri
  • Messaggi: 4320


Torna a Unity