Skip to content

Commit

Permalink
Merge pull request #291 from overte-org/fix/nvidia-driver
Browse files Browse the repository at this point in the history
Quick workaround for Nvidia driver bug
  • Loading branch information
ksuprynowicz authored Dec 24, 2022
2 parents 67a33a1 + f1d7421 commit 95ed201
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CMakeFiles/
CMakeScripts/
cmake_install.cmake
build*/
cmake-build-relwithdebinfo-visual-studio/
release*/
debug*/
gprof*/
Expand Down
5 changes: 4 additions & 1 deletion libraries/entities-renderer/src/paintStroke.slv
Original file line number Diff line number Diff line change
Expand Up @@ -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)$>
Expand Down
7 changes: 6 additions & 1 deletion libraries/render-utils/src/drawWorkloadProxy.slv
Original file line number Diff line number Diff line change
Expand Up @@ -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)$>
Expand Down

0 comments on commit 95ed201

Please sign in to comment.