You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
<R3F>: light the scene from PMREMGenerator.fromScene(new RoomEnvironment()), as three does (follow-up to #131) #165
Follow-up to #131. Since 0.1.4, PMREMGenerator.fromScene(new RoomEnvironment()) no longer breaks the scene: raea draws it without the environment and warns. Thanks for that. This asks for the environment itself.
What happens (0.1.5)
WARN [js] raea/r3f: scene.environment made by three's PMREMGenerator.fromScene, which renders on the GPU and raea doesn't make yet: the scene is drawn without it (use a panorama: <Environment preset> or PMREMGenerator.fromEquirectangular of an .hdr)
Our 3D character uses it, the same as #131's repro. Without the environment the character draws much darker than in a browser: its front face is rgb(106, 56, 41) in raea against rgb(247, 141, 109) in Chrome, with the same lights and camera. Position and size now match the browser to within ~3 px, so the light is the only difference left.
Asking for
scene.environment = pmrem.fromScene(new RoomEnvironment(), sigma).texture lights the scene in raea as it does in three: raea builds the room scene and makes its environment map itself, as it already does for a panorama.
Why it matters
RoomEnvironment + PMREMGenerator.fromScene is three's own recipe for soft studio light with no HDR file. It's in three's examples and in much of the R3F work people post, so it fits the 0.1.5 goal of drawing what three.js work online is made of. A panorama is a workaround, but it doesn't look the same as the room, and every scene written for the browser would have to be changed.
Repro
#131's repro on 0.1.5: the box draws (good), without the room's light, with the warning above.
Activity
#165: an <R3F> scene lit by PMREMGenerator.fromScene(new RoomEnvironm…
#165: the three direction's table says Environment's room is drawn th…