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:
![](https://uploads.gamedev.net/forums/monthly_2023_07/71ecdc9c35a844b9832dbf1b791d763a.image.png)
But my renderer yields below result:
![](https://uploads.gamedev.net/forums/monthly_2023_07/5844015be2cf477e98747adea62ba3c8.image.png)
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.