Real, hardware accelerated 3D rendering #3346
tomekc
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
Do you know a saying "piece of fine work, but not needed by anyone"? :)
First I need to admin that I am big fan of Ebiten and I use it for my pet game projects. One thing I miss is 3D capability despite fact, that the backend for Ebiten is true 3D pipeline.
I am aware of Tetra3D, and inspired by it I took my own approach and built boomer-shooter 3D engine based on Duke Nukem 3D. It is partially software rendering, with shaders to calculate perspective correct texture mapping.
But that was not enough, so I decided to give a shot, and with help of wonders of modern world (AI) made some changes to
2.9branch and ended up with...Proper 3D rendering in Ebiten
https://github.com/tomekc/ebiten/tree/2.9-3d
My goal was:
I am so happy with the result, got it implemented only for:
Implementation
For clarity I use
Customvector inVertexto store 3D vertex coordinates. Having a Z coordinate would be helpful, but I am aware of discussion that @hajimehoshi was reluctant to add, which is perfectly understandable.Another important piece is
Renderer3Dwhich wraps turning few knobs to allow 3D rendering and not to mess with default Ebiten behaviour. The usage you can find in new Mesh example.You can mix 3D and regular Ebiten rendering. Deep down is call to
DrawTrianglesShaderwith custom shader and extra uniform to provide transformation matrix - need to provide perspective one.What do you think? :-)
Beta Was this translation helpful? Give feedback.
All reactions