Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Mask Mode: Ignore doesn't always ignore masks

A topic by Scarlet String Studios created Feb 21, 2024 Views: 152 Replies: 5
Viewing posts 1 to 6

Hey, just reporting some unusual behavior that I came across. I've noticed that some STMs with the Super Text Mesh/Universal/Default shader fail to render when they're masked by something, regardless of what Mask Mode is set to.

I haven't been able to reproduce this in a blank project, because it probably relates to some finnicky stencil shaders in my main project. But, I can "fix" it by switching to the Super Text Mesh/UI/Default shader.

Looking at the code, it appears that Mask Mode: Ignore is doing something a bit more complex than ignoring the mask. On line 6205 of SuperTextMesh.cs, there's some stuff about MaskDepthToID() that calculates the value used for the stencil ref.

Anyway, perhaps there should be a way to just ignore masking altogether? The stencil stuff is pretty finnicky and I never fully understood it myself, but I think you can ignore the masking by setting the Stencil's Ref to 0, or Comp to Disabled or Never. Not sure why this works in the other shader and not in the Universal one, but since masking isn't required for some objects, I'm trying to just simplify things by ignoring the stencil altogether.

Developer

Hey! Before I look into this, did you upgrade to the latest version, 1.13.1? There was an issue with the masking in the shaders in the previous version. You may have to refresh some materials, though... I can give it a closer look soon if it still persists!

Ah, there we go! Seems to be working now in 1.13.1. Thanks!

Btw, looks like 1.13.1 is giving build errors in STMCurveGenerator.cs due to the #if UNITY_EDITOR removing the "using UnityEditor" statement at the top. Build seems to work without that, because the rest of the class still has the directive applied like normal.

Developer

gah oh my god thank you for catching that, as you can see in my patch notes, I was supposed to fix that not building, but messed it up in another way... Really sorry about that! Will patch it soon

Developer

Ok, uploaded a fix for this (Hopefully correctly, this time...) As a note, the build number is the same (v1.13.1)