-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Examples: Visualize normal as color in inspector webgpu_postprocessing_ao
#32141
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
Conversation
webgpu_postprocessing_ao
|
Good |
| const scenePassNormal = scenePass.getTextureNode( 'normal' ).toInspector( 'Normal' ); | ||
| const scenePassNormal = scenePass.getTextureNode( 'normal' ).toInspector( 'Normal', () => { | ||
|
|
||
| return directionToColor( scenePassNormal.sample() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that .sample() doesn't take a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, but it should be designed to work like TSL.texture(t, /* optional uv */)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
If |
I don’t have a clear answer right now, it may help to check how the inspector handles rendering, which I’m not very familiar with. I could only test this by trying to neutralize the conversion; for example, by manually applying pow(2.2) to the raw data,
|


Related: -
Description
It's more intuitive if inspector::viewer is visualized normal attachment(currently storing direction) as color
L: Dev branch https://raw.githack.com/mrdoob/three.js/dev/examples/webgpu_postprocessing_ao.html
R: This PR https://raw.githack.com/ycw/three.js/d/examples/webgpu_postprocessing_ao.html