Posts

9/22 Multiple Importance Sampling + GGX

Image
Slight update to mis progression. The individual parts (nee and brdf) render and match the reference. Now the hard part is combining the two into one function. The current renders looks as follows. NEE With next event estimation, rough surfaces get rendered better but have an issue when it comes to rendering shiny surfaces. BRDF With brdf, shiny sources render better and the reflection is clear. So the goal of mis is to combine the two of these. While in the process of making these two images, there were a few clamping issues that were fixed which reduced the black spots that appeared for the ggx render. Due to the domain of arccos function, it just needed to be clamped to [-1, 1] to avoid Nan values.

9/6 And so it continues...

Image
So I saw the latest NVIDIA GeForce RTX 30 Series graphics cards and got inspired to try picking this up again. The goal this time: attempt to achieve proper subsurface scattering (ideally jade). This time, I will be doing it alone though :( Looking at the old code, everything was really just mushed together. Each assignment was built off the previous and we ended with the main intersection code at around 400 lines. I had done a tiny bit of code clean up at the start of summer but never finished. The original code my partner and I worked on also did not fully finish multiple importance sampling.  Here is a render of importance sampling the ggx brdf from the current code: The main intersection function is only around 100 lines now with a majority of the logic being separated into different functions. Currently working on multiple importance sampling. Aftwards, it's back to subsurface scattering!

6/9 Final Results

Image
Here are the final results for our attempt at subsurface scattering. We managed to get single-scatter events to work (this image was referenced in a previous post). The main issue, in the end, was attempting to integrate into multi-scatter events. The way direct lighting processed a specular surface caused issues in which it would create a glossy texture and we could somewhat render out the individual components of the scatter and the diffuse, but combining the two made it look like just a diffuse with more specularity. We believed that this image above best demonstrates subsurface scattering. Despite not achieving the jade effects we aimed for, we managed to successfully process lighting within an object with single scatter events. For a reference to our initial images, this is what we started with: Finally, here is what we aimed to achieve:  Through this project, we've learned a lot about the physical properties of objects and how subsurface scattering works on a fundamental leve...

6/9: More and more research

Image
Further research on topic of Fresnel equations: https://www.cs.rpi.edu/~cutler/classes/advancedgraphics/S10/final_projects/turnbull.pdf https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-ray-tracing/adding-reflection-and-refraction https://en.wikipedia.org/wiki/Fresnel_equations#:~:text=The%20Fresnel%20equations%20(or%20Fresnel,interface%20between%20different%20optical%20media. Slight issues from before that have now been corrected: Check for total internal reflectance We now update our values better by using a check for the dot between incoming angle and surface normal, so that if this product is negative, we know we're inside and we utilize this to update the values. If we reintroduce our coloring we get Compared to update 6/7 on glass it's a lot better. The issue is we had a check for reflecting whenever refract would fail. Turns out this would cause reflection artifacts along the edges which were why the previous post had such solid edges  Whoa. Redid ...

6/8: Homogeneous Volume Attempt

Image
Attempt at a single scatter homogenous volume render. The dragon looks a lot better now! Looking closely, you can see the scatter of the light inside the object and it is starting to get a bit closer to jade. If you look at the small parts, it looks more dense and lesss light is being let through which will require some tweaking.  https://graphics.pixar.com/library/ProductionVolumeRendering/paper.pdf Updated coloring from  https://books.google.com/books?id=V8NwDwAAQBAJ&pg=PT241&lpg=PT241&dq=jade+material+color+rgb&source=bl&ots=Tnv3iH648v&sig=ACfU3U1W4tqYCJXW5s_bJOSs0wm3vkFvdw&hl=en&sa=X&ved=2ahUKEwjd2_71hvLpAhWlJzQIHcQ0ALAQ6AEwF3oECAoQAQ#v=onepage&q&f=false  section 7.3 which actually dives into the jade material instead Values being used are close, but it felt a bit too white so I slightly tweaked it diffuse 0.4 0.95 0.60 shininess 12.8 ambient 0.135 0.2225 0.1575 specular 0.3162 0.3162 0.3162 Reduced scatter distance by facto...

6/7: Time for a reset

Image
Time to go back to our basic code with nee + rr. We were initially checking for jade as a completely separate material similar to how we processed lights. This approach is probably not correct which caused the lighting issues because light should still be integrated as normal, but if we hit jade we do different code. So now we need to reattempt integration but put it inside where we calculate direct lighting + indirect lighting. We've also cleaned up the code as it was fairly messy what did what and now everything is more clear. Goal: Achieve basic refracting for this dragon Implementing:  https://www.cs.rpi.edu/~cutler/classes/advancedgraphics/S10/final_projects/turnbull.pdf Reason we do this is because the basic of subsurface scattering is deciding between refracting and reflecting inside of the object. If we can figure out how to nail refractance, combining it with the preexisting reflectance code shouldn't be too bad. Well looking at it, it's actually not that bad right...

6/5 Update

Image
Built off previous 20% contribution from shooting through, now give rays chance to either reflect or shoot through the object. Based on  https://computergraphics.stackexchange.com/questions/2482/choosing-reflection-or-refraction-in-path-tracing . The random chance of reflecting vs refracting is based on ior of jade to air and getting the fresnel value off that (Slide 21 of  https://www.brown.edu/research/labs/mittleman/sites/brown.edu.research.labs.mittleman/files/uploads/lecture13_0.pdf ). Using ior of 2.42 for jade and ior of 1.0 for air. Integrated with existing rr code. Compared to previous 20% contribution, more light shines through the thin surfaces New colors to try to get closer to jade 0.00 0.4 0.05 diffuse 0.00 0.659 0.42 ( https://www.colorhexa.com/00a86b ) For some reason this one is super blue, might be an algorithm issue instead of a color issue? Here's the same set of colors with a slightly different algorithm Same algorithm with the 2nd coloring Imo first algor...