How I Made a Raytracer in Python

preview_player
Показать описание

The best video I've made in 6 months.

Рекомендации по теме
Комментарии
Автор

Amazing! This project has everything to become something bigger, like a simulator or something like that

gustavoalberto
Автор

i'm surprised most of the 6 months wasn't spent rendering

ctbdjc
Автор

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,
Line 63: reflection_ray = Ray(intersect + reflection_ray.direction.reflect(normal)*shadow_bias,
The result will be much better!

artiartem
Автор

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.

ThankYouESM
Автор

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!

ItsThies
Автор

AMAZING WALLPAPER STAHP DRIP/10 and also the project is cool ig

DaDogeDev
Автор

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

SCPokSecondaccound
Автор

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)

guiguifishy
Автор

have you heard of mojo for python ? Maybe your project could go on one day

dreamyangel
Автор

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

Benjamin_Stroup
Автор

Dunder add? Who the hell is dunder? Your operator overloads have nothing to do with “dunder”. These magic methods you speak of don’t exist. It’s called operator overloading

skunkwerx
welcome to shbcf.ru