-
Notifications
You must be signed in to change notification settings - Fork 76
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
Depth testing support #13
Conversation
stencil_back: wgpu::StencilStateFaceDescriptor::IGNORE, | ||
stencil_read_mask: 0, | ||
stencil_write_mask: 0, | ||
}) |
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.
Should we allow this level of configuration or could we simply ask for the format
and hardcode this internally?
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 actually like taking the entire DepthStencilStateDescriptor
, because I'm actually using a difference comparison function. I can imagine that users might want to change other aspects of the depth stencil state as well.
stencil_store_op: wgpu::StoreOp::Store, | ||
clear_depth: -1.0, | ||
clear_stencil: 0, | ||
}, |
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.
Same question here. Could we simply ask for a TextureView
(i.e. the depth_view
) here?
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.
For me, I would also find it useful to pass in the whole RenderPassDepthStencilAttachmentDescriptor
. In my case, I'm using a different value for clear_depth
.
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.
This is awesome, thanks! I checked that the new example does the expected thing on my machine.
stencil_back: wgpu::StencilStateFaceDescriptor::IGNORE, | ||
stencil_read_mask: 0, | ||
stencil_write_mask: 0, | ||
}) |
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 actually like taking the entire DepthStencilStateDescriptor
, because I'm actually using a difference comparison function. I can imagine that users might want to change other aspects of the depth stencil state as well.
stencil_store_op: wgpu::StoreOp::Store, | ||
clear_depth: -1.0, | ||
clear_stencil: 0, | ||
}, |
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.
For me, I would also find it useful to pass in the whole RenderPassDepthStencilAttachmentDescriptor
. In my case, I'm using a different value for clear_depth
.
I was able to successfully use this in my own project 👍 |
Glad to know! I will keep the API as it is then! We may be able to improve it in the future once/if we see a pattern. |
38cf8d6
to
0eda122
Compare
Another note on customizing my own rendering, in case it's helpful: I needed to change the "load op" values from |
Fixes #11.