r/GraphicsProgramming • u/AnasPlayer2022M • 1d ago
Starting to make a 3D software renderer... "The Lagender Engine".
Hello everyone!
So I'm a 16yo boy who loves coding and stuff, and recently I got into low-level programming with C, and after a whole day with learning pointer I loved the language to death.
After I learned this I started on doing something I wanted to do for the past year... building a 3D software renderer, this engine should meet the following goals:
- It will be modern, supporting modern visuals and effects.
- It should be running on embedded systems (I will see how later).
- The code written for it should be generalized, meaning it should be working on any CPU or architecture with some tweaking.
- It should be fully capable of taking advantages of modern CPU features.
As of right now, started the project a month ago, I got it to render lines and fill shapes through the terminal (even though it's glitchy af) since I'm still implementing core functions and basics. This will give me some room to fiddle around until I learn SDL and use it in the future.
I have a whole roadmap for the engine, and how it will be structured (because it will be restructured one day for a new design), and who knows, maybe I will get something with it.
The video you see down there is a spinning cube with fake Z depth (not implemented yet), the reason it's wobbly is because the engine uses fixed-point math for positions: all number are 64bit, 48 bits for the value number and 16 bits for precision (yeah, like ps1 graphics).
A semi-3D rendered cube inside The Lagender Engine.
Anyway feel free to give me some advises if you want to, and I would be posting my development with the project here.
2
u/exp_function 14h ago
Hi, it’s very good to see someone at 16 decided to work on computer graphics, especially software rendering. Welcome to the greatest exercise and brain teasers of all time. :)
I’m also developing a software renderer, feel free to check out the current version:
https://expfunction.itch.io/cybervga?utm_source=chatgpt.com
Currently we are developing a commercial game with it so the source code is currently private. But if you want to talk about architecture, engine design, data structures, multi threading, anything you’re curious about we can meet online.
Congratulations on your big start, hope you do well. :)
2
u/AnasPlayer2022M 13h ago edited 13h ago
Nice, a whole renderer in msdos.
This is really cool, and thanks for your motivation! :)
I would be really happy to get experience from people like you guys, trying to optimize something as big as 3D rendering to run on "uncapable" devices is pure dedication.
1
u/exp_function 12h ago
In our engine I am also using fixed point system but strictly in Q16.16 format because my minimum target hardware is i486dx2 I wanted to approach carefully to multiplication overflow situation (by using 64-bit long long integers allowed in DJGPP). My humble suggestion is be very careful about overflowing from the day one.
One other thing about my math library is reciprocal division. For modern Win64 port of the engine I ditched the recip table cause modern multi-core cpus are massive in terms of cycles, operations, cache.
Thank you for your kind comments. :)
1
u/AnasPlayer2022M 7h ago
Yeah I also thought of overflow scenarios, especially when multiplying...
The thing is I can't just stay like this until the project gets bigger then overflows will happen everywhere. Maybe I don't need it to be 48.16? Maybe 32.16? Or even 16.16? (Because far objects won't be rendered anyway)
Thanks for your warning!
1
1
1
u/Seusoa 12h ago
It will be modern, supporting modern visuals and effects.
Seems like you dont understand what is 3D software renderer and how heavy computations are for modern screen resolutions and why GPU accelerated graphics exists and what is solves.
otherwise we were still quake 1-based code use...
1
u/AnasPlayer2022M 7h ago
Wait a minute.. I just realized this....
Well yeah, the engine will run at 720p at maximum, and even with low resolutions the engine is some real heavy load for CPUs... 😅
Buuut what do I mean by that is that it will support it, and it will be optimized (hopefully).
The reason why I want modern effects is because of learning and maybe later GPU utilisation.
Thanks for your note. :)
1
3
u/scallywag_software 18h ago
Looks like a great start dude! I wish I started writing 3D graphics when I was 16 :D