Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sunSource #1823

Merged
merged 8 commits into from
Nov 1, 2023
Merged

Add sunSource #1823

merged 8 commits into from
Nov 1, 2023

Conversation

zhuxudong
Copy link
Member

Please check if the PR fulfills these requirements

support #1814 and fix #1810

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

@zhuxudong zhuxudong added bug Something isn't working enhancement New feature or request labels Oct 18, 2023
@zhuxudong zhuxudong added this to the 1.2 milestone Oct 18, 2023
@zhuxudong zhuxudong self-assigned this Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Attention: 156 lines in your changes are missing coverage. Please review.

Comparison is base (e591a10) 65.09% compared to head (aa47c88) 66.83%.
Report is 31 commits behind head on dev/1.2.

❗ Current head aa47c88 differs from pull request most recent head 0f79a76. Consider uploading reports for the commit 0f79a76 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           dev/1.2    #1823      +/-   ##
===========================================
+ Coverage    65.09%   66.83%   +1.73%     
===========================================
  Files          473      472       -1     
  Lines        23750    23801      +51     
  Branches      3368     3396      +28     
===========================================
+ Hits         15461    15908     +447     
+ Misses        7094     6699     -395     
+ Partials      1195     1194       -1     
Files Coverage Δ
packages/core/src/2d/enums/SpriteModifyFlags.ts 100.00% <ø> (ø)
packages/core/src/2d/sprite/Sprite.ts 96.80% <100.00%> (+0.01%) ⬆️
packages/core/src/2d/sprite/SpriteMask.ts 87.27% <100.00%> (-0.12%) ⬇️
packages/core/src/Component.ts 94.91% <100.00%> (+0.17%) ⬆️
packages/core/src/Engine.ts 87.69% <100.00%> (+0.65%) ⬆️
packages/core/src/Entity.ts 85.58% <100.00%> (+1.27%) ⬆️
...ges/core/src/RenderPipeline/BasicRenderPipeline.ts 55.84% <100.00%> (ø)
packages/core/src/RenderPipeline/RenderQueue.ts 47.27% <100.00%> (+0.60%) ⬆️
packages/core/src/animation/Animator.ts 62.86% <ø> (-1.59%) ⬇️
packages/core/src/asset/ResourceManager.ts 60.28% <100.00%> (+0.18%) ⬆️
... and 44 more

... and 42 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

return this._shadowSource;
}

set shadowSource(light: DirectLight | null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this, just sunSource or sunLight is enough! Every light can have shadow in the future

return this._sunSource;
}

set sunSource(light: DirectLight | null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sun is OK

@@ -76,6 +78,9 @@ export class Scene extends EngineObject {
private _fogDensity: number = 0.01;
private _fogParams: Vector4 = new Vector4();
private _isActive: boolean = true;
private _sunSource: DirectLight | null;
private _shadowSource: DirectLight | null;
private _defaultSunlightDirection = new Vector3(0, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so many properties?

} else {
this._sunLight = null;
shaderData.setVector3(Scene._sunlightDirectionProperty, this._defaultSunlightDirection);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vector3._zero

@@ -63,7 +63,7 @@ export class Scene extends EngineObject {
/** @internal */
_rootEntities: Entity[] = [];
/** @internal */
_sunLight: Light;
_sunlight: DirectLight | null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this move to LightManager is better

This was linked to issues Nov 1, 2023
@GuoLei1990 GuoLei1990 merged commit 4cce4bd into galacean:dev/1.2 Nov 1, 2023
4 of 5 checks passed
zhuxudong added a commit to zhuxudong/engine that referenced this pull request Nov 7, 2023
* dev/1.2: (31 commits)
  Add sunSource (galacean#1823)
  Fix(ShaderLab): make `UsePass` directive compatible with all builtin shader names (galacean#1855)
  feat: ParticleGenerator support simulationSpeed (galacean#1854)
  fix: sprite destroy (galacean#1852)
  "v1.1.0-beta.18"
  Fix quaternion to euler bug (galacean#1851)
  Fix ColorOverLifetimeModule mode invalid bug (galacean#1850)
  fix: no autoplay when set animatorController after enable (galacean#1843)
  Refactor `glTFResource` (galacean#1831)
  Fix material destoroy bug (galacean#1847)
  Fix Sprite can't batch bug caused by material instance (galacean#1830)
  "v1.1.0-beta.17"
  fix: glTF animation parse bug (galacean#1845)
  fix: mesh decoder (galacean#1844)
  "v1.1.0-beta.16"
  Fix blendShape crossFade bug (galacean#1841)
  fix: ignore ambient in 2d template (galacean#1836)
  "v1.1.0-beta.15"
  Fix blendShapeAnimation crossFade bug (galacean#1840)
  fix: ignore case of asset url (galacean#1809)
  ...

# Conflicts:
#	packages/loader/src/gltf/parser/GLTFParserContext.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scene add sunSource Sky sunlight inActive cache bug
2 participants