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

WebGPURenderer: Backdrop Node - Part 2/3 #26196

Merged
merged 12 commits into from
Jun 7, 2023
Merged

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Jun 5, 2023

Related issue: #25903

Deph Node

Anyone who has ever created a scene that needed DepthTexture for background elements knows how complex scene management becomes. The Depth Node will help in this project, it is possible to define the distance between objects with a single code line.

// depth - is the current depth
// depthTexture() - is the scene depth

const distance = depthTexture().distance( depth );

Popular effects like the Depth Fade widely used in vegetation, is it possible to do with this API.

Some use cases

image

image

Example

The example is pretty simple, but it has the main features for this use case.
In this example, I show how to create a volume area, which would be very complicated to do without the API.

https://raw.githack.com/mrdoob/three.js/dev/examples/webgpu_backdrop_area.html

image

image

@sunag sunag added this to the r154 milestone Jun 5, 2023
@sunag sunag merged commit df27d3b into mrdoob:dev Jun 7, 2023
@sunag sunag deleted the dev-viewportDepth branch June 7, 2023 16:34
@sunag sunag mentioned this pull request Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant