Jump to content
  • Advertisement
Sign in to follow this  
gduser418

How to do simple filtering for 3D texture using Pixel Shader

This topic is 560 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a 3D texture and I want to filter each pixel of it. It is rather simple as I only need to read the pixel data for that pixel. So the pixel shader will like this:

 

outcolor = filter_val * input.color;

 

As this is a 3D texture, I think I need to create an object of the same size and draw triangles that will cover each pixel of the object. But this would be a lot of indices to draw with. Is this what I supposed to do with pixel shaders?

 

Is there a better way to do this? A compute shader might do this but I could not find any samples that would take a 3D texture input and output - only the buffers.

Share this post


Link to post
Share on other sites
Advertisement

It will be easier to do with a compute shader and binding the texture 3d as an UAV. you can even perform the update in place, while with a pixel shader and render target, you would need to generate a copy.

Share this post


Link to post
Share on other sites

It will be easier to do with a compute shader and binding the texture 3d as an UAV. you can even perform the update in place, while with a pixel shader and render target, you would need to generate a copy.

 

I am running on a platform that the shader model does not support UAV. Can someone help how can it be done in pixel shader? How the vertex shader can be setup? Do I have to draw a unit cube?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!