Files
JJBB/Assets/BuiltinAssets/Shader/DefaultResourcesExtra/Mobile/Mobile-Lightmap-Unlit.shader

73 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-08-23 15:49:34 +08:00
// Unlit shader. Simplest possible textured shader.
// - SUPPORTS lightmap
// - no lighting
// - no per-material color
Shader "Mobile/Unlit (Supports Lightmap)" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 100
// Non-lightmapped
Pass {
Tags { "LightMode" = "Vertex" }
Lighting Off
SetTexture [_MainTex] {
constantColor (1,1,1,1)
combine texture, constant // UNITY_OPAQUE_ALPHA_FFP
}
}
// Lightmapped, encoded as dLDR
Pass {
Tags { "LightMode" = "VertexLM" }
Lighting Off
BindChannels {
Bind "Vertex", vertex
Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
Bind "texcoord", texcoord1 // main uses 1st uv
}
SetTexture [unity_Lightmap] {
matrix [unity_LightmapMatrix]
combine texture
}
SetTexture [_MainTex] {
constantColor (1,1,1,1)
combine texture * previous DOUBLE, constant // UNITY_OPAQUE_ALPHA_FFP
}
}
// Lightmapped, encoded as RGBM
Pass {
Tags { "LightMode" = "VertexLMRGBM" }
Lighting Off
BindChannels {
Bind "Vertex", vertex
Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
Bind "texcoord", texcoord1 // main uses 1st uv
}
SetTexture [unity_Lightmap] {
matrix [unity_LightmapMatrix]
combine texture * texture alpha DOUBLE
}
SetTexture [_MainTex] {
constantColor (1,1,1,1)
combine texture * previous QUAD, constant // UNITY_OPAQUE_ALPHA_FFP
}
}
}
}