From f1d7421698d415a4ca5748f0305bdf9236e613da Mon Sep 17 00:00:00 2001 From: ksuprynowicz Date: Tue, 20 Dec 2022 23:31:11 +0100 Subject: [PATCH] Workaround for Nvidia driver bug --- .gitignore | 1 + libraries/entities-renderer/src/paintStroke.slv | 5 ++++- libraries/render-utils/src/drawWorkloadProxy.slv | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b5776d66ee..b5a419f9ae 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ CMakeFiles/ CMakeScripts/ cmake_install.cmake build*/ +cmake-build-relwithdebinfo-visual-studio/ release*/ debug*/ gprof*/ diff --git a/libraries/entities-renderer/src/paintStroke.slv b/libraries/entities-renderer/src/paintStroke.slv index 9a44223dd4..cf91438746 100644 --- a/libraries/entities-renderer/src/paintStroke.slv +++ b/libraries/entities-renderer/src/paintStroke.slv @@ -48,7 +48,10 @@ void main(void) { vec3 normalEye = normalize(posEye.xyz); vec3 binormalEye = normalize(cross(normalEye, tangentEye)); - posEye.xyz += _distanceFromCenter * vertex.binormalAndHalfWidth.w * binormalEye; + // Workaround for Nvidia driver bug + posEye.x += _distanceFromCenter * vertex.binormalAndHalfWidth.w * binormalEye.x; + posEye.y += _distanceFromCenter * vertex.binormalAndHalfWidth.w * binormalEye.y; + posEye.z += _distanceFromCenter * vertex.binormalAndHalfWidth.w * binormalEye.z; <$transformEyeToClipPos(cam, posEye, gl_Position)$> <@if not HIFI_USE_FORWARD@> <$transformEyeToWorldDir(cam, normalEye, _normalWS)$> diff --git a/libraries/render-utils/src/drawWorkloadProxy.slv b/libraries/render-utils/src/drawWorkloadProxy.slv index 9dfcf8415c..e485f14a93 100644 --- a/libraries/render-utils/src/drawWorkloadProxy.slv +++ b/libraries/render-utils/src/drawWorkloadProxy.slv @@ -51,7 +51,12 @@ void main(void) { vec3 dirX = normalize(cross(vec3(0.0, 1.0, 0.0), dirZ)); vec3 dirY = vec3(0.0, 1.0, 0.0); - vec4 pos = vec4(proxyPosEye.xyz + proxy.sphere.w * ( dirX * spriteVert.x + dirY * spriteVert.y /* + dirZ * spriteVert.z*/), 1.0); + //vec4 pos = vec4(proxyPosEye.xyz + proxy.sphere.w * ( dirX * spriteVert.x + dirY * spriteVert.y + dirZ * spriteVert.z), 1.0); + //Nvidia driver workaround + vec4 pos = vec4(1.0, 1.0, 1.0, 1.0); + pos.x = proxyPosEye.x + proxy.sphere.w * ( dirX.x * spriteVert.x + dirY.x * spriteVert.y + dirZ.x * spriteVert.z); + pos.y = proxyPosEye.y + proxy.sphere.w * ( dirX.y * spriteVert.x + dirY.y * spriteVert.y + dirZ.y * spriteVert.z); + pos.z = proxyPosEye.z + proxy.sphere.w * ( dirX.z * spriteVert.x + dirY.z * spriteVert.y + dirZ.z * spriteVert.z); varEyePos = pos.xyz; varTexcoord = spriteVert.xyz; <$transformEyeToClipPos(cam, pos, gl_Position)$>