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

multi-env-map #265

Closed
wants to merge 1 commit into from
Closed

multi-env-map #265

wants to merge 1 commit into from

Conversation

spencercap
Copy link

added equirectangular support for skybox!

issue #256

added equirectangular support for skybox!
Copy link
Collaborator

@donmccurdy donmccurdy left a comment

Choose a reason for hiding this comment

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

This looks great, thanks! Just a few comments. And, feel free to include an @author line at the top of the file if you'd like. :)

} else {
return [material];
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm only aware of two possibilities here, and would expect this to be enough:

return Array.isArray( material ) ? material : [ material ];

Do you know of situations where a mesh might not have a material, or where material.materials might come from?

* Specifies an envMap on an entity, without replacing any existing material
* properties.
*/
AFRAME.registerComponent('multi-env-map', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's just name this env-map, and then we can remove the other component. :)

path: {default: ''},
extension: {default: 'jpg', oneOf: ['jpg', 'png']},
type: {default: 'cube', oneOf: ['cube', 'equirectangular']},
fileName: {default: 'equirectangular'},
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you don't mind, let's condense all of this into one property:

src: {default: []}

... where the cube type would require six (complete) URLs in set order, and the equirectangular type would require exactly one:

<a-entity env-map="src: env/posx.png, env/negx.png, env/posy.png, ..." />

I think that will be simpler overall.

@donmccurdy donmccurdy modified the milestone: 4.3.0 Nov 20, 2018
@dsinni
Copy link
Contributor

dsinni commented Mar 1, 2019

Any word on the status of this?

@donmccurdy
Copy link
Collaborator

The feedback would need to be resolved before I can merge this, and three.js's environment setup has changed a bit in the past year too: the scene.environment is much easier to work with than assigning individual env maps to materials. I'm going to close this for now, but open to suggestions for addressing #256 in the future.

@donmccurdy donmccurdy closed this Apr 26, 2020
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.

3 participants