gkjohnson / three-gpu-pathtracer

Path tracing renderer and utilities for three.js built on top of three-mesh-bvh.
https://gkjohnson.github.io/three-gpu-pathtracer/example/bundle/index.html
MIT License
1.34k stars 133 forks source link

Simplify examples code #587

Closed gkjohnson closed 5 months ago

gkjohnson commented 6 months ago

Examples

API

gkjohnson commented 6 months ago

Provide consistent / clear way to "reset" scene. When to use "reset"? When to use "updateScene"? How can we update scene most efficiently.

Options

Individual functions

pathTracer.setScene(...);
pathTracer.setSceneAsync( ... );

pathTracer.updateScene();
pathTracer.updateSceneAsync( ... );
pathTracer.updateMaterials();
pathTracer.updateCamera();
pathTracer.updateLights();

Provide options to the update function

pathTracer.updateScene( scene, camera, { updateMaterials, updateCamera, ... } );

Provide a separate function for setting the camera:

pathTracer.updateCamera( camera )
gkjohnson commented 6 months ago