블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2737)
Unity3D (817)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-25 09:56

Unity Pro에 있는 Blob Project Shadow를 쓰는데 그림자가 알파가 있는 텍스쳐보다 아래 그려져서 떠보이길래 약간 수정..


겸사겸사 Color Offset도 추가..


Shader "Projector/Projector Multiply Offset" { 
    Properties {
        _ShadowTex ("Cookie", 2D) = "gray" { TexGen ObjectLinear }
        _FalloffTex ("FallOff", 2D) = "white" { TexGen ObjectLinear }
        _Tint ("Offset", Color) = (0,0,0,0)
    }
 
    Subshader {
	Tags { 
		"RenderType"="Transparent"  
		"Queue"="Transparent+100"		 // 알파 텍스쳐보다 위에 그리기 위해 Queue를 올림..
		}
		
        Pass {
            ZWrite Off
            Offset -1, -1
 
            Fog { Color (1, 1, 1) }
            AlphaTest Greater 0
            ColorMask RGB
            Blend DstColor Zero
            SetTexture [_ShadowTex] {
                combine texture, ONE - texture
                Matrix [_Projector]
            }
            SetTexture [_FalloffTex] {
                constantColor (1,1,1,0)
                combine previous lerp (texture) constant
                Matrix [_ProjectorClip]
            }
            SetTexture [_FalloffTex] { // add offset
                constantColor [_Tint]
                combine previous + constant
            }
        }
    }
}



참조 : http://forum.unity3d.com/threads/25162-Projector-Multiply-With-Alpha

반응형

'Unity3D > Shadow' 카테고리의 다른 글

셰도우캐스터(ShadowCaster)를 활용한 그림자 생성 변경  (0) 2014.03.29
유니티 3D에서 그림자 설정  (0) 2014.03.29
실시간 그림자  (0) 2014.03.07
Posted by blueasa
, |