Closed gkjohnson closed 3 months ago
Looks like bounces are set to a lower value? Or color space?
Before
After
The darkening is due to the "filterGlossyFactor" - should look into in a future PR.
cc @donmccurdy - this PR adds a more simple way to access and render a path traced scene that mirrors the WebGLRenderer API design in some ways. I think this is something you'd wanted previously? Here's what it looks like to path trace a scene now:
const scene = new Scene();
// initialize scene ...
const texture = new GradientEquirectTexture();
texture.bottomColor.set( 0xffffff );
texture.bottomColor.set( 0x666666 );
texture.update();
scene.environment = texture;
scene.background = texture;
const renderer = new WebGLPathTracer();
document.body.appendChild( renderer.domElement );
renderer.toneMapping = ACESFilmicToneMapping;
renderer.tiles.set( 3 );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.updateScene( camera, scene );
animate();
function animate() {
// if the camera position changes call "ptRenderer.reset()"
requestAnimationFrame( animate );
// update the camera and render one sample
camera.updateMatrixWorld();
// rasterizes the main scene if there are not enough path traced
// samples and renders the path traced scene tiles on top.
renderer.renderSample();
}
There are some settings to disable rendering to canvas so you can just work with the Path Traced render target, as well. Let me know what you think.
Related to #498
Next PRs