How to Upload alpha texture to compute shader Hello! What am I trying to do is blur mask. Say I would like to have everything blurred EXCEPT circle in the middle(you can observe such in shooter games, while aiming). In my vision, to support masked blurring, I have to have such mask as a 2d texture with alpha channel values indicating whether we blur pixel or not. The problem here, I can't upload alpha texture(only alpha channel exists(DXGI_FORMAT_A8_UNORM)) to shader. For every pixel I checked alpha in shader, I got 0. I attached code of creation and using shader resource. Here is how I use this texture in shader: Code where I create descriptors: Root Signature: And lastly part of code in Render() method related to Blur: I assume I failed somewhere in code of creation\uploading texture. That code I took partially from here - http://bit.ly/2E12rgD I can't sleep and hardly eat, because of this issue, will appreciate any help. Thanks BlurFilter.h BlurFilter.cpp https://ift.tt/eA8V8J
Hello! What am I trying to do is blur mask. Say I would like to have everything blurred EXCEPT circle in the middle(you can observe such in shooter games, while aiming). In my vision, to support masked blurring, I have to have such mask as a 2d texture with alpha channel values indicating whether we blur pixel or not. The problem here, I can't upload alpha texture(only alpha channel exists(DXGI_FORMAT_A8_UNORM)) to shader. For every pixel I checked alpha in shader, I got 0. I attached code of creation and using shader resource. Here is how I use this texture in shader: Code where I create descriptors: Root Signature: And lastly part of code in Render() method related to Blur: I assume I failed somewhere in code of creation\uploading texture. That code I took partially from here - http://bit.ly/2E12rgD I can't sleep and hardly eat, because of this issue, will appreciate any help. Thanks BlurFilter.h BlurFilter.cpp
from GameDev.net http://bit.ly/2WBVbiq
from GameDev.net http://bit.ly/2WBVbiq
ليست هناك تعليقات