Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectX 11 Compute Shader terrain alphaMap


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Such1   Members   -  Reputation: 435

Like
0Likes
Like

Posted 25 September 2012 - 09:02 PM

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.

Sponsor:

#2 Such1   Members   -  Reputation: 435

Like
0Likes
Like

Posted 27 September 2012 - 12:45 PM

And I don't think I need the map on the CPU if that improves performance.

#3 CryZe   Members   -  Reputation: 768

Like
0Likes
Like

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 Such1   Members   -  Reputation: 435

Like
0Likes
Like

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

Edited by Such1, 28 September 2012 - 08:56 AM.


#5 Such1   Members   -  Reputation: 435

Like
0Likes
Like

Posted 02 October 2012 - 08:12 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS