ignore w component in default path

This commit is contained in:
James Fulop
2016-09-29 17:26:29 -04:00
committed by baldurk
parent ceeba57c12
commit bd14750702
2 changed files with 21 additions and 26 deletions
+6 -5
View File
@@ -1,18 +1,18 @@
/******************************************************************************
* The MIT License (MIT)
*
*
* Copyright (c) 2016 Baldur Karlsson
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -197,7 +197,8 @@ void defaultPath(uint threadID)
vec4 wpos = meshpick.mvp * pos;
wpos.xyz /= wpos.www;
if(meshpick.unproject == 1u)
wpos.xyz /= wpos.www;
wpos.xy *= vec2(1.0f, -1.0f);
+15 -21
View File
@@ -86,20 +86,20 @@ void RENDERDOC_MeshGS(triangle wireframeV2F input[3], inout TriangleStream<wiref
float4 RENDERDOC_MeshPS(wireframeV2F IN) : SV_Target0
{
uint type = OutputDisplayFormat;
uint type = OutputDisplayFormat;
if(type == MESHDISPLAY_SECONDARY)
return float4(IN.secondary.xyz, 1);
else if(type == MESHDISPLAY_SECONDARY_ALPHA)
return float4(IN.secondary.www, 1);
else if(type == MESHDISPLAY_FACELIT)
{
float3 lightDir = normalize(float3(0, -0.3f, -1));
if(type == MESHDISPLAY_SECONDARY)
return float4(IN.secondary.xyz, 1);
else if(type == MESHDISPLAY_SECONDARY_ALPHA)
return float4(IN.secondary.www, 1);
else if(type == MESHDISPLAY_FACELIT)
{
float3 lightDir = normalize(float3(0, -0.3f, -1));
return float4(WireframeColour.xyz*abs(dot(lightDir, IN.norm)), 1);
}
else //if(type == MESHDISPLAY_SOLID)
return float4(WireframeColour.xyz, 1);
return float4(WireframeColour.xyz*abs(dot(lightDir, IN.norm)), 1);
}
else //if(type == MESHDISPLAY_SOLID)
return float4(WireframeColour.xyz, 1);
}
wireframeV2F RENDERDOC_WireframeVS(float3 pos : POSITION, uint vid : SV_VertexID)
@@ -120,13 +120,6 @@ wireframeV2F RENDERDOC_WireframeVS(float3 pos : POSITION, uint vid : SV_VertexID
return OUT;
}
#define MESH_OTHER 0 // this covers points and lines, logic is the same
#define MESH_TRIANGLE_LIST 1
#define MESH_TRIANGLE_STRIP 2
#define MESH_TRIANGLE_LIST_ADJ 3
#define MESH_TRIANGLE_STRIP_ADJ 4
Buffer<uint> index : register(t0);
Buffer<float4> vertex : register(t1);
AppendStructuredBuffer<uint4> pickresult : register(u0);
@@ -286,8 +279,9 @@ void defaultPath(uint threadID)
float4 wpos = mul(pos, PickMVP);
wpos.xyz /= wpos.www;
if (PickUnproject == 1)
wpos.xyz /= wpos.www;
wpos.xy *= float2(1.0f, -1.0f);
float2 scr = (wpos.xy + 1.0f) * 0.5f * PickViewport;