6/7: Time for a reset
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 now. The only part I added in so far was giving indirect lighting the ability to either reflect or refract based on if it was jade.
Introduction of accumulating beer lambert's law into throughput. Values obtained from https://help.autodesk.com/cloudhelp/2016/ENU/mental-ray-docs/mr_docs/shaders/reference/node38.html.
Integrated using optix refract method instead of following documentation from above. Also removed contribution towards radiance when object is jade (well, glass in this case of implementation).
Basically same thing as above but now readded in choosing reflect/refract based upon Frensel equations from https://www.cs.rpi.edu/~cutler/classes/advancedgraphics/S10/final_projects/turnbull.pdf. Main difference is now we check for total internal reflection through optix's refract method instead of compare the IORs. Also includes updating throughput based upon Beer-Lambert law.
According to https://graphics.pixar.com/library/ProductionVolumeRendering/paper.pdf, when attempting homogenous volumetric scattering we implement direct lighting by multiplying like we normally do, however we multiply by our scattering coefficient instead of dot(wi, norm). So is is accumulated in our throughput whenever we have a ray inside. We're also going to increase our maxDepth up to 20 for now (from 5) so we can introduce some scattering inside the volume.
Reduced noise from throughput calculations. Used to accumulate based on e^(-oa * x) but just using constant accumulation for now because implementation of e^(-oa * x) is not needed if we implement https://computergraphics.stackexchange.com/questions/2563/full-monte-carlo-volumetric-scattering in which we sample the distance randomly instead and have it set as x = -ln(E)/oa.







Comments
Post a Comment