@@ -162,7 +162,8 @@ export class MirrorTexture extends RenderTargetTexture {
this._mirrorMatrix.multiplyToRef(this._savedViewMatrix, this._transformMatrix);
- scene.setTransformMatrix(this._transformMatrix, scene.getProjectionMatrix());
+ // Clone to not mark matrices as updated
+ scene.setTransformMatrix(this._transformMatrix.clone(), scene.getProjectionMatrix().clone());
scene.clipPlane = this.mirrorPlane;
@@ -494,7 +494,7 @@ export class PostProcess {
if (this._textureCache[i].width === textureSize.width &&
this._textureCache[i].height === textureSize.height &&
this._textureCache[i]._postProcessChannel === channel) {
- // return this._textureCache[i];
+ return this._textureCache[i];
}
@@ -136,8 +136,8 @@ export class ScreenSpaceReflectionPostProcess extends PostProcess {
return;
- const viewMatrix = camera.getViewMatrix();
- const projectionMatrix = camera.getProjectionMatrix();
+ const viewMatrix = camera.getViewMatrix(true);
+ const projectionMatrix = camera.getProjectionMatrix(true);
effect.setMatrix("projection", projectionMatrix);
effect.setMatrix("view", viewMatrix);
@@ -512,7 +512,7 @@ color.rgb = max(color.rgb, 0.);
#endif
#ifdef PREPASS_REFLECTIVITY
#if defined(SPECULAR)
- gl_FragData[PREPASS_REFLECTIVITY_INDEX] = vec3(specularMapColor.rgb, writeGeometryInfo);
+ gl_FragData[PREPASS_REFLECTIVITY_INDEX] = vec4(specularMapColor.rgb, writeGeometryInfo);
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX] = vec4(0.0, 0.0, 0.0, writeGeometryInfo);