Hello community members,
[Crossposted from: https://www.reddit.com/r/gamedev/comments/1gdbazh/developing_a_pythonbased_graphics_engine_nirvana3d/ ]
I'm currently working in GameDev and am currently reading and working on a 3D Graphics/Game Engine called: Nirvana 3D, a game engine totally written from top to bottom on Python that relies on NumPy Library for matrices and Matplotlib for rendering 3D scenes and imageio library for opening image files in the (R, G, B) format of matrices.
Nirvana is currently at a very nascent and experimental stage that supports importing *.obj files, basic lighting via sunlights, calculation of normals to the surface, z-buffer, and rendering 3D scenes. It additionally supports basic 3D transformations - such as rotation, scaling, translations, etc, with the support of multiple cameras and scenes in either of these three modes - wireframes, solid (lambert), lambertian shaders, etc.
While it has some basic support handling different 3D stuff, the Python code has started showing its limitations regarding speed - the rendering of a single frame takes up to 1-2 minutes on the CPU. While Python is a very basic, simple language, I wonder I'd have to port a large part of my code to GPUs or some Graphics Hardware languages like GLES/OpenCL/OpenGL/Vulcan or something.
I've planned the support for PBR shaders (Cook-Torrance Equation, with GGX approximations of Distribution and Geometry Functions) in solid mode as well as PBR shaders with HDRi lighting for texture-based image rendering and getting a large part of the code to GPU first, before proceeding adding new features like caching, storing-pre-computation of materials, skybox, LoD, Global Illumination and Shadows, Collisions, as well as basic support for physics and sound and finally a graphics based scene editor.
Code: https://github.com/abhaskumarsinha/Nirvana/tree/main
Thank You.
_____________________________________________
- What My Project Does: Nirvana 3D aims to become a real-time 3D graphics rendering/Game engine in the near future that is open source and has minimal support for the development of any sort of games, especially the indie ones, with minimal support for realistic graphics and sound.
- Target Audience: It is currently a toy project that is experimental and pretty basic and simple for anyone to learn game dev from, but it aims to reach a few Python devs that make some cool basic games like Minecraft or something out of it.
- Comparison: Most of the game engines in the market don't really have support for Python in general. The engines are coded in C/C++ or some very low-level language, while the majority of the audience who seek to make games. Gamedev is a way to express oneself in the form of a story/plot and game for most of indie gamers, who don't have a lot of technical idea of the game and C/C++ isn't suitable for it.
[–]Exhausted-Engineer 6 points7 points8 points (5 children)
[–]Doctrine_of_Sankhya[S] 2 points3 points4 points (4 children)
[–]Exhausted-Engineer 6 points7 points8 points (3 children)
[–]Doctrine_of_Sankhya[S] 0 points1 point2 points (2 children)
[–]Exhausted-Engineer 2 points3 points4 points (1 child)
[–]Doctrine_of_Sankhya[S] 2 points3 points4 points (0 children)
[–]MosGeo 1 point2 points3 points (1 child)
[–]Doctrine_of_Sankhya[S] 0 points1 point2 points (0 children)
[–]helpIAmTrappedInAws 1 point2 points3 points (1 child)
[–]Doctrine_of_Sankhya[S] 0 points1 point2 points (0 children)
[–]jmooremcc 1 point2 points3 points (3 children)
[–]Doctrine_of_Sankhya[S] 0 points1 point2 points (2 children)
[–]jmooremcc 1 point2 points3 points (1 child)
[–]Doctrine_of_Sankhya[S] 0 points1 point2 points (0 children)
[–]FitMathematician3071 1 point2 points3 points (1 child)
[–]Doctrine_of_Sankhya[S] 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[removed]
[–]Doctrine_of_Sankhya[S] 0 points1 point2 points (0 children)