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.