reflection added

This commit is contained in:
Crizomb 2025-09-28 04:46:54 +02:00
parent 6fc7d7a4c3
commit a6770d7fac
3 changed files with 24 additions and 6 deletions

View file

@ -62,7 +62,7 @@ func MixMat(mat1 MaterialBrut, mat2 MaterialBrut, t float64, p Vector3) Material
mat1.specularColor.GetColor(p).Scale(1 - t).Add((mat2.specularColor.GetColor(p)).Scale(t)),
mat1.specularFac*(1-t) + mat2.specularFac*t,
mat1.specularExp*(1-t) + mat2.specularExp*t,
(mat1.reflectanceFac*(1-t) + mat2.reflectanceFac) * t,
mat1.reflectanceFac*(1-t) + mat2.reflectanceFac*t,
mat1.reflectanceTint.GetColor(p).Scale(1 - t).Add((mat2.reflectanceTint.GetColor(p)).Scale(t)),
mat1.refractFac*(1-t) + mat2.refractFac*t,
mat1.refractIndice*(1-t) + mat2.refractIndice*t,
@ -88,7 +88,7 @@ func DefaultMaterial(diffuseColor Color) MaterialBrut {
specularColor: Vector3{255, 255, 255},
specularFac: 1,
specularExp: 35.0,
reflectanceFac: 0.0,
reflectanceFac: 0.2,
reflectanceTint: Vector3{255, 255, 255},
refractFac: 0.0,
refractIndice: 1.0,
@ -97,7 +97,7 @@ func DefaultMaterial(diffuseColor Color) MaterialBrut {
// Colors
var RED = Vector3{255, 0, 0}
var RED = Vector3{125, 0, 0}
var GREEN = Vector3{0, 255, 0}
var BLUE = Vector3{0, 0, 255}
var WHITE = Vector3{255, 255, 255}