Skip to content

API Changes 7 Sep 2017

Lindsay Kay edited this page Sep 8, 2017 · 19 revisions

Oh no, more API changes! But not big ones.

In case you need the previous version of xeogl, I've tagged a pre-release here: https://github.com/xeolabs/xeogl/releases/tag/v0.5

Removed Components

I've removed these component classes and moved their properties into xeogl.Entity:

  • xeogl.Modes
  • xeogl.Visibility
  • xeogl.Cull
  • xeogl.Stationary
  • xeogl.Billboard
  • xeogl.Layer

My rationale is that its usually more useful for each Entity to have its own separate copy of this sort of state, rather than share it with other Entities via these components.

When sharing components, we never really knew if, for example, a Visibility attached to a target Entity is also attached to other Entities as well, and that updating it will inadvertently show or hide those Entities.

Upgraded to glTF 2

I finally rewrote the glTF parser to load glTF 2. It loads just what xeogl needs for visualizing static models:

Try a demo!

Better Materials Transparency

While upgrading glTF support, I also improved the way materials specify transparency.

I took some cues from the glTF 2 spec and made these changes to xeogl.MetallicMaterial, xeogl.SpecularMaterial and xeogl.PhongMaterial:

  • renamed opacity to alpha,
  • added alphaMode, which gets a value of either "opaque", "blend" or "mask" to indicate how alpha is treated, and
  • added alphaCutoff, which specifies the alpha threshold for "mask".

The alphaMode property now does what the xeogl.Modes transparent property used to do, where it enables transparency when its value is not "opaque".

Check out the API docs of those components for more info.

TODO

glTF-related things to do:

  • Load completion on GLTFModel is firing a little too early - entities are not properly created until the next engine "tick". Need to track loading progress more cleanly.
  • Make the image based lighting way better (eg. more precision, hemispherical lights?)
  • Correct gamma and maybe tone mapping in shader?
  • Support binary for glTF delivery
  • Support compressed textures?