From 2bfd6a5c387737003e56f4562cf5affd2143a7ed Mon Sep 17 00:00:00 2001 From: Donovan Hutchence Date: Wed, 28 Aug 2024 11:35:48 +0100 Subject: [PATCH] fix --- src/scene/graphics/reproject-texture.js | 7 ------- .../chunks/common/frag/reproject.js | 20 +++++-------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/scene/graphics/reproject-texture.js b/src/scene/graphics/reproject-texture.js index 03e8842a72d..2dfe7a64e67 100644 --- a/src/scene/graphics/reproject-texture.js +++ b/src/scene/graphics/reproject-texture.js @@ -499,16 +499,10 @@ function reprojectTexture(source, target, options = {}) { const params = [ 0, - specularPower, source.fixCubemapSeams ? 1.0 / source.width : 0.0, // source seam scale target.fixCubemapSeams ? 1.0 / target.width : 0.0 // target seam scale ]; - const params2 = [ - target.width * target.height * (target.cubemap ? 6 : 1), - source.width * source.height * (source.cubemap ? 6 : 1) - ]; - if (prefilterSamples) { // set or generate the pre-calculated samples data const sourceTotalPixels = source.width * source.height * (source.cubemap ? 6 : 1); @@ -530,7 +524,6 @@ function reprojectTexture(source, target, options = {}) { }); params[0] = f; constantParams.setValue(params); - constantParams2.setValue(params2); drawQuadWithShader(device, renderTarget, shader, options?.rect); diff --git a/src/scene/shader-lib/chunks/common/frag/reproject.js b/src/scene/shader-lib/chunks/common/frag/reproject.js index a0963738cbe..5b2517e5615 100644 --- a/src/scene/shader-lib/chunks/common/frag/reproject.js +++ b/src/scene/shader-lib/chunks/common/frag/reproject.js @@ -31,23 +31,13 @@ varying vec2 vUv0; // params: // x - target cubemap face 0..6 -// y - specular power (when prefiltering) -// z - source cubemap seam scale (0 to disable) -// w - target cubemap size for seam calc (0 to disable) -uniform vec4 params; - -// params2: -// x - target image total pixels -// y - source cubemap size -uniform vec2 params2; +// y - source cubemap seam scale (0 to disable) +// z - target cubemap size for seam calc (0 to disable) +uniform vec3 params; float targetFace() { return params.x; } -float specularPower() { return params.y; } -float sourceCubeSeamScale() { return params.z; } -float targetCubeSeamScale() { return params.w; } - -float targetTotalPixels() { return params2.x; } -float sourceTotalPixels() { return params2.y; } +float sourceCubeSeamScale() { return params.y; } +float targetCubeSeamScale() { return params.z; } float PI = 3.141592653589793;