-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
multi-env-map #265
Conversation
added equirectangular support for skybox!
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.
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]; | ||
} | ||
} |
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'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', { |
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.
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'}, |
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.
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.
Any word on the status of this? |
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 |
added equirectangular support for skybox!
issue #256