library: implement refraction

This necessitated to rework how light properties for a material were
given. A material can have either reflectivity or transparency. This
changes the parsing of materials, using a `LightProperty` structure at
its core.

This is does not implement the true Fresnel equations to take into
account the amount of reflection that an incident goes through when
encountering a transparent object.
This commit is contained in:
Bruno BELANYI 2020-03-19 16:42:54 +01:00
parent e00950c7e5
commit 552c0cb966
9 changed files with 255 additions and 93 deletions

View file

@ -47,6 +47,9 @@ objects:
r: 1.0
g: 1.0
b: 1.0
# Optional fields (go together)
#transparency: 0.5
#index: 1.5
texture:
type: uniform
color:
@ -71,7 +74,7 @@ objects:
g: 1.0
b: 1.0
# Optional field
# reflectivity: 0.0
#reflectivity: 0.0
texture:
type: uniform
color:

View file

@ -35,7 +35,6 @@ objects:
type: uniform
diffuse: {r: 0.5, g: 0.5, b: 0.5}
specular: {r: 1., g: 1., b: 1.}
reflectivity: 0.5
texture:
type: uniform
color: {r: 0.25, g: 0.5, b: 1.}