I was migrating my ReflectionManager code and wanted to generate environment map from the centre of the room.
There are so many different references which do not work can anyone point me in the right direction
this was my constructor, getenvmap and render functions,
constructor() {
this.reflectionCount = 0;
this.maxReflectionCount = 5;
this.enable = true;
this.cubeCamera = new THREE.CubeCamera( 1, 100000, 256 );
this.cubeCamera.renderTarget.encoding = THREE.LinearEncoding;
this.cubeCamera.renderTarget.texture.format = THREE.RGBAFormat;
this.pmremGenerator = new PMREMGenerator(this.cubeCamera.renderTarget.texture);
}
getEnvMap() {
return this.lodExtensionAvailable ? this.pmremGenerator.cubeTextureLod : this.pmremCubeUVPacker.CubeUVRenderTarget.texture;
}
render(renderer, scene) {
if( this.lodExtensionAvailable === undefined) {
this.lodExtensionAvailable = this.isLODAvailable(renderer);
}
if(this.pmremCubeUVPacker === undefined && !this.lodExtensionAvailable) {
this.pmremCubeUVPacker = new PMREMCubeUVPacker(this.pmremGenerator.cubeLods);
}
if( this.enable && !this.hasCompleted()) {
this.cubeCamera.updateCubeMap( renderer, scene );
this.pmremGenerator.update( renderer );
if(this.lodExtensionAvailable) {
if( this.reflectionCount === this.maxReflectionCount - 1) {
this.pmremGenerator.readCubeTextureWithLOD(renderer);
}
} else {
this.pmremCubeUVPacker.update( renderer );
}
this.reflectionCount++;
}
}