tag:blogger.com,1999:blog-4016790357096156934.post4293787277726419767..comments2023-12-16T03:44:42.484-06:00Comments on RichieSam's Adventures in Code-ville: Making Our First Pretty PictureRichieSamshttp://www.blogger.com/profile/11068267631031438940noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-4016790357096156934.post-6639441651617835992018-04-18T21:47:23.225-05:002018-04-18T21:47:23.225-05:00Thank for providing good information for site,Tha...Thank for providing good information for site,Thanks for your sharing.<br /><br /><a href="http://pangthai1212.blogspot.com/" rel="nofollow">หนังออนไลน์</a>vaiyborahttps://www.blogger.com/profile/05095754542895387700noreply@blogger.comtag:blogger.com,1999:blog-4016790357096156934.post-38247467766103564122016-09-27T10:27:00.290-05:002016-09-27T10:27:00.290-05:00Great minds think alike? :PGreat minds think alike? :PRichieSamshttps://www.blogger.com/profile/11068267631031438940noreply@blogger.comtag:blogger.com,1999:blog-4016790357096156934.post-78883726386876659672016-09-27T09:38:20.738-05:002016-09-27T09:38:20.738-05:00I literally came up with the exact same idea of th...I literally came up with the exact same idea of this type of digital camera. Why does this always happen to me!?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4016790357096156934.post-21041106153624440282015-04-13T20:46:26.046-05:002015-04-13T20:46:26.046-05:00Thanks for all the info!Thanks for all the info!RichieSamshttps://www.blogger.com/profile/11068267631031438940noreply@blogger.comtag:blogger.com,1999:blog-4016790357096156934.post-5875538247319059392015-04-13T18:07:04.519-05:002015-04-13T18:07:04.519-05:00I'm just learning about that stuff myself righ...I'm just learning about that stuff myself right now. The open source path tracers I've studied so far, seem to use the technique you described above, ie checking if the object triangle (from where the ray starts) and light triangle are facing each other using two dot product tests.<br />Btw, if you're looking for some seriously fast CUDA BVH traversal code, have a look at https://code.google.com/p/understanding-the-efficiency-of-ray-traversal-on-gpus/. The kernels were developed by Nvidia engineers and their performance is currently the state of the art in GPU path tracing. Sam Laperehttps://www.blogger.com/profile/05688552048697970050noreply@blogger.comtag:blogger.com,1999:blog-4016790357096156934.post-90410023832257006322015-04-12T23:03:09.637-05:002015-04-12T23:03:09.637-05:00I was planning on eventually going to a BVH or KD ...I was planning on eventually going to a BVH or KD tree. And going with all triangles would definitely simply things.<br /><br />Do you know of any heuristics for choosing lights / points on the light that have a much higher chance to contribute? For example, not choosing triangles / point that are backfacing. Perhaps just rejection sampling. For example:<br /><br />1. Randomly sample a triangle<br />2. If frontfacing<br /> 3. Shoot shadow ray through scene<br />4. Else<br /> 5. Re-sampleRichieSamshttps://www.blogger.com/profile/11068267631031438940noreply@blogger.comtag:blogger.com,1999:blog-4016790357096156934.post-12664876687767442302015-04-12T22:17:34.510-05:002015-04-12T22:17:34.510-05:00I think it depends on what your goal is. If you ju...I think it depends on what your goal is. If you just want to create an experimental renderer it makes sense to support multiple primitives. But if you want to develop a production ready GPU path tracer like Cycles, you'll probably want to limit yourself to triangles to represent all geometry (including lights) for performance reasons.Sam Laperehttps://www.blogger.com/profile/05688552048697970050noreply@blogger.comtag:blogger.com,1999:blog-4016790357096156934.post-15338825909351413342015-04-12T20:53:03.507-05:002015-04-12T20:53:03.507-05:00Yea. That's probably the next post. The only r...Yea. That's probably the next post. The only reason I haven't done it already is I can't think of a clean way to store all the lights. My first though was to store indices for each type of shape. So something like:<br /><br />struct SceneObjects {<br /> LambertMaterial *Materials;<br /><br /> Plane *Planes;<br /> uint NumPlanes;<br /><br /> Rectangle *Rectangles;<br /> uint NumRectangles;<br /><br /> Circle *Circles;<br /> uint NumCircles;<br /><br /> Sphere *Spheres;<br /> uint NumSpheres;<br /><br /><br /> uint *PlaneLights;<br /> uint NumPlaneLights;<br /><br /> uint *RectangleLights;<br /> uint NumRectangleLights;<br /><br /> uint *CircleLights;<br /> uint NumCircleLights;<br /><br /> uint *SphereLights;<br /> uint NumSphereLights;<br />};<br /><br />Which I could then use lots of if statements to pick one and then sample from it. But that seems really really gross.<br /><br />Most CPU path tracers use virtual classes. Which, you *can* do in CUDA (or fake it with big switches), but all those branches make me cringe a bit. <br /><br />Perhaps I'm overthinking it. I'll give it a shot and see how the performance is.RichieSamshttps://www.blogger.com/profile/11068267631031438940noreply@blogger.comtag:blogger.com,1999:blog-4016790357096156934.post-45422859432320862182015-04-12T19:25:57.173-05:002015-04-12T19:25:57.173-05:00Fantastic post once again and great progress (desp...Fantastic post once again and great progress (despite the car accident). Haven't had time to look into the code on github yet, but from the code snippets in this post it looks like you're not using explicit light sampling, which could greatly speed up convergence in the Cornell box scene. But I bet that's the topic of a future post. Sam Laperehttps://www.blogger.com/profile/05688552048697970050noreply@blogger.com