reflection/refraction`

I am playing around with glsl and would like to be able to scale the amount of light reflected from a material by the amount of light that will be refracted into the material given the incidence angle and materials refractive index. My understanding is the refract and reflect functions in glsl only return the normalized direction vector for the reflected/refracted beam, not the quantity of the incidence light that was reflected or refracted. Is this mathematically doable?

The short answer is yes. Longer answers require more information…what “kinds” of materials are you looking to simulate?

Thanks for the reply Roquen. I was thinking of starting with clay tiles, and concrete.

Try searching with keywords “BRDF” and “shader”. There used to be an online book at gamedev.net but I couldn’t find it doing a quick search. BRDFs (bidirection reflectance distribuation functions) are just one possible method.