@galacean/engine-core 0.0.0-experimental-0.9-plus.0 → 0.0.0-experimental-0.9-plus.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +14 -1
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +14 -1
- package/dist/module.js +14 -1
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Scene.d.ts +3 -0
package/dist/miniprogram.js
CHANGED
|
@@ -15169,6 +15169,7 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15169
15169
|
_this._fogEnd = 300;
|
|
15170
15170
|
_this._fogDensity = 0.01;
|
|
15171
15171
|
_this._fogParams = new miniprogram.Vector4();
|
|
15172
|
+
_this._sunlightVector3 = new miniprogram.Vector3();
|
|
15172
15173
|
_this.name = name || "";
|
|
15173
15174
|
var shaderData = _this.shaderData;
|
|
15174
15175
|
shaderData._addRefCount(1);
|
|
@@ -15324,7 +15325,13 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15324
15325
|
lightManager._updateShaderData(this.shaderData);
|
|
15325
15326
|
var sunLightIndex = lightManager._getSunLightIndex();
|
|
15326
15327
|
if (sunLightIndex !== -1) {
|
|
15327
|
-
|
|
15328
|
+
var sunlight = lightManager._directLights.get(sunLightIndex);
|
|
15329
|
+
var sunlightColor = sunlight.color;
|
|
15330
|
+
var sunlightIntensity = sunlight.intensity;
|
|
15331
|
+
this._sunlightVector3.set(sunlightColor.r * sunlightIntensity, sunlightColor.g * sunlightIntensity, sunlightColor.b * sunlightIntensity);
|
|
15332
|
+
shaderData.setVector3(Scene._sunlightColorProperty, this._sunlightVector3);
|
|
15333
|
+
shaderData.setVector3(Scene._sunlightDirectionProperty, sunlight.direction);
|
|
15334
|
+
this._sunLight = sunlight;
|
|
15328
15335
|
}
|
|
15329
15336
|
if (this.castShadows && this._sunLight && this._sunLight.shadowType !== exports.ShadowType.None) {
|
|
15330
15337
|
shaderData.enableMacro("SHADOW_TYPE", this._sunLight.shadowType.toString());
|
|
@@ -15516,6 +15523,12 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15516
15523
|
(function() {
|
|
15517
15524
|
Scene._fogParamsProperty = Shader.getPropertyByName("oasis_FogParams");
|
|
15518
15525
|
})();
|
|
15526
|
+
(function() {
|
|
15527
|
+
Scene._sunlightColorProperty = Shader.getPropertyByName("galacean_SunlightColor");
|
|
15528
|
+
})();
|
|
15529
|
+
(function() {
|
|
15530
|
+
Scene._sunlightDirectionProperty = Shader.getPropertyByName("galacean_SunlightDirection");
|
|
15531
|
+
})();
|
|
15519
15532
|
|
|
15520
15533
|
/**
|
|
15521
15534
|
* Scene manager.
|
package/dist/module.js
CHANGED
|
@@ -15164,6 +15164,7 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15164
15164
|
_this._fogEnd = 300;
|
|
15165
15165
|
_this._fogDensity = 0.01;
|
|
15166
15166
|
_this._fogParams = new Vector4();
|
|
15167
|
+
_this._sunlightVector3 = new Vector3();
|
|
15167
15168
|
_this.name = name || "";
|
|
15168
15169
|
var shaderData = _this.shaderData;
|
|
15169
15170
|
shaderData._addRefCount(1);
|
|
@@ -15319,7 +15320,13 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15319
15320
|
lightManager._updateShaderData(this.shaderData);
|
|
15320
15321
|
var sunLightIndex = lightManager._getSunLightIndex();
|
|
15321
15322
|
if (sunLightIndex !== -1) {
|
|
15322
|
-
|
|
15323
|
+
var sunlight = lightManager._directLights.get(sunLightIndex);
|
|
15324
|
+
var sunlightColor = sunlight.color;
|
|
15325
|
+
var sunlightIntensity = sunlight.intensity;
|
|
15326
|
+
this._sunlightVector3.set(sunlightColor.r * sunlightIntensity, sunlightColor.g * sunlightIntensity, sunlightColor.b * sunlightIntensity);
|
|
15327
|
+
shaderData.setVector3(Scene._sunlightColorProperty, this._sunlightVector3);
|
|
15328
|
+
shaderData.setVector3(Scene._sunlightDirectionProperty, sunlight.direction);
|
|
15329
|
+
this._sunLight = sunlight;
|
|
15323
15330
|
}
|
|
15324
15331
|
if (this.castShadows && this._sunLight && this._sunLight.shadowType !== ShadowType.None) {
|
|
15325
15332
|
shaderData.enableMacro("SHADOW_TYPE", this._sunLight.shadowType.toString());
|
|
@@ -15511,6 +15518,12 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
|
|
|
15511
15518
|
(function() {
|
|
15512
15519
|
Scene._fogParamsProperty = Shader.getPropertyByName("oasis_FogParams");
|
|
15513
15520
|
})();
|
|
15521
|
+
(function() {
|
|
15522
|
+
Scene._sunlightColorProperty = Shader.getPropertyByName("galacean_SunlightColor");
|
|
15523
|
+
})();
|
|
15524
|
+
(function() {
|
|
15525
|
+
Scene._sunlightDirectionProperty = Shader.getPropertyByName("galacean_SunlightDirection");
|
|
15526
|
+
})();
|
|
15514
15527
|
|
|
15515
15528
|
/**
|
|
15516
15529
|
* Scene manager.
|