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

Started by
1 comment, last by gduser418 7 years, 1 month ago

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.

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.

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?

This topic is closed to new replies.

Advertisement