Line | |
---|
1 |
|
---|
2 |
|
---|
3 | void deaultVS(half4 position : POSITION,
|
---|
4 | out half3 wPos : TEXCOORD1,
|
---|
5 | half2 texCoord : TEXCOORD0,
|
---|
6 | out half2 otexCoord : TEXCOORD0,
|
---|
7 | half3 normal : NORMAL,
|
---|
8 | out half3 mNormal : TEXCOORD2,
|
---|
9 | out half4 hPos : POSITION,
|
---|
10 | uniform float4x4 worldViewProj,
|
---|
11 | uniform float4x4 world)
|
---|
12 | {
|
---|
13 |
|
---|
14 | hPos = mul(worldViewProj, position);
|
---|
15 | wPos = mul(world, position).xyz;
|
---|
16 | mNormal = normal;
|
---|
17 | otexCoord = texCoord;
|
---|
18 |
|
---|
19 | }
|
---|
20 |
|
---|
21 |
|
---|
22 |
|
---|
23 |
|
---|
24 | void deaultPS( half2 texCoord : TEXCOORD0,
|
---|
25 | half3 wPos : TEXCOORD1,
|
---|
26 | half3 mNormal : TEXCOORD2,
|
---|
27 | uniform samplerCUBE CubeMap : register(s0),
|
---|
28 | uniform half3 cameraPos,
|
---|
29 | out half4 Color :COLOR0)
|
---|
30 | {
|
---|
31 | Color = float4(1,1,1,1);
|
---|
32 | mNormal = normalize(mNormal);
|
---|
33 | half3 V = normalize(wPos - cameraPos);
|
---|
34 | half3 R = reflect( V, mNormal);
|
---|
35 | R.z *= -1;
|
---|
36 |
|
---|
37 | Color = texCUBE(CubeMap, R );
|
---|
38 |
|
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.