mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
Side by side rendering
- Side by side rendering implemented throughout the graphics pipeline. - New GuiTSCtrl renderStyle property is set to "stereo side by side" to activate. - You set an IDisplayDevice on the GameConnection to define any vertical FOV, projection offset, and stereo eye offset properties required for the stereo rendering (no display device included with this commit). - Full and Empty templates updated with correct scripts and shaders.
This commit is contained in:
parent
b1feed56fd
commit
b32e7688c2
28 changed files with 465 additions and 41 deletions
|
|
@ -58,8 +58,9 @@ singleton PostEffect( LightRayPostFX )
|
|||
isEnabled = false;
|
||||
allowReflectPass = false;
|
||||
|
||||
renderTime = "PFXAfterDiffuse";
|
||||
renderPriority = 0.1;
|
||||
renderTime = "PFXBeforeBin";
|
||||
renderBin = "EditorBin";
|
||||
renderPriority = 10;
|
||||
|
||||
shader = LightRayOccludeShader;
|
||||
stateBlock = LightRayStateBlock;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,14 @@ struct VertexIn_PNT
|
|||
float2 uv0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VertexIn_PNTT
|
||||
{
|
||||
float4 pos : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 tangent : TANGENT;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VertexIn_PNCT
|
||||
{
|
||||
float4 pos : POSITION;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "farFrustumQuad.hlsl"
|
||||
|
||||
|
||||
FarFrustumQuadConnectV main( VertexIn_PNT IN,
|
||||
FarFrustumQuadConnectV main( VertexIn_PNTT IN,
|
||||
uniform float4 rtParams0 )
|
||||
{
|
||||
FarFrustumQuadConnectV OUT;
|
||||
|
|
@ -36,7 +36,7 @@ FarFrustumQuadConnectV main( VertexIn_PNT IN,
|
|||
|
||||
// Interpolators will generate eye rays the
|
||||
// from far-frustum corners.
|
||||
OUT.wsEyeRay = IN.pos.xyz;
|
||||
OUT.wsEyeRay = IN.tangent.xyz;
|
||||
OUT.vsEyeRay = IN.normal.xyz;
|
||||
|
||||
return OUT;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ float4 main( FarFrustumQuadConnectP IN,
|
|||
|
||||
// Use eye ray to get ws pos
|
||||
float4 worldPos = float4(eyePosWorld + IN.wsEyeRay * depth, 1.0f);
|
||||
|
||||
|
||||
// Get the light attenuation.
|
||||
float dotNL = dot(-lightDirection, normal);
|
||||
|
||||
|
|
|
|||
|
|
@ -58,8 +58,9 @@ singleton PostEffect( LightRayPostFX )
|
|||
isEnabled = false;
|
||||
allowReflectPass = false;
|
||||
|
||||
renderTime = "PFXAfterDiffuse";
|
||||
renderPriority = 0.1;
|
||||
renderTime = "PFXBeforeBin";
|
||||
renderBin = "EditorBin";
|
||||
renderPriority = 10;
|
||||
|
||||
shader = LightRayOccludeShader;
|
||||
stateBlock = LightRayStateBlock;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,14 @@ struct VertexIn_PNT
|
|||
float2 uv0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VertexIn_PNTT
|
||||
{
|
||||
float4 pos : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 tangent : TANGENT;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VertexIn_PNCT
|
||||
{
|
||||
float4 pos : POSITION;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "farFrustumQuad.hlsl"
|
||||
|
||||
|
||||
FarFrustumQuadConnectV main( VertexIn_PNT IN,
|
||||
FarFrustumQuadConnectV main( VertexIn_PNTT IN,
|
||||
uniform float4 rtParams0 )
|
||||
{
|
||||
FarFrustumQuadConnectV OUT;
|
||||
|
|
@ -36,7 +36,7 @@ FarFrustumQuadConnectV main( VertexIn_PNT IN,
|
|||
|
||||
// Interpolators will generate eye rays the
|
||||
// from far-frustum corners.
|
||||
OUT.wsEyeRay = IN.pos.xyz;
|
||||
OUT.wsEyeRay = IN.tangent.xyz;
|
||||
OUT.vsEyeRay = IN.normal.xyz;
|
||||
|
||||
return OUT;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ float4 main( FarFrustumQuadConnectP IN,
|
|||
|
||||
// Use eye ray to get ws pos
|
||||
float4 worldPos = float4(eyePosWorld + IN.wsEyeRay * depth, 1.0f);
|
||||
|
||||
|
||||
// Get the light attenuation.
|
||||
float dotNL = dot(-lightDirection, normal);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue