GPU Final Project
Next steps or rather final steps-:
With just a few hours remaining to the final submission. I have to do the following :
Multiple scattering, not sure how trivial or hard it would be after implementing single scattering
Presentation, demo video
Code cleanup\ Comment
Most importantly sleep 😛
Getting back to work now !!
Just took a break from SSS and shifted my attention to BRDF’s. What is a BRDF ?
The most trivial explanation of a BRDF (bidirectional reflectance distribution function) is that it is the bit of shader code describing how a surface reacts to light. Generally, it is responsible for calculating the specular highlights and diffuse characteristics of the surface material.
There is no single model that fits every situation, but there are some better than others. The Cook-Torrance model has been shown to be a top performer, when compared against actual acquired BRDF data. Of course, with the good comes the bad and Cook-Torrance is one of the most expensive models to compute. But for overall results, it is hard to beat.
Why cook torrance?
First, it computes its specular lobe using the half-angle vector, which has been shown to give the most physically plausible results.
Second, it accurately models the Fresnel effect, increasing the specular reflectivity as the surface turns away from the viewing direction.
Finally, it models micro imperfections in the surface, taking into account how they add to, and attenuate, the specular reflections
The Cook-Torrance BRDF is governed by the following equation, which is computed for each light and summed:
Any BRDF paper is full of mathematics by nature, but do not let this equation scare you.
From the equation above, there are three components contributing to the specular highlights in the Cook Torrance BRDF. They are: a Fresnel term (F); a geometric attenuation factor (G); and micro facet slope distribution (D). We will tackle each one individually, then combine them at the end of our illuminance loop, as directed by the equation above.
Here is the rendered image with Cook Torrance. The green and pink material have specular turned on and the blue material is simply diffuse. I love the subtle reflection that is showing up.
Here i have Gauss Coefficient =100 and roughness= 0.03.
The single subsurface scattering
Yay’s so finally it seems to reach somewhere. I guess what i am not doing is right now is merging the colors due to reflection in the end. Write now it looks a very diffused i need to added some reflective properties and make it look more glossy.
The hardest part in doing subsurface scattering was to figure how to accumulate color in the end.
Next step-: I might also try multiple scattering if the time permit. Right now most important thing is to have KD tree implementation integrated. Intersection tests are killing me in OBJ’s.
Working with subsurface scattering -:
Subsurface scattering (or SSS) is a mechanism of light transport in which light penetrates the surface of a translucent object, is scattered by interacting with the material, and exits the surface at a different point. The light will generally penetrate the surface and be reflected a number of times at irregular angles inside the material, before passing back out of the material at an angle other than the angle it would have if it had been reflected directly off the surface.
This still does not appear very. Its hard to locate the problem, still working on it!
Faster convergence and Fresnel Reflection
Here is the finally a much better result .. Almost there
So finally i solved the problem of fast convergence with sweet little hack. I just created the walls as
as source of light, so this way i can make almost every ray count and contribute to the final color. Earlier
i guess most of the ray were not hitting the light or the background and i was terminating them
after 6-7 bounces as a result quite a few rays ended up contributing nothing and that added some variance to the whole path tracer system and hence it took more time to converge
Some more weird stufff
OBJ loader and Fresnel Reflection
Early OBJ reader results-
Not sure why it is taking like forever to converge!!
After roughly 900 iteration i have this.
GPU FINAL PROJECT PROPOSAL !!
For my final project i want to extend my GPU based path tracer. I feel i did a good job in creating a basic setup for a path tracer but i lacked some really cool features.
Seeing some of the results on the path tracers online i felt that I can go a long way with the path tracer i currently have and make it look much more realistic and physically accurate.
Some of the features that plan to accomplish are-:
1) Subsurface scattering.
2) Obj mesh loader.
3) Depth of field.
4) Cook Torrance BRDF model.
5) Motion Blur.
6) Interactive camera.
7) Integrate a stackless KD tree.
I feel this should be more than enough to give me sleepless nights provided i have 3 more courses and projects to work on 🙂
I hope you like my proposal and i would love to hear any suggestions you have.