Advertisement

Something went wrong with volume rendering in DirectX 11

Started by July 02, 2023 04:12 PM
1 comment, last by hez2010 1 year, 4 months ago

I implemented a volume renderer in DirectX 11, but the render result seems weird.

To render the volume data, I need fit it in a cube first, so I render the front face and the back face of a cube into two textures. Those two textures can be found in RayGenerator.

And then I use the rendered two textures to get the entry point, exit point of ray, and do alpha-compositing in the ray casting pixel shader.

The main render loop RenderFrame can be found in VolumeRendererControl.

While it should yield the below result:

But my renderer yields below result:

I really have no idea about what's is going wrong.

The repo is https://github.com/hez2010/VolumeRenderer​ .​ I will be really appreciated if someone can help.

I made a mistake that I should use position as the output of vertex shader, but I incorrectly used the color as the output.

Now it works as expected.

This topic is closed to new replies.

Advertisement