Vuforia Depth Mask black 깨짐 현상


Depth mask로 작업을 하던 도중


갤럭시 S7에서는 Depth mask가 잘 작동하던것이 갤럭시 S3 탭에서는 

Depth mask에 가려진 오브젝트들이 검정색으로 나오는 버그 발생.


여러가지 테스트 해본 결과

Assets - Vuforia - Shaders 에 있는 DepthMask 쉐이더 코드를 수정하니까 해결됨.


ZTest LEqual -> ZTest Always 로 변경.


17번째 줄 주석처리된게 원본코드 / 18번째 줄로 바꿈.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Shader "DepthMask" {
   
    SubShader {
        // Render the mask after regular geometry, but before masked geometry and
        // transparent things.
       
        Tags {"Queue" = "Geometry-10" }
       
        // Turn off lighting, because it's expensive and the thing is supposed to be
        // invisible anyway.
       
        Lighting Off
 
        // Draw into the depth buffer in the usual way.  This is probably the default,
        // but it doesn't hurt to be explicit.
 
       // ZTest LEqual
        ZTest Always
        ZWrite On
 
        // Don't draw anything into the RGBA channels. This is an undocumented
        // argument to ColorMask which lets us avoid writing to anything except
        // the depth buffer.
 
        ColorMask 0
 
        // Do nothing specific in the pass:
 
        Pass {}
    }
}
cs


ZTest LEqual와 ZTest Always을 켜는 것에 따라서 필요한 곳이 달라서 두개를 따로 만들어두고사용하는것이 속편하다.



댓글

Designed by JB FACTORY