mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Direct3D11 common shader changes.
This commit is contained in:
parent
1ff6f221fb
commit
3a9b50f702
283 changed files with 3547 additions and 1834 deletions
|
|
@ -24,7 +24,7 @@
|
|||
#include "../postFx.hlsl"
|
||||
#include "../../torque.hlsl"
|
||||
|
||||
uniform sampler2D backBuffer : register(S0);
|
||||
TORQUE_UNIFORM_SAMPLER2D(backBuffer, 0);
|
||||
|
||||
uniform float3 LensCenter; // x=Left X, y=Right X, z=Y
|
||||
uniform float2 ScreenCenter;
|
||||
|
|
@ -33,7 +33,7 @@ uniform float2 ScaleIn;
|
|||
uniform float4 HmdWarpParam;
|
||||
uniform float4 HmdChromaAbParam; // Chromatic aberration correction
|
||||
|
||||
float4 main( PFXVertToPix IN ) : COLOR0
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float2 texCoord;
|
||||
float xOffset;
|
||||
|
|
@ -75,18 +75,18 @@ float4 main( PFXVertToPix IN ) : COLOR0
|
|||
{
|
||||
// Now do blue texture lookup.
|
||||
tcBlue.x += xOffset;
|
||||
float blue = tex2D(backBuffer, tcBlue).b;
|
||||
float blue = TORQUE_TEX2D(backBuffer, tcBlue).b;
|
||||
|
||||
// Do green lookup (no scaling).
|
||||
float2 tcGreen = lensCenter + Scale * theta1;
|
||||
tcGreen.x += xOffset;
|
||||
float green = tex2D(backBuffer, tcGreen).g;
|
||||
float green = TORQUE_TEX2D(backBuffer, tcGreen).g;
|
||||
|
||||
// Do red scale and lookup.
|
||||
float2 thetaRed = theta1 * (HmdChromaAbParam.x + HmdChromaAbParam.y * rSq);
|
||||
float2 tcRed = lensCenter + Scale * thetaRed;
|
||||
tcRed.x += xOffset;
|
||||
float red = tex2D(backBuffer, tcRed).r;
|
||||
float red = TORQUE_TEX2D(backBuffer, tcRed).r;
|
||||
|
||||
color = float4(red, green, blue, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,10 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "shadergen:/autogenConditioners.h"
|
||||
#include "../postFx.hlsl"
|
||||
#include "../../torque.hlsl"
|
||||
|
||||
uniform sampler2D backBuffer : register(S0);
|
||||
TORQUE_UNIFORM_SAMPLER2D(backBuffer, 0);
|
||||
|
||||
uniform float3 LensCenter; // x=Left X, y=Right X, z=Y
|
||||
uniform float2 ScreenCenter;
|
||||
|
|
@ -43,7 +42,7 @@ float2 HmdWarp(float2 in01, float2 lensCenter)
|
|||
return lensCenter + Scale * theta1;
|
||||
}
|
||||
|
||||
float4 main( PFXVertToPix IN ) : COLOR0
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float2 texCoord;
|
||||
float xOffset;
|
||||
|
|
@ -74,7 +73,7 @@ float4 main( PFXVertToPix IN ) : COLOR0
|
|||
else
|
||||
{
|
||||
tc.x += xOffset;
|
||||
color = tex2D(backBuffer, tc);
|
||||
color = TORQUE_TEX2D(backBuffer, tc);
|
||||
}
|
||||
|
||||
return color;
|
||||
|
|
|
|||
|
|
@ -20,15 +20,14 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "shadergen:/autogenConditioners.h"
|
||||
#include "../postFx.hlsl"
|
||||
#include "../../torque.hlsl"
|
||||
|
||||
uniform sampler2D backBuffer : register(S0);
|
||||
TORQUE_UNIFORM_SAMPLER2D(backBuffer, 0);
|
||||
|
||||
uniform float2 LensXOffsets;
|
||||
|
||||
float4 main( PFXVertToPix IN ) : COLOR0
|
||||
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||
{
|
||||
float2 texCoord;
|
||||
float xOffset;
|
||||
|
|
@ -54,7 +53,7 @@ float4 main( PFXVertToPix IN ) : COLOR0
|
|||
texCoord.x *= 0.5;
|
||||
texCoord.x += 0.25;
|
||||
|
||||
float4 color = tex2D(backBuffer, texCoord);
|
||||
float4 color = TORQUE_TEX2D(backBuffer, texCoord);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue