@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 CHANGED
@@ -15168,6 +15168,7 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
15168
15168
  _this._fogEnd = 300;
15169
15169
  _this._fogDensity = 0.01;
15170
15170
  _this._fogParams = new engineMath.Vector4();
15171
+ _this._sunlightVector3 = new engineMath.Vector3();
15171
15172
  _this.name = name || "";
15172
15173
  var shaderData = _this.shaderData;
15173
15174
  shaderData._addRefCount(1);
@@ -15323,7 +15324,13 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
15323
15324
  lightManager._updateShaderData(this.shaderData);
15324
15325
  var sunLightIndex = lightManager._getSunLightIndex();
15325
15326
  if (sunLightIndex !== -1) {
15326
- this._sunLight = lightManager._directLights.get(sunLightIndex);
15327
+ var sunlight = lightManager._directLights.get(sunLightIndex);
15328
+ var sunlightColor = sunlight.color;
15329
+ var sunlightIntensity = sunlight.intensity;
15330
+ this._sunlightVector3.set(sunlightColor.r * sunlightIntensity, sunlightColor.g * sunlightIntensity, sunlightColor.b * sunlightIntensity);
15331
+ shaderData.setVector3(Scene._sunlightColorProperty, this._sunlightVector3);
15332
+ shaderData.setVector3(Scene._sunlightDirectionProperty, sunlight.direction);
15333
+ this._sunLight = sunlight;
15327
15334
  }
15328
15335
  if (this.castShadows && this._sunLight && this._sunLight.shadowType !== exports.ShadowType.None) {
15329
15336
  shaderData.enableMacro("SHADOW_TYPE", this._sunLight.shadowType.toString());
@@ -15515,6 +15522,12 @@ var TextRenderElement = /*#__PURE__*/ function(RenderElement) {
15515
15522
  (function() {
15516
15523
  Scene._fogParamsProperty = Shader.getPropertyByName("oasis_FogParams");
15517
15524
  })();
15525
+ (function() {
15526
+ Scene._sunlightColorProperty = Shader.getPropertyByName("galacean_SunlightColor");
15527
+ })();
15528
+ (function() {
15529
+ Scene._sunlightDirectionProperty = Shader.getPropertyByName("galacean_SunlightDirection");
15530
+ })();
15518
15531
 
15519
15532
  /**
15520
15533
  * Scene manager.