-
-
Notifications
You must be signed in to change notification settings - Fork 0
Re-add castShadow property to light components and default to false #7559
Conversation
fix useEffects for direction and point light castShadow
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.
Is there a reason we can't use a ShadowComponent with cast set to false? That was the intention of removing the property previously
@@ -11,6 +11,19 @@ import { ObjectLayers } from '../constants/ObjectLayers' | |||
import { setObjectLayers } from '../functions/setObjectLayers' | |||
import { addObjectToGroup, removeObjectFromGroup } from './GroupComponent' | |||
|
|||
export type PointLightComponentType = { |
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.
We can use ComponentType<typeof PointLightComponent>
for these types
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.
Why not put the castShadow property with all of the other shadow properties that are in the light components?
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.
Also, the lights need different default values for castShadow than meshes and whatnot (lights false, meshes true)
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.
Why not put the castShadow property with all of the other shadow properties that are in the light components?
That's a good point, in this case we should remove remove castShadow from ShadowComponent and turn it into a tag component
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.
@HexaField what about receiving shadows? You want a tag component for casting and receiving each?
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.
Sorry, yes, I mean put castShadow on light components, and have receiveShadow be set only via the presence of a tag ShadowComponent
For performance reasons we want to have lights not cast shadows by default