Skip to content
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

DepthNode no longer works in conjunction with the OutputNode in r173. The cause are OutputNode changes in #30394 #30476

Open
Spiri0 opened this issue Feb 7, 2025 · 3 comments
Assignees
Labels

Comments

@Spiri0
Copy link
Contributor

Spiri0 commented Feb 7, 2025

Description

I have a codePen in which I use logarithmicDepth. This worked so far without any problems with the outputStruct node. Since r173 I have been getting the following error message in connection with the depthNode

index.html:1 Error while parsing WGSL: :56:2 error: struct member depth not found
  output.depth = ( log2( ( ( - ( - vDepth ) ) / nodeVar0 ) ) / log2( ( render.cameraFar / nodeVar0 ) ) );

I have installed a switch in the codePen example with which you can switch between the colorNode and the outputNode:
In line 106:

const testSwitch = 0;

I'm currently trying to understand what has changed in r173 so that the outputNode no longer works with the depthNode, but maybe the one who made the changes knows immediately what's going on.

Reproduction steps

Simply set the testSwitch from 0 to 1 in the codePen so that the outputNode is used.

Code

see in live example link

Live example

https://codepen.io/Spiri0/pen/vYqpRga?editors=1010

Screenshots

No response

Version

173

Device

No response

Browser

No response

OS

No response

@Mugen87 Mugen87 added the TSL Three.js Shading Language label Feb 8, 2025
@Spiri0
Copy link
Contributor Author

Spiri0 commented Feb 9, 2025

@sunag You made extensive changes to the outputNode in the struct extension #30394
I haven't found any other PR in r173 that has made changes to the outputNode.
I suspect that this could be the reason why the depthNode is no longer connected to the outputNode.
I'm trying to reconstruct the cause of the error step by step, but maybe you'll immediately think of what it could be

P.S. I have now only adopted the struct extension in r172 and was able to reproduce exactly the error message

127.0.0.1/:1 Error while parsing WGSL: :228:2 error: struct member depth not found
  output.depth = ( log2( ( ( - ( - vDepth ) ) / nodeVar0 ) ) / log2( ( render.cameraFar / nodeVar0 ) ) );
  ^^^^^^^^^^^^

I have no idea jet which part of the extension is the reason, but at least I could narrowed down the cause to the struct extension. By the way, I think it's really great. It is once again a great hub in threejs around WebGPU

@Spiri0 Spiri0 changed the title There is maybe an issue with outputStruct since r173 DepthNode no longer works in conjunction with the OutputNode in r173. The cause are OutputNode changes in #30394 Feb 9, 2025
@spreadpando
Copy link

spreadpando commented Feb 11, 2025

I've just run into this as well using logarithmicDepthBuffer in the WebGPURenderer upgrading from 172 => 173.

It seems to only occur when using MRT in my tests. If we apply a LogarithmicDepthBuffer to the selective bloom example /examples/webgpu_postprocessing_bloom_selective.html, we see the same error you have shared. When we add it to the normal bloom postprocessing example we don't have any issues.

I see your example is not explicitly using MRT @Spiri0 so I'm not sure where this issue lies since the selective bloom example does not use the depthNode at all and we can reproduce the exact same error there.

@Spiri0
Copy link
Contributor Author

Spiri0 commented Feb 11, 2025

@spreadpando The MRT uses the outputNode just like I do. I haven't had a chance to take a closer look at it yet because of my work on my current project. I should probably take some time to investigate it. Maybe I can narrow down the cause even further around the outputNode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants