hook up the right ConvexConnectP

This commit is contained in:
Azaezel 2019-01-30 07:17:29 -06:00
parent 4a5a071075
commit eb7dd20253

View file

@ -4,18 +4,10 @@
#include "../../lighting.hlsl" #include "../../lighting.hlsl"
#include "../../torque.hlsl" #include "../../torque.hlsl"
/*struct ConvexConnectP
{
float4 pos : TORQUE_POSITION;
float4 uv0 : TEXCOORD1;
float4 vsEyeDir : TEXCOORD2;
};*/
struct ConvexConnectP struct ConvexConnectP
{ {
float4 pos : TORQUE_POSITION; float4 pos : TORQUE_POSITION;
float4 wsEyeDir : TEXCOORD0; float4 uv0 : TEXCOORD1;
float4 ssPos : TEXCOORD1;
float4 vsEyeDir : TEXCOORD2; float4 vsEyeDir : TEXCOORD2;
}; };
@ -106,19 +98,19 @@ float defineBoxSpaceInfluence(Surface surface, int id)
float4 main( ConvexConnectP IN ) : SV_TARGET float4 main( ConvexConnectP IN ) : SV_TARGET
{ {
// Compute scene UV // Compute scene UV
float3 ssPos = IN.ssPos.xyz / IN.ssPos.w; //float3 ssPos = IN.ssPos.xyz / IN.ssPos.w;
float2 uvScene = getUVFromSSPos( ssPos, rtParams0 ); //float2 IN.uv0 = getUVFromSSPos( ssPos, rtParams0 );
//eye ray WS/LS //eye ray WS/LS
float3 vsEyeRay = getDistanceVectorToPlane( -vsFarPlane.w, IN.vsEyeDir.xyz, vsFarPlane ); float3 vsEyeRay = getDistanceVectorToPlane( -vsFarPlane.w, IN.vsEyeDir.xyz, vsFarPlane );
float3 wsEyeRay = mul(cameraToWorld, float4(vsEyeRay, 0)).xyz; float3 wsEyeRay = mul(cameraToWorld, float4(vsEyeRay, 0)).xyz;
//unpack normal and linear depth //unpack normal and linear depth
float4 normDepth = TORQUE_DEFERRED_UNCONDITION(deferredBuffer, uvScene); float4 normDepth = TORQUE_DEFERRED_UNCONDITION(deferredBuffer, IN.uv0.xy);
//create surface //create surface
Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer), Surface surface = createSurface( normDepth, TORQUE_SAMPLER2D_MAKEARG(colorBuffer),TORQUE_SAMPLER2D_MAKEARG(matInfoBuffer),
uvScene, eyePosWorld, wsEyeRay, cameraToWorld); IN.uv0.xy, eyePosWorld, wsEyeRay, cameraToWorld);
//early out if emissive //early out if emissive
if (getFlag(surface.matFlag, 0)) if (getFlag(surface.matFlag, 0))
{ {