Drawing a texture during post processing #11055
-
TL;DR I want to draw crosshairs in the middle of the screen starting from the post_processing example but, I can't figure out to get my image into the BindGroupLayout I've been trying to draw an image of crosshairs in the middle of the screen on top of my 3d scene, but this has turned out to be really difficult. I initially wanted to use a sprite component, but there were issues with it being drawn behind the 3d scene and also rotating along with the player, so I decided to try a making it shader instead (I eventually want to change the color of the crosshairs to make it visible on different color backgrounds, so I would probably make it a shader eventually anyway). Because I want to sample the screen texture I believe I need to follow the post_processing example and I have been able to integrate that into my game with the chromatic aberration shader, but I can't figure out how to add my texture to the bind group! I've found the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Beta Was this translation helpful? Give feedback.
You'll want to use Res<RenderAssets> from the render world in order to pull out a GpuImage, which has a texture view you can add to your bind group.
Don't have time to explain in further detail, but hopefully that puts you on the right track.