-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Description
Description
I am using the Reflector to render the reflection on a mesh. When the camera isn't set with the view offset, everything's ok. But when the camera is set with a quite large view offset, as the object being reflected is on the edge of the view, the reflection is stretched.
Reproduction steps
- setup a scene with a perspective camera
- set the view offset of the perspective camera with
camera.setViewOffset(
window.innerWidth,
window.innerHeight,
offset.x,
offset.y,
window.innerWidth,
window.innerHeight
);
- when the offset.x is quite large, the object being reflected is on the edge of the view, the reflection is stretched
Code
please see the codes in the live example
Live example
the following example uses the original reflector, you can see the strech when the offset x is set around 500
I think the problem is related to the view offset of the reflector camera. I comment the
virtualCamera.projectionMatrix.copy( camera.projectionMatrix );
in the source code of Reflector.js. Then the stretch is disappeared in some cases. When the camera is dollyed in , it appeared again. I don't know if this is helpful.
Screenshots
the original reflector

my reflector, solves the stretch only in some certain cases, as below

when the camera is dollyed in , it appeared again, even without the view offset.

Version
r172
Device
No response
Browser
No response
OS
No response
another guy also notices the same problem, link is here: Using Camera.setViewOffset with Reflector stretches the reflected texture in three.js