Skip to content

Commit 95ff03d

Browse files
committed
SpotLightShadow: Introduce aspect
1 parent fcd5629 commit 95ff03d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/lights/SpotLightShadow.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,22 @@ class SpotLightShadow extends LightShadow {
3434
*/
3535
this.focus = 1;
3636

37+
/**
38+
* Texture aspect ratio.
39+
*
40+
* @type {number}
41+
* @default 1
42+
*/
43+
this.aspect = 1;
44+
3745
}
3846

3947
updateMatrices( light ) {
4048

4149
const camera = this.camera;
4250

4351
const fov = RAD2DEG * 2 * light.angle * this.focus;
44-
const aspect = this.mapSize.width / this.mapSize.height;
52+
const aspect = ( this.mapSize.width / this.mapSize.height ) * this.aspect;
4553
const far = light.distance || camera.far;
4654

4755
if ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) {

0 commit comments

Comments
 (0)