diff --git a/renderdoc/data/glsl/mesh.comp b/renderdoc/data/glsl/mesh.comp index f9e743239..4713cecd3 100644 --- a/renderdoc/data/glsl/mesh.comp +++ b/renderdoc/data/glsl/mesh.comp @@ -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); diff --git a/renderdoc/data/hlsl/mesh.hlsl b/renderdoc/data/hlsl/mesh.hlsl index 930f08b41..ecc6ce682 100644 --- a/renderdoc/data/hlsl/mesh.hlsl +++ b/renderdoc/data/hlsl/mesh.hlsl @@ -86,20 +86,20 @@ void RENDERDOC_MeshGS(triangle wireframeV2F input[3], inout TriangleStream index : register(t0); Buffer vertex : register(t1); AppendStructuredBuffer 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;