How I Made a Raytracer in Python
HTML-код
- Опубликовано: 10 окт 2024
- code: github.com/Gpo...
The best video I've made in 6 months.
Advanced programming projects (affiliated): app.codecrafte...
My microphone (affiliated): tinyurl.com/2h...
RUclips growth tool (affiliated): vidiq.com/l4fp...
Amazing! This project has everything to become something bigger, like a simulator or something like that
I love this and years ago planned to create a Pythonic Wave Function Collapse solution from a single gigantic RGBA image which the alpha channel very much minimizes the size also from flipping and rotations for placing the 32x32px chunks copied from. To most likely shrink the size even further... could also double layer those RGBA images, but... will need to train the data to make that main image hopefully smaller than 500mb. 32x32px chunks pre-calculated to fill the screen as being fully raytraced should be fast enough to develop AAA games in Python with just the built-in imports.
i'm surprised most of the 6 months wasn't spent rendering
Cool video, but I saw that your reflections are a little strange. I can suggest you change a couple of lines of code in the main.py file.
Line 55: reflection_ray = Ray(intersect + ray.direction.reflect(normal)*shadow_bias, ray.direction.reflect(normal))
Line 63: reflection_ray = Ray(intersect + reflection_ray.direction.reflect(normal)*shadow_bias, reflection_ray.direction.reflect(normal))
The result will be much better!
This ended up working, thanks!
for optimization you can implement that pygame doesn't update the image each pixel but each row or only after the full picture is rendered!
I fixed your reflection formula I think...
def reflect(self, normal: Vector) -> Vector:
dot_product = self.dot(normal)
reflected_vector = self - normal * (dot_product * 2)
return reflected_vector
AMAZING WALLPAPER STAHP DRIP/10 and also the project is cool ig
Hi I’m so confused it’s been six month I was on a side project (a raytracer in python) and I only see your video now. Btw would you know a way to make the code faster and still run on the cpu (a bit like back face culling)
pre-1.45K sub gaming
Loved the video
Great video, so funny
Amazing
New vid 👀
have you heard of mojo for python ? Maybe your project could go on one day
Puberty finally hit?
This dude is going places. He's probably like 14 or 15 and he's making a python ray tracer.
@@inxendere raytracers arent rocket science bro
rip channel
not yet…
Why do people make it so hard to learn? I'm trying to learn how to create a ray tracer. You go way too fast and you don't cover everything you need to cover. Someone, please give me a link to a good video that goes over how to ray trace. Thank you
The reason he didn't cover everything is that this is not a tutorial; it's more like a showcase.
Just look at the src code. It's crystal clear.