Skip to main content
20 events
when toggle format what by license comment
Mar 11, 2021 at 1:47 vote accept Veler
Mar 11, 2021 at 1:47 answer added Veler timeline score: 0
Mar 10, 2021 at 7:04 comment added Veler I think I fixed a part of my issue. I updated my BlendState and now the output texture (after applying the first shader) is "good". It's not completely transparent anymore. Now I'm sending this "good" output texture to the next shader effect.... but it's still not applied. The output texture didn't change. I don't why yet.
Mar 10, 2021 at 6:27 history edited Veler CC BY-SA 4.0
added 46 characters in body
Mar 10, 2021 at 5:47 comment added Veler Alright I may have figured out WHY it happens. It appears that my output texture is 100% transparent. I was not realizing it because my program send that output texture to a video encoder, which probably doesn't care about transparency (that's what I would assume, but I'd need to verify). So because my output texture is transparent, that would explain why the second effect doesn't render => I give the second shader effect a completely transparent image.
Mar 10, 2021 at 1:56 history edited Veler CC BY-SA 4.0
added 2167 characters in body
Mar 10, 2021 at 1:47 comment added Veler Hi all, I unfortunately still don't succeed to make it work. I tried many things to get the output texture from the first shader to be used as input by the second shader, but I keep seeing the first shader being applied and not the second. As part of all the things I tried, the most relevant is probably create a ShaderResourceView from the OutputTexture from the RenderTargetView when I apply the second effect. While it's probably not optimal, I'd like at least to make it work once before going into optimization. Any suggestion, please?
Mar 9, 2021 at 2:22 comment added Veler Sounds good, thank you. I'll keep digging it while this time and update if I find anything.
Mar 9, 2021 at 2:18 comment added DMGregory No, I cannot. But other users can. Your question already asks for help from everyone on the site, so you never need to repeat your question in a comment directed at one user in particular.
Mar 9, 2021 at 2:15 comment added Veler Can you please provide a bit more clarity at the steps I should do to reach that goal?
Mar 9, 2021 at 2:14 comment added Veler @DMGregory, thanks again for your suggestion. I tried several things: copying the _depthStencilTexture into a new texture and create a new ShadeResourceView with it to pass it to the next Shader effect I'd use, but that doesn't work. Interestingly, using a copy of the output texture I bind to the RenderTargetView doesn't work either. I also looked at the following post that seem to tries to do the same thing than you suggested by it hasn't been helpful either. gamedev.stackexchange.com/questions/65850/…
Mar 8, 2021 at 17:07 comment added Veler Ah yes! That makes absolutely sense then! Thank you very much! Can you please give me some hints at how to do that? Right now I'm passing my ShaderResourceView as a parameter to each shader. But that's the original texture (I think?). Should I create a new ShaderResourceView with the depthStencil texture?
Mar 8, 2021 at 17:03 comment added DMGregory Your shaders can only act on what they're given as input. If you want the second pass to modify the output of the first pass, it needs to receive the first pass's output as input. If the input you give it is the original texture, the output you'll get is the result of applying only that one effect to the original texture.
Mar 8, 2021 at 17:01 comment added Veler I don't think I explicitly pass the texture again. I'm very beginner at it so it's very possible I'm missing a concept here. I update my original post with some code.
Mar 8, 2021 at 17:00 history edited Veler CC BY-SA 4.0
added 5570 characters in body
Mar 8, 2021 at 16:47 comment added DMGregory Are you taking the output colour buffer from your first pass and providing it as the input texture for your second pass, rendering to a fresh output colour buffer? If not, can you explain in more detail how you're passing information between these stages?
Mar 8, 2021 at 16:44 comment added Veler Thanks for your reply. No I didn't clear the depth buffer between passes. I just gave it a try by doing deviceContext.ClearDepthStencilView(_depthStencilView, DepthStencilClearFlags.Depth, 1f, 0);. I placed this list the deviceContext.Draw(verticeCount, 0). Now I'm seeing the opposite issue. The second effect is applied to the output texture but not the first one. I'd assume the first one got overwrote by the second one. I'm not sure to understand why.
Mar 8, 2021 at 16:10 comment added DMGregory Did you clear your depth buffer between passes, so the depth information from the previous pass doesn't prevent future pixels from drawing there?
Mar 8, 2021 at 5:43 review First posts
Mar 16, 2021 at 18:15
Mar 8, 2021 at 5:39 history asked Veler CC BY-SA 4.0