3D renderer using nothing but turtle (for rendering) and math (for computing).

3D renderer using nothing but turtle (for rendering) and math (for computing). Used AI

38 devlogs
34h 6m
•  Ship certified
Created by lindenthesilly

AI note: used AI for writing math statements only! ~12% ai, but i enabled the flag just in case.

everyone’s out here flexing “real-time” rendering. ray tracing. gpu accel. blah blah.
me? i made a 3d renderer in… python turtle. yeah. the thing that drew squares in 5th grade.
so, what if we gave the turtle a wheelchair with nitro fuel?
no numpy. no c extensions. no mercy. still manages to run at 60fps at the strength of sheer willpower and hopes and dreams.
this isn’t speed. this is vibes >:3c

Timeline

Ship 3

1 payout of shell 155.0 shells

lindenthesilly

about 1 month ago

lindenthesilly Covers 5 devlogs and 8h 21m

MORE PRECOMPUTATION, cut-throat optimizations, A LOT OF DOCSTRINGS, and a LOT MORE CRYING later, i actually managed to make a usable stdlib only 3d renderer!!
yap incoming!:
ok so like. imagine. lil baby me making a humble silly goofy 3d wireframe project, just lines zoomin everywhere like spaghetti code in motion. now fast forward to now and i got LIGHTING. WITH. SCATTER. running at SIXTY!! FPS!! (actually more than 60 but i gotta leash those frames like wild puppies or else they’ll run into traffic). like bro this project went from a scuffed lil v0.5 stick figure renderer to ✨v1 flat shading✨ to ✨v4 distance lighting✨ to ✨v5 real lights™✨ to ✨v6 optimization station✨ and then just me drowning in a SEA of bugfixes like i was swimming through spaghetti ocean.

and like… for WHAT. pls give me ONE real world use case for this qwq. like what am i gonna do, light up my blahaj shrine in realtime rendering?? (actually wait that sounds kinda hot).

anyway this is my 6th (SIXTH. 😭) attempt at this cursed passion project. the first two times were on SCRATCH (yes scratch. yes the cat one. yes i hate myself too). the third time i got funky with a scratch MOD and somehow birthed an actual renderer (with more bugs than my bathroom light). 4th & 5th were numpy vibes but i never got past wireframes. no lights. no shading. just sad triangle outlines. then attempt six rolled in, i saw SoM and went “heh… what if i cook again” and WHOOPS I COOKED TOO HARD.

bro i spent more hours on wikipedia than studying for my exams, more hours debugging than sleeping, and if hackatime actually counted all the minutes i was staring at code in despair with my debugger open, i’d probably have like 3000000h logged. like i basically gave my compiler ✨trauma✨.

but real talk… i made friends, i made memories, i made my compiler scream bloody murder at me, and i actually learned more from this than any math class ever. i’m so proud of myself. like 2 years ago i was asking “is a 60fps renderer even possible for me??” and today i can answer: yes past me, it’s possible, its possible with only things from the standard library, and it’s ✨beautiful✨.

also my brain is soup now. but soup that runs at 60fps. 60fps with scatter lighting.

enjoy my devlog art <3
thats it for the project, exams just about done too! i already have ideas for my next torturing metho- i mean project!! set sail and be free, my renderer!

Update attachment

this is optimized to the max. i optimized everything that can be controlled, and now it runs at 60fps roughly. i added docs and stuff, just needs some final polish before i upload the final demo, repo, and do a final ship. this is the end of the 3d renderer, with my next devlog my final thoughts or smth i dunno :3
ok exam revision time :p

Update attachment

beautifully optimized, runs at 60-80fps with a few single frame drops, probably due to turtle internal clock being over worked, which i have no control over.
this is going to be my second last devlog, with my final devlog being just some documentation. thanks to everyone who helped vote for me (mmm yummy 360 shells!!), i'll be working on a new project soon <3

Update attachment

made it so that lighting precomputation can be triggered by the user at any time. this makes it so that the game can pre-precompute the lighting before calling render(), making the first frame of rendering much faster. had to do like 4 structural changes to my code :sob:

Update attachment

all the main features done now, all thats left is micro-optimization (need to do stuff like making view frustrum culling work, microoptimize goto functions, stuff like that)
also, hitting 2k lines soon!
this project is reaching a close, im running out of things to add, any suggestions dm me on slack <3

Update attachment
Jakov Jakov about 1 month ago
Ts is a good projects for learning math fr fr
Youssef Youssef about 1 month ago
noice

Ship 2

1 payout of shell 360.0 shells

lindenthesilly

about 1 month ago

lindenthesilly Covers 32 devlogs and 25h 29m

was wondering why cache wasnt caching, since like caching on and caching off uses the same amount of memory and gives the same fps. found a bug that makes caching behave unpredictably. screenshot shows the fps with caching off
CACHING RUNS AT 60FPS, IT GIVES A 4X IMPROVEMENT LMFAO

Update attachment
Youssef Youssef about 1 month ago
lets gooo, ur thing is extremly optimized now lol , didn’t tought it will be that memory efficient
lindenthesilly lindenthesilly about 2 months ago
note: its time for studying, so expect development speeds to SIGNIFICANTLY slow down!! anyways i dont have much more features planned, so this might just be the last devlog. thanks to everyone who followed along!

fixed a shadow bug that caused self-shadowing. very stupid mistake, costed me HOURS of rolling back code to see what i changed, and fixing stuff caused by the issue...
added precomputation for light bouncing. this also took me WAYY TOO LONG... caching is a stupid thing to get right. but hey, now you can set light_bounces to 100 and still run at 80fps, for the price of 4 seconds of precomputation at the start of the program
also, everyone welcome back captain hajjy back to the devlogs! you've been missed

Update attachment

light reflection!!
you might notice theres a lack of blahajs in my recent devlogs, thats cuz i dont want my pc to blow up rendering that many faces. sorry :pensive:

Update attachment

SHADOWS WORK NOW!!!
okokokokokok gonna set up a showcase scene and then update this :3

Update attachment

was touching some late-night grass when explorpheus hit me with a bombardment of messages!! so many follows!!!! and yet no payout yet..

Update attachment

textures were impawsible but i did make an audio engine, maybe for 3d spacial audio?

Update attachment

nah i change my mind no texture rendering sorry peeps, apparently just averaging the colors is gonna make it look horrible

all that work for nothing...
thats 3 features i cancelled

Update attachment

I DONE IT!! AAHAHAHAHA HAHAHAHAHA BAHAHAHAHAH I WROTE MY OWN IMAGE READE R IN VANILAA PYTHON ABHAHFHAHF DUH ISHE UU SUF PEFHWHF
im going insane send help

Update attachment

FAFOd with some precision related settings, found a suitable rounding precision...
any more optimization and im gonna have to write my own garbage collector

Update attachment

caching... :drool:
well now lighting is baked, kinda, sorta, its precomputed whatever same thing

Update attachment

added togglable caching, made lighting easier to calculate, did some memory optimizations. this gayhaj is the result of all that. I'm running out of things to do...

Update attachment

made the material and object lists into classes!

Update attachment

its now updated on github!
https://github.com/CastyLoz17/turtle_3d_renderer/releases/tag/v3
hopefully i get the shells sooner...

Update attachment

added some emmisive objects! very proud :3c

Update attachment

lighting is done!!
ambient lighting is sightly purple
red point light source on top
blue point light source on bottom
(yes bisexual lighting)
pink directional light source on snoot
turquise spotlight on tail
<3

Update attachment

after some time of claude failing, i decided to do more wikipedia research, and lo and behold the goat newell saves the day again!!
the problem is fixed now, just need to see if theres a purrformance impact on larger stuff

Update attachment

was showing off my code to the silly council in discord vc
what is that hole in the stomach?

... fuuuuuuuuuuuuuuuuuuuuuuun welp time for more wikipediaing and debugging...

Update attachment

i did a thing.
well thats lighting. kinda. sorta. will update repos in a bit after i fix a few bugs...
this is going up onto iframe

Update attachment

made some lighting presets, so that everything dont just look flat (basically fancier fog)

Update attachment

made it so that all platforms can run this code (mouse dont work on mac)
technically should work now. i'll redo the repo later <3

Update attachment

made a renderer_mac.py that uses pynput instead of mouse, as mouse bugs out on mac. this STUPID MISTAKE delayed my cert, and i hate myself for not finding it. updated code on github now

Update attachment

oh yeah just realised i havent updated the git repo in a long time, here it is now

Update attachment

did some cprofiling, looks like im for once out of things to microoptimize... and now that skyboxes are cancelled time to make culling + lighting/shadows.
also im gonna be using the teapot model from now on

Update attachment

no skybox for you then... too buggy n laggy n stuff
welp thats two things down the drain today
... qwq

Update attachment

hi hi yeah so ok i made a texture engine and a skybox engine. its running at 2 frames per sometimes. i'll fix that. probably
paws at you paws at you paws at you paws at you

Update attachment

made some z buffering modes, but apparently turtle isnt the only bottleneck...
more info in image below, i'll research into other culling techniques that isnt cpu heavy <3

Update attachment

oh hi yeah cool thing, my script can actually render complex stuff now
reworked like half the code since i didnt like how everything was jank
time to do research on how im gonna make a skybox

Update attachment

after a bit of debugging and a bit more procrastination in #summer-of-making, ive finished the camera system with keyboard and mouse controls (WITH A LOT, by that i mean A LOT OF JANK)
i shall do more optimization tomorrow (as in when i wake up, because technically 12am is in 23 minutes as of writing this), but right now im so pumped and shocked that my scuffed script sorta kinda works
oh boy do i love wikipedia styled math equations...

p.s. used chatgpt for 10% of the script, cuz its too late fur me to be mathin. sorry.

guess what sillyheads, mountains of jank later (negating 27 sine functions so i dont have to write a mirror function, im definitely gonna feel the impact later), I GOT THE CAMERA WORKING
now, i just need to attach it to a keyboard and mouse like your normal first person view mode, and then its gonna be done
i also made a dynamic fps normalizer so my script always runs at 60fps (probably)

Update attachment

oh wow would you look at that, i have a cube and some simple functions for some movement now!!
left-right motion is by camera, the cube is moving up and down
oh yeah did i mention that the cube has color now? i made a function to load mtl files as well

hihihi well okay its out now yayy
anyways i added a obj file import thing
also added a drawing thing
i also just learnt that this has been done before... dam
oh well

Update attachment

Ship 1

1 payout of shell 2.0 shells

lindenthesilly

about 2 months ago

lindenthesilly Covers 1 devlog and 15m

some time in and im done with the camera system
wikipedia, math stackexchange and geeks4geeks boutta be my best friend when i get to the mathing part of this

Update attachment