Closed hasenbanck closed 2 weeks ago
Add changes based on your feedback:
Feel free to change stuff you don't like.
Still thinking about the clear value. We could do the following when creating a new render pass for the PickerRenderTarget:
let (clear_high, clear_low) = <(u32, u32)>::from(PickerTarget::Nothing);
let clear_color = wgpu::Color {
r: f64::from(clear_high),
g: f64::from(clear_low),
b: 0.0,
a: 0.0,
};
Edit: Uploaded a version with this idea. The branch currently has no magic constants left and everything is based on the automatic enum values.
Very nice, I really like this :+1:
This removes the implicit reliance of an entity ID to not use the full 32-bit value range. Since we can't assume the actual range that is used inside the 32 bit of an EntityId, we need to properly encode the full 32 bit inside the picker buffer.
For this we use a Rg32Uint texture, to store the picker values. This doubles the picker texture size (4K texture is around 65 MiB). The runtime of the shader is still very low and insignificant compared to other render passes.
This also allows us to encode much more data into the picker value later, if we need to do so.