Sign in to follow this  
Such1

DirectX 11 Compute Shader terrain alphaMap

Recommended Posts

Such1    435
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.

Share this post


Link to post
Share on other sites
CryZe    773
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

Share this post


Link to post
Share on other sites
Such1    435
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 Edited by Such1

Share this post


Link to post
Share on other sites
Such1    435
Does anyone know any other way I can use ComputeShader to compute my Texture but using Shaders 4.0 instead?Cause than I can use DirectX 10 feature level.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this