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 AmbientLights to bitecs #5918

Merged
merged 1 commit into from
Feb 3, 2023
Merged

Add AmbientLights to bitecs #5918

merged 1 commit into from
Feb 3, 2023

Conversation

takahirox
Copy link
Contributor

This PR adds AmbientLights to bitecs in the same way as DirectionalLight.

Copy link
Contributor

@netpro2k netpro2k left a comment

Choose a reason for hiding this comment

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

Don't feel super strong since I want to deprecate light components, but we should probably carry forward the defaults. Otherwise, LGTM

@@ -47,6 +47,7 @@ export const AEntity = defineComponent();
export const Object3DTag = defineComponent();
export const GLTFModel = defineComponent();
export const LightTag = defineComponent();
export const AmbientLight = defineComponent();
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to call this AmbientLightTag just to avoid ambiguity and having to rename when importing AmbientLight from Three.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks

intensity: number;
};

export function inflateAmbientLight(world: HubsWorld, eid: number, params: AmbientLightParams) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the aframe component we have default values. We probably want to preserve those. https://github.com/mozilla/hubs/blob/master/src/components/ambient-light.js#L3-L4

We can do this easily with Object.assign() like https://github.com/mozilla/hubs/blob/master/src/inflators/simple-water.ts#L34

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks

@takahirox
Copy link
Contributor Author

I want to deprecate light components

Deprecate light components and encourage glTF lights extension instead? If so, yes I absolutely agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants