Skip to content

Commit

Permalink
Merge pull request #1462 from actnwit/fix/webvr-multiview
Browse files Browse the repository at this point in the history
fix: iblDefinition.glsl for WEBGL2_MULTI_VIEW
  • Loading branch information
emadurandal authored Jul 27, 2024
2 parents ff4dc94 + 147cfe3 commit 80cd837
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/webgl/shaderity_shaders/common/iblDefinition.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ vec3 get_sample_from_backbuffer(float materialSID, vec2 sampleCoord, float perce
float backBufferTextureLength = max(backBufferTextureSize.x, backBufferTextureSize.y);

#ifdef WEBGL2_MULTI_VIEW
if (vrState.x == 1) { // For VR
backBufferTextureLength = max(backBufferTextureSize.x / 2.0, backBufferTextureSize.y);
sampleCoord.x = sampleCoord.x * 0.5;
if (v_displayIdx == 1.0) { // For right eye
sampleCoord.x += 0.5;
}
// For VR
backBufferTextureLength = max(backBufferTextureSize.x / 2.0, backBufferTextureSize.y);
sampleCoord.x = sampleCoord.x * 0.5;
if (v_displayIdx == 1.0) { // For right eye
sampleCoord.x += 0.5;
}
#else
if (vrState.x == 1) { // For VR
Expand Down

0 comments on commit 80cd837

Please sign in to comment.