-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathblack_parts.sha
64 lines (62 loc) · 1.96 KB
/
black_parts.sha
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//Cg
/* Generated shader for render state 0BB79784:
AlphaTestAttrib:greater_equal,0.5
ColorAttrib:vertex
LightAttrib:on
render/cameraNode/sLight
render/plight
ShaderAttrib
TexMatrixAttrib: ts(T:(identity))
TextureAttrib:on ts:fog2
TexGenAttrib: ts(world_position)
TransparencyAttrib:none
*/
void vshader(
in float4 vtx_texcoord0 : TEXCOORD0,
out float4 l_texcoord0 : TEXCOORD0,
//in float4 vtx_color : COLOR,
//out float4 l_color : COLOR,
uniform float4x4 trans_model_to_world,
out float4 l_world_position : TEXCOORD1,
uniform float4x4 trans_model_to_view,
out float4 l_eye_position : TEXCOORD2,
uniform float4x4 tpose_view_to_model,
out float4 l_eye_normal : TEXCOORD3,
in float4 vtx_normal : TEXCOORD1,
float4 vtx_position : POSITION,
out float4 l_position : POSITION,
uniform float4x4 mat_modelproj
) {
l_position = mul(mat_modelproj, vtx_position);
l_world_position = mul(trans_model_to_world, vtx_position);
l_eye_position = mul(trans_model_to_view, vtx_position);
l_eye_normal.xyz = mul((float3x3)tpose_view_to_model, vtx_normal.xyz);
l_eye_normal.w = 0;
//l_color = vtx_color;
}
void fshader(
in float4 l_world_position : TEXCOORD1,
in float4 l_eye_position : TEXCOORD2,
in float4 l_eye_normal : TEXCOORD3,
uniform sampler2D tex_0,
uniform float4x4 texmat_0,
//uniform float4x4 plight_plight0_rel_view,
//uniform float4x4 slight_slight0_rel_view,
//uniform float4 satten_slight0,
out float4 o_color : COLOR0
//in float4 l_color : COLOR
//uniform float4 attr_colorscale
) {
float4 result=float4(0,0,0,1);
float4 l_texcoord0 = l_world_position;
l_texcoord0 = mul(texmat_0, l_texcoord0);
l_texcoord0.xyz /= l_texcoord0.w;
// Fetch all textures.
float4 tex0 = tex2D(tex_0, l_texcoord0.xy);
// Correct the surface normal for interpolation effects
// End view-space light calculations
//result = l_color;
result.a *= tex0.a;
//result *= attr_colorscale;
o_color = result * 1.000001;
}