-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Add sunSource #1823
Conversation
Codecov ReportAttention:
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
☔ View full report in Codecov by Sentry. |
packages/core/src/Scene.ts
Outdated
return this._shadowSource; | ||
} | ||
|
||
set shadowSource(light: DirectLight | null) { |
There was a problem hiding this comment.
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
packages/core/src/Scene.ts
Outdated
return this._sunSource; | ||
} | ||
|
||
set sunSource(light: DirectLight | null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sun
is OK
packages/core/src/Scene.ts
Outdated
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so many properties?
packages/core/src/Scene.ts
Outdated
} else { | ||
this._sunLight = null; | ||
shaderData.setVector3(Scene._sunlightDirectionProperty, this._defaultSunlightDirection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vector3._zero
packages/core/src/Scene.ts
Outdated
@@ -63,7 +63,7 @@ export class Scene extends EngineObject { | |||
/** @internal */ | |||
_rootEntities: Entity[] = []; | |||
/** @internal */ | |||
_sunLight: Light; | |||
_sunlight: DirectLight | null; |
There was a problem hiding this comment.
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
* 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
Please check if the PR fulfills these requirements
support #1814 and fix #1810
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: