How should I exactly mix refracted and reflected color, fresnel

146 Views Asked by At

I am building a raytracer in C for the school. Yesterday I successfully implemented my first recursive refraction, however I am not very satisfied with the result. a picture of my raytracer with 2 reflective spheres

I find that the water ball doesn't look like a water ball so if you have some advice on what I should do next tell me please, from what I had read:

Beer law

Making the darkness of the shadow depend on how long a ray light traveled trough a refractive material (I guess I can use beer law for that)

I suspect this could come from my implementation, here is what I did:

first I set a material like that:

-DIFFUSE 1
-SPECULAR 10
-REFLEXION 0.1
-REFRACTION 0.9
-IOR 1.33

This are the characteristics of my water material.

Since I am using fresnel to calculate how much transmitted and refracted colore I should take to compute my final colore I am wondering if my reflection and refraction coef shouldn't be simply Boolean. Right now I am using them to ponderate how much reflection and refraction colore I should use, but isn't it too much since I am also using fresnel? I am a bit confused about this part and red a lot of PDF from a lot a university but the precise mix isn't cover by them, they just tell us to use fresnel to choose how much reflected or transmitted light we should use but when they put pseudo code you can read that they call recursively them function: if (material->is_reflective) if (material->is_refractive)

0

There are 0 best solutions below