2
0
Эх сурвалжийг харах

WebGPURenderer: Add more comments.

Mugen87 4 жил өмнө
parent
commit
5d8221ff62

+ 14 - 0
examples/jsm/renderers/webgpu/WebGPURenderPipelines.js

@@ -30,6 +30,20 @@ class WebGPURenderPipelines {
 
 	get( object ) {
 
+		// @TODO: Avoid a 1:1 relationship between pipelines and objects. It's necessary
+		// to check various conditions in order to request an appropriate pipeline.
+		//
+		// - material's version and node configuration
+		// - environment map (material)
+		// - fog and environment (scene)
+		// - output encoding (renderer)
+		// - light state
+		// - clipping planes
+		//
+		// The renderer needs to manage multiple pipelines per object so
+		// GPUDevice.createRenderPipeline() is only called no pipeline exists for the
+		// given configuration.
+
 		let pipeline = this.pipelines.get( object );
 
 		if ( pipeline === undefined ) {

+ 3 - 0
examples/jsm/renderers/webgpu/WebGPURenderer.js

@@ -694,6 +694,9 @@ class WebGPURenderer {
 
 			const renderItem = renderList[ i ];
 
+			// @TODO: Add support for multiple materials per object. This will require to extract
+			// the material from the renderItem object and pass it with its group data to _renderObject().
+
 			const object = renderItem.object;
 
 			object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );