Skip to content

Commit f972670

Browse files
ChauChau
Chau
authored and
Chau
committed
fix(soba/materials): granularity with blur signals
1 parent 5d89ae1 commit f972670

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

libs/soba/materials/src/lib/mesh-reflector-material.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ export class NgtsMeshReflectorMaterial {
115115
return Array.isArray(blur) ? blur : [blur, blur];
116116
});
117117
private hasBlur = computed(() => this.normalizedBlur()[0] + this.normalizedBlur()[1] > 0);
118+
private blurX = computed(() => this.normalizedBlur()[0]);
119+
private blurY = computed(() => this.normalizedBlur()[1]);
118120

119121
private reflectorPlane = new THREE.Plane();
120122
private normal = new THREE.Vector3();
@@ -145,9 +147,10 @@ export class NgtsMeshReflectorMaterial {
145147
distortionMap,
146148
mixContrast,
147149
},
148-
blur,
149150
hasBlur,
150-
] = [this.store.gl(), this.reflectOptions(), this.normalizedBlur(), this.hasBlur()];
151+
blurX,
152+
blurY,
153+
] = [this.store.gl(), this.reflectOptions(), this.hasBlur(), this.blurX(), this.blurY()];
151154

152155
const renderTargetParameters = {
153156
minFilter: THREE.LinearFilter,
@@ -165,8 +168,8 @@ export class NgtsMeshReflectorMaterial {
165168
const blurPass = new BlurPass({
166169
gl,
167170
resolution,
168-
width: blur[0],
169-
height: blur[1],
171+
width: blurX,
172+
height: blurY,
170173
minDepthThreshold,
171174
maxDepthThreshold,
172175
depthScale,

0 commit comments

Comments
 (0)