|
|
@ -37,7 +37,7 @@ class MatHelper{ |
|
|
|
/** |
|
|
|
* 获得 十六进制颜色 同色调 的 最大亮度 |
|
|
|
*/ |
|
|
|
static function colorMaxBrightness($hexColor){ |
|
|
|
static function colorMaxBrightness($hexColor,$scale){ |
|
|
|
$r = (hexdec(substr($hexColor, 1, 2))); |
|
|
|
$g = (hexdec(substr($hexColor, 3, 2))); |
|
|
|
$b = (hexdec(substr($hexColor, 5, 2))); |
|
|
@ -47,10 +47,10 @@ class MatHelper{ |
|
|
|
$MaxBrightnessPass = $value > $MaxBrightnessPass ? $value : $MaxBrightnessPass; |
|
|
|
} |
|
|
|
|
|
|
|
$scale = 255 / $MaxBrightnessPass; |
|
|
|
$r =dechex(round($r * $scale)); |
|
|
|
$g =dechex(round($g * $scale)); |
|
|
|
$b =dechex(round($b * $scale)); |
|
|
|
$gain = (255 - $MaxBrightnessPass) / 255 * $scale; |
|
|
|
$r =dechex(round($r + 255 * $gain)); |
|
|
|
$g =dechex(round($g + 255 * $gain)); |
|
|
|
$b =dechex(round($b + 255 * $gain)); |
|
|
|
|
|
|
|
return "#{$r}{$g}{$b}"; |
|
|
|
} |
|
|
@ -430,7 +430,7 @@ class MatHelper{ |
|
|
|
$matOriginal->matParams->translucencyColor |
|
|
|
)); |
|
|
|
$material->setBaseColor( self::hex2floatColor( |
|
|
|
self::colorMaxBrightness($matOriginal->matParams->translucencyColor), |
|
|
|
self::colorMaxBrightness($matOriginal->matParams->translucencyColor, $translucencyIntensity), |
|
|
|
1 - $translucencyIntensity |
|
|
|
)); |
|
|
|
// $material->setSpecular(
|
|
|
|