|
Post by godzil on May 30, 2020 11:11:37 GMT
I’m currently trying to port a scene from a friend raytracer (completely different than the one we made here) and his main (only) type of light are spot light (with soft shadows)
All I’ve found into so far about spot lights is a bit confusing to me, and unless tweaking the scene (which I don’t want, the idea was to compare the render from a similar description, not having the same render!) I can’t use point or area light as unless there is shadow, all point on each object take the full intensity of the all the lights.
Does anyone have hints on spot light? That would be really helpful
Thanks!
|
|
fremag
Junior Member
Posts: 73
|
Post by fremag on May 30, 2020 14:52:30 GMT
Hi,
In the book (p 240) there is a small paragraph about spotlights. The main idea is that a spotlight is like a point light but rays of light are not sent in every direction but only in a cone. The cone is defined by : - its top (= light's position) - a direction (cone axis) - it's angle
When you check if your shape's intersection point receives some light from a source, you compute the ray from the intersection to the light position. With a spot light you will have to compute the angle of this ray with the cone axis, if it's higher than the angle value, there is no light.
|
|
fremag
Junior Member
Posts: 73
|
Post by fremag on May 30, 2020 14:55:55 GMT
Here is the scene I made to test my spotlights.
It's possible to manage soft shadows with spotlights too, I can give some details about this if you want.
|
|
|
Post by godzil on May 30, 2020 17:00:39 GMT
Oh gosh!
Thanks fremag!
Juste while reading mis your first post I think my brain just decided to connect the dot and finish reading and “of course” that’s just what my brain come to!
Now it is time to try!
|
|