mob-sakai / SoftMaskForUGUI

Enhance Unity UI (uGUI) with advanced soft-masking features to create more visually appealing effects!
https://github.com/mob-sakai/SoftMaskForUGUI
MIT License
1.97k stars 261 forks source link

Pink TextMeshPro UGUI text if SoftMaskable is applied #114

Closed novavision closed 3 years ago

novavision commented 3 years ago

Describe the bug Using TextMeshPro 3.x.x the text material rendered in pink color. I searched for similar issues in closed tickets and found this one #99 where says this issue is fixed in preview 6, but it still exists in preview 14

To Reproduce Steps to reproduce the behavior:

  1. Add TextMeshProUGUI text in maskable element
  2. Click Fix on the main parent SofMask component to auto set SoftMaskable component to all children

Expected behavior TextMeshProUGUI component displayed correctly.

Screenshots SampleScene - TriviaFight - iOS - Unity 2020 1 17f1  PREVIEW PACKAGES IN USE   Metal  2021-02-25 22-39-09

Environment (please complete the following information):

mob-sakai commented 3 years ago

Thank you for your reporting!

novavision commented 3 years ago

Doing some more testing, I found that it's not necessary to click Fix on the parent SoftMask component. This means, masking works pretty well without attaching SoftMaskable to each Graphic components. Is there any reason I don't know why it MUST be attached? I tried it only in simple test scene, not in my project yet.

mob-sakai commented 3 years ago

Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?

novavision commented 3 years ago

Check it here please

mob-sakai commented 3 years ago

See here and import TextMethPro Support.

Then fix TMP_SDF (SoftMaskable).shader and TMP_SDF-Mobile (SoftMaskable).shader according to the error.

// Remove "Resources/" in path
// #include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Shaders/TMPro_Properties.cginc"
// #include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc"
#include "Assets/TextMesh Pro/Shaders/TMPro.cginc"

🎉

novavision commented 3 years ago

Yes, this works now. Sorry, I didn't see such instructions in docs