Hey guys, I`m creating some kind o infinite map, so far everything is okay but I do not know how should I compute the alpha map for the terrain.
I would like to compute every time there is movement, translating what was already generated to it correspond position and generate the new spaces.
I already have the algorimth done in CPU, but I want to use Compute Shaders with 2 textures (1 input 1 output) that keep switching between them. But I do not know how to pass those textures to the Shader, the input is easy but I do not know about the output.
If you have a better way to do it feel free to comment about it.
DirectX 11 Compute Shader terrain alphaMap
Started by Such1, Sep 25 2012 09:02 PM
4 replies to this topic
Ad:
#3 Members - Reputation: 712
Posted 28 September 2012 - 01:24 AM
Use UnorderedAccessViews. These views are almost the same as your ShaderResourceViews, but they are writeable as well. In the shader you simply add "RW" as a prefix to your type (e.g. "RWTexture2D"). You might not even need 2 textures this way. You can read your input from and write your output to the same resource.
Edited by CryZe, 28 September 2012 - 01:26 AM.
#4 Members - Reputation: 408
Posted 28 September 2012 - 08:54 AM
Yeah, I also thought about that, than I can translate the pixel texture coordinate on the pixelShader instead of coping every frame. I just update the pixels I need to
And also, is there a way to do this with Shader 4.0? Than I can support DIrectX 10 as well
And also, is there a way to do this with Shader 4.0? Than I can support DIrectX 10 as well
Edited by Such1, 28 September 2012 - 08:56 AM.






