Skip to content

Scene: Lighting does not work if environment map has dimensions < 64 pixels #27716

@gkjohnson

Description

@gkjohnson

Description

Lighting does not work at all when setting an environment map smaller than 64x64 to Scene.environment. Creating a small map on the fly is useful when generating basic, soft gradient lighting. I suspect this may be related to PMREMGenerator. The texture still works if it's set as a background.

64x64 63x63
image image

Reproduction steps

  1. Create a DataTexture with dimensions of 63x63 with white data
  2. Set mapping to "EquirectangularReflectionMapping"
  3. Lighting does not work

Code

const dim = 64; // NOTE: Lighting does not work if this value is changed to < 64
const tex = new THREE.DataTexture( new Uint8Array( dim * dim * 4 ).fill( 255 ), dim, dim );
tex.mapping = THREE.EquirectangularReflectionMapping;
tex.needsUpdate = true;
scene.environment = tex;

Live example

https://jsfiddle.net/y48Lqt1m/

Screenshots

No response

Version

r161

Device

Desktop

Browser

Chrome

OS

MacOS

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions