marcosimonvfx Posted March 23, 2020 Share Posted March 23, 2020 Hi all, this is a technical question to help me understand what's going on under the hood about how geometry lights are rendered: I am playing with writing my own raytracer within Houdini, where I also want to use geometry lights. The way I go about it is that each shaded point does a shadow test to a randomly generated point on the surface of the light geometry. As this happens completely at random it is somewhat likely that the generated point will lie on the far side of the geometry, so the light geometry itself will cast a shadow (self shadow on). This results in the first attached picture. This makes sense to me - if you consider a shaded point on the wall behind the turquoise cube - it has only a 1/6th chance of generating a point on that cube that it can actually see whereas a point to the top and right of that point sees 3 sides of the same light geometry, therefore it has a higher chance of generating a point it is illuminated by. This is not what I would imagine seeing in real life (though maybe my conception is wrong). However when I rebuild and render the scene in Houdini/Mantra (type geometry with a box as geo and self shadow on), the result is very different (see attachment 2). Maybe someone can shed a light on how Mantra does its magic. Cheers! Quote Link to comment Share on other sites More sharing options...
anim Posted March 23, 2020 Share Posted March 23, 2020 maybe look at files like: $HFS/houdini/vex/Light/sampler_geometry.vfl $HFS/houdini/vex/Light/tracer_geometry.vfl $HFS/houdini/vex/include/pbr_direct_lighting.h and others in there, and hopefully you will find some useful info in there 1 Quote Link to comment Share on other sites More sharing options...
marcosimonvfx Posted May 7, 2020 Author Share Posted May 7, 2020 (edited) I never thanked you for these! Thanks! I didn't quite find what I was looking for, but I found my answer eventually in the raytracing gems book: http://www.realtimerendering.com/raytracinggems/ [page 216ff]. Tldr: Instead of shooting rays to the points on the lightsource, trying to see if they reach the point only the direction is taken and a ray shot in that direction. If the ray hits the lightsource (no matter where) then it's good. Edited May 8, 2020 by marcosimonvfx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.