diff options
| author | Dmitry Duka <[email protected]> | 2017-10-31 14:34:10 +0300 |
|---|---|---|
| committer | Dmitry Duka <[email protected]> | 2017-10-31 14:34:10 +0300 |
| commit | 4bc8034acac37e8493a5d166d9573543da149f94 (patch) | |
| tree | 41059b185be6a1d65b13cc2240055fee26a17205 /samples/AnselSDKIntegration/Shaders.fx | |
| parent | Updating Ansel SDK to the latest revision (diff) | |
| download | anselsdk-4bc8034acac37e8493a5d166d9573543da149f94.tar.xz anselsdk-4bc8034acac37e8493a5d166d9573543da149f94.zip | |
Updating Ansel SDK to v1.5v1.5.371
Diffstat (limited to 'samples/AnselSDKIntegration/Shaders.fx')
| -rw-r--r-- | samples/AnselSDKIntegration/Shaders.fx | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/samples/AnselSDKIntegration/Shaders.fx b/samples/AnselSDKIntegration/Shaders.fx index 8c1b4bd..abac43c 100644 --- a/samples/AnselSDKIntegration/Shaders.fx +++ b/samples/AnselSDKIntegration/Shaders.fx @@ -1,59 +1,59 @@ -cbuffer ConstantBuffer : register( b0 )
-{
- matrix World;
- matrix View;
- matrix Projection;
- float4 vLightDir;
- float4 vLightColor;
- float4 vOutputColor;
- float vTime;
-}
-
-struct VS_INPUT
-{
- float4 Pos : POSITION;
- float3 Norm : NORMAL;
-};
-
-struct PS_INPUT
-{
- float4 Pos : SV_POSITION;
- float3 Norm : TEXCOORD0;
-};
-
-PS_INPUT VS( VS_INPUT input )
-{
- PS_INPUT output = (PS_INPUT)0;
- output.Pos = mul( input.Pos, World );
- output.Pos = mul( output.Pos, View );
- output.Pos = mul( output.Pos, Projection );
- output.Norm = mul( float4( input.Norm, 1 ), World ).xyz;
-
- return output;
-}
-
-float4 PS(PS_INPUT input) : SV_Target
-{
- float4 finalColor = saturate(dot((float3)vLightDir, input.Norm) * vLightColor);
- finalColor.a = 1.0f;
- return finalColor;
-}
-
-PS_INPUT VS_Hud(VS_INPUT input)
-{
- PS_INPUT output = (PS_INPUT)0;
- output.Pos = input.Pos;
- output.Pos.w = 1.0f;
-
- if (input.Norm.x > 1.0f)
- {
- output.Pos.x *= 0.8f * abs(sin(vTime * 0.25f)) + 0.15f;
- }
-
- return output;
-}
-
-float4 PS_Hud(PS_INPUT input) : SV_Target
-{
- return float4(0.33f, 0.5f, 0.906f, 1.0f);
-}
+cbuffer ConstantBuffer : register( b0 ) +{ + matrix World; + matrix View; + matrix Projection; + float4 vLightDir; + float4 vLightColor; + float4 vOutputColor; + float vTime; +} + +struct VS_INPUT +{ + float4 Pos : POSITION; + float3 Norm : NORMAL; +}; + +struct PS_INPUT +{ + float4 Pos : SV_POSITION; + float3 Norm : TEXCOORD0; +}; + +PS_INPUT VS( VS_INPUT input ) +{ + PS_INPUT output = (PS_INPUT)0; + output.Pos = mul( input.Pos, World ); + output.Pos = mul( output.Pos, View ); + output.Pos = mul( output.Pos, Projection ); + output.Norm = mul( float4( input.Norm, 1 ), World ).xyz; + + return output; +} + +float4 PS(PS_INPUT input) : SV_Target +{ + float4 finalColor = saturate(dot((float3)vLightDir, input.Norm) * vLightColor); + finalColor.a = 1.0f; + return finalColor; +} + +PS_INPUT VS_Hud(VS_INPUT input) +{ + PS_INPUT output = (PS_INPUT)0; + output.Pos = input.Pos; + output.Pos.w = 1.0f; + + if (input.Norm.x > 1.0f) + { + output.Pos.x *= 0.8f * abs(sin(vTime * 0.25f)) + 0.15f; + } + + return output; +} + +float4 PS_Hud(PS_INPUT input) : SV_Target +{ + return float4(0.33f, 0.5f, 0.906f, 1.0f); +} |