Rev | Line | |
---|
[3255] | 1 | struct VS_INPUT { // vertex shader input
|
---|
| 2 | float4 Position : POSITION;
|
---|
| 3 | };
|
---|
| 4 |
|
---|
| 5 | struct VS_OUTPUT { // vertex shader output, pixel shader input
|
---|
| 6 | float4 hPosition : POSITION;
|
---|
| 7 | float2 Position : TEXCOORD0;
|
---|
| 8 | };
|
---|
| 9 |
|
---|
| 10 | VS_OUTPUT PhaseVS(VS_INPUT IN) {
|
---|
| 11 | VS_OUTPUT OUT;
|
---|
| 12 | OUT.hPosition = IN.Position;
|
---|
| 13 | OUT.Position = IN.Position.xy;
|
---|
| 14 | return OUT;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | float4 HenyeyGreensteinPS(VS_OUTPUT IN):COLOR0
|
---|
| 18 | {
|
---|
| 19 | float4 Color;
|
---|
| 20 |
|
---|
| 21 | float2 UV = IN.Position;
|
---|
| 22 | float g2 = UV.x * UV.x;
|
---|
| 23 | float phase = 3 * (1 - g2) * (1 + UV.y * UV.y) / 2
|
---|
| 24 | /(2 + g2) / pow((1 + g2 - 2 * (UV.y) * (UV.x)), 1.5);
|
---|
| 25 | Color=float4(phase, phase, phase, 1);
|
---|
| 26 |
|
---|
| 27 | return Color;
|
---|
| 28 |
|
---|
| 29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.