-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGPURenderer: Support for multiple render targets #26409
Conversation
Very good, I just think that we can use const material = new NodeMaterial();
material.outputNode = outputStruct( [ diffuseNode, normalNode ] ); So users also use GBuffer to create masks for post processing preserving the mainly material, without having to create other render-pass. import { materialOutput } = 'three/nodes'
const standardMaterial = new MeshStandardNodeMaterial();
standardMaterial.outputNode = outputStruct( [ materialOutput, maskNode ] ); And for Deferred Shading internally approach as: material.outputNode = outputStruct( [ materialPosition, materialDiffuse, materialNormal, ... ] ); -- I will create |
Using material.outputNode to avoid hacking nodeMaterial internals, ( that was only intended as a workaround). |
8e9a104
to
53b660d
Compare
add support for webglmultiplerendertargets wip
Sounds good for me 👍 |
@aardgoose What would be missing here? It would be very good if we could merge this PR in this |
The only thing I see as significant are the changes required if #26427. was accepted. Otherwise it should be fine. |
Thank you, I thought it was a great job, about the changes required in the #26427 I think we can wait, it will be backwards compatible, and we will need to rename |
First attempt at getting multiple render targets working in WebGPU/Nodes using WebGLMultipleRenderTargets, lots of cleanup work required if this looks like the right direction. Probably cleaner to use renderTargets.textures[] though, rather than special cases for multiple targets.
In the nodes material the returned
outputStruct( outputColor1, outputColor2....)
writes to the attached textures.Example from webgl2 ported and working (you need to move the mouse around to get the first render. related to another async problem I have a patch for).