sunag
sunag
About `WebGPURenderer`, I'm thinking in work on an update for the new architecture to support these implementations in Nodes without having to change `NodeMaterial` codes, I think updates like this...
https://github.com/mrdoob/three.js/blob/517ce63ecc63e675643af6f7c16e4c94092b3e7f/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js#L20-L26 This code snippet is currently deprecated, I think it would be nice to update the code, important updates have been made.
> Do we still need this? Hmm... maybe not. I would just leave it until I make a GPU layout generation system, auto layout is limiting shadow integration.
> @sunag how do you think this could be done with NodeMaterial? Yes. This already is possible in the new `NodeMaterial` system. https://github.com/mrdoob/three.js/blob/ea11ddad1e92e2cfdb1b6a03ba30225fe6fdef2a/examples/jsm/renderers/nodes/accessors/ModelNode.js#L17 You can update a `shared uniform` for...
I can implement a solution for `WebGL` too after this PR ( https://github.com/mrdoob/three.js/pull/21117 )... I am currently implementing a `light system` for selective lights or global using `NodeMaterial`.
https://raw.githack.com/sunag/three.js/nodematerial-shared-uniforms/examples/webgpu_instance_uniform.html Source: https://github.com/sunag/three.js/blob/8f9cbfa9c15d45a5ce8d3edba8cebc246c039592/examples/webgpu_instance_uniform.html I made a example, the color is updated per `mesh.color` in render object moment. But it seems there is a problem... `WebGPURenderer` still does not support material...
> What do you mean with "material instance"? A single material for multiples meshes.
If replace `materialTemp` to `material` in `addMesh()` only a mesh is rendered on screen at a time. https://github.com/sunag/three.js/blob/8f9cbfa9c15d45a5ce8d3edba8cebc246c039592/examples/webgpu_instance_uniform.html#L104-L109
@Mugen87 I found the problem, is related with the implementation of `NodeMaterial`... I will create um PR to fix this.
> They have to be managed per 3D object and the UBO needs to be updated per object with the correct data. I mean in case of just update the...