star_mod_renderer
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -88,2 +88,4 @@ import * as THREE from 'three'; | ||
export const DIRECTION_LIGHT_COLOR = '#c2c2c2'; | ||
export const DIRECTION_LIGHT_INTENSITY = 0.6; | ||
export const AMBIENT_LIGHT_INTENSITY = 0.4; | ||
@@ -90,0 +92,0 @@ |
@@ -138,6 +138,9 @@ import * as THREE from 'three'; | ||
material.aoMap = texture.ormeTexture; // r | ||
material.roughnessMap = texture.ormeTexture; // b | ||
material.metalnessMap = texture.ormeTexture; // g | ||
material.roughnessMap = texture.ormeTexture; // g | ||
material.metalnessMap = texture.ormeTexture; // b | ||
// TODO: 扩充 material 字段 emissiveIntensityMap 字段,增加渲染公式与对应逻辑获取 | ||
material.emissiveMap = texture.ormeTexture; // a | ||
} | ||
// 混合自发光贴图 | ||
if (texture.emissiveTexture) { | ||
@@ -144,0 +147,0 @@ material.emissive = new THREE.Color(0xffffff); |
{ | ||
"name": "star_mod_renderer", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "star mod project render auxiliary ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,3 +6,3 @@ import * as THREE from "three"; | ||
import { ViewHelper } from 'three/examples/jsm/helpers/ViewHelper.js'; | ||
import { SCENE_BACKGROUND_COLOR, AMBIENT_LIGHT_COLOR, DIRECTION_LIGHT_COLOR } from './default.js'; | ||
import { SCENE_BACKGROUND_COLOR, AMBIENT_LIGHT_COLOR, DIRECTION_LIGHT_COLOR, DIRECTION_LIGHT_INTENSITY, AMBIENT_LIGHT_INTENSITY } from './default.js'; | ||
@@ -18,2 +18,3 @@ export class RenderBase { | ||
ambientLight = null; | ||
hemisphereLight = null; | ||
directionalLights = []; | ||
@@ -181,9 +182,11 @@ signals = null; | ||
// 临时 | ||
this.ambientLight = new THREE.AmbientLight(AMBIENT_LIGHT_COLOR, 0.6); | ||
this.ambientLight = new THREE.AmbientLight(AMBIENT_LIGHT_COLOR, AMBIENT_LIGHT_INTENSITY); | ||
this.hemisphereLight = new THREE.HemisphereLight(AMBIENT_LIGHT_COLOR, AMBIENT_LIGHT_COLOR, 0.2); | ||
this.directionalLights = [ | ||
new THREE.DirectionalLight(DIRECTION_LIGHT_COLOR, 0.7), | ||
new THREE.DirectionalLight(DIRECTION_LIGHT_COLOR, 0.7), | ||
new THREE.DirectionalLight(DIRECTION_LIGHT_COLOR, 0.7) | ||
new THREE.DirectionalLight(DIRECTION_LIGHT_COLOR, DIRECTION_LIGHT_INTENSITY), | ||
new THREE.DirectionalLight(DIRECTION_LIGHT_COLOR, DIRECTION_LIGHT_INTENSITY), | ||
new THREE.DirectionalLight(DIRECTION_LIGHT_COLOR, DIRECTION_LIGHT_INTENSITY) | ||
]; | ||
this.addModel(this.ambientLight); | ||
this.addModel(this.hemisphereLight); | ||
this.directionalLights.forEach(item => { | ||
@@ -197,2 +200,3 @@ this.addModel(item); | ||
this.ambientLight.color.set(color); | ||
this.hemisphereLight.color.set(color); | ||
} | ||
@@ -199,0 +203,0 @@ |
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
276252
7416