star_mod_renderer
Advanced tools
Comparing version 1.0.26 to 1.0.27
@@ -63,2 +63,6 @@ import * as THREE from 'star_mod_custom_three'; | ||
export const newEnvMapMenu = { | ||
a: 'https://westar-cdn-source-1258344700.cos.ap-nanjing.myqcloud.com/mod/modOfficial/1686570043_a_sky.png' | ||
} | ||
export function getEnvMapByName(name, env) { | ||
@@ -65,0 +69,0 @@ if (!envMapMenu[name]) { |
@@ -125,2 +125,41 @@ import * as THREE from 'star_mod_custom_three'; | ||
updateModelMaterialType(channel, type) { | ||
this.model.traverse(child => { | ||
if (child.material) { | ||
// 玻璃材质特殊处理 | ||
if (type === 4) { | ||
if (Array.isArray(child.material)) { | ||
child.material[channel] = new THREE.MeshPhysicalMaterial({ | ||
transmission: 0.8, | ||
opacity: 1, | ||
metalness: 0, | ||
roughness: 0, | ||
ior: 1.5, | ||
thickness: 0, | ||
specularIntensity: 1, | ||
specularColor: new THREE.Color(0xffffff), | ||
reflectivity: 0.5, | ||
color: new THREE.Color(0xffffff), | ||
}); | ||
child.material[channel].needsUpdate = true; | ||
} else { | ||
child.material = new THREE.MeshPhysicalMaterial({ | ||
transmission: 0.8, | ||
opacity: 1, | ||
metalness: 0, | ||
roughness: 0, | ||
ior: 1.5, | ||
thickness: 0, | ||
specularIntensity: 1, | ||
specularColor: new THREE.Color(0xffffff), | ||
reflectivity: 0.5, | ||
color: new THREE.Color(0xffffff), | ||
}); | ||
child.material.needsUpdate = true; | ||
} | ||
} | ||
} | ||
}) | ||
} | ||
updateModelMaterialTexture(channel, texture) { | ||
@@ -165,2 +204,9 @@ this.model.traverse(child => { | ||
const material = Array.isArray(child.material) ? child.material[channel] : child.material; | ||
if (material.isMeshPhysicalMaterial) { | ||
if (param.color) { | ||
material.color = new THREE.Color(param.color); | ||
material.needsUpdate = true; | ||
} | ||
return; | ||
} | ||
if (param.renderBlendMode === 0) { | ||
@@ -215,2 +261,5 @@ material.alphaMap = null; | ||
child.material.envMap = envMap; | ||
if (child.material.isMeshPhysicalMaterial) { | ||
// child.material.transmissionMap = envMap; | ||
} | ||
child.material.needsUpdate = true; | ||
@@ -217,0 +266,0 @@ } |
{ | ||
"name": "star_mod_renderer", | ||
"version": "1.0.26", | ||
"version": "1.0.27", | ||
"description": "star mod project render auxiliary ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
272943
7475