Skip to content

Commit 937d157

Browse files
authored
LightProbeGenerator: Support FloatType in fromCubeRenderTarget(). (#31349)
* LightProbeGenerator: Support `FloatType` in `fromCubeRenderTarget()`. * E2E: Move unstable example to exception list.
1 parent 6b2f433 commit 937d157

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

examples/jsm/lights/LightProbeGenerator.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
NoColorSpace,
99
HalfFloatType,
1010
DataUtils,
11-
WebGLCoordinateSystem
11+
WebGLCoordinateSystem,
12+
FloatType
1213
} from 'three';
1314

1415
/**
@@ -178,7 +179,11 @@ class LightProbeGenerator {
178179

179180
if ( renderer.isWebGLRenderer ) {
180181

181-
if ( dataType === HalfFloatType ) {
182+
if ( dataType === FloatType ) {
183+
184+
data = new Float32Array( imageWidth * imageWidth * 4 );
185+
186+
} else if ( dataType === HalfFloatType ) {
182187

183188
data = new Uint16Array( imageWidth * imageWidth * 4 );
184189

@@ -210,7 +215,13 @@ class LightProbeGenerator {
210215

211216
let r, g, b;
212217

213-
if ( dataType === HalfFloatType ) {
218+
if ( dataType === FloatType ) {
219+
220+
r = data[ i ];
221+
g = data[ i + 1 ];
222+
b = data[ i + 2 ];
223+
224+
} else if ( dataType === HalfFloatType ) {
214225

215226
r = DataUtils.fromHalfFloat( data[ i ] );
216227
g = DataUtils.fromHalfFloat( data[ i + 1 ] );

test/e2e/puppeteer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ const exceptionList = [
113113
'webgl_volume_instancing',
114114
'webgl_buffergeometry',
115115
'webgl_buffergeometry_attributes_integer',
116+
'webgl_buffergeometry_attributes_none',
117+
'webgl_buffergeometry_custom_attributes_particles',
116118
'webgl_batch_lod_bvh',
117119

118120
// Intentional z-fighting in this demo makes it non-deterministic

0 commit comments

Comments
 (0)