#188 new
lindsay.kay (at xeolabs)

Optimisations

Reported by lindsay.kay (at xeolabs) | October 30th, 2010 @ 12:53 AM

Optimise Events Between Modules

Currently SceneJS is designed a bit defensively in terms of extensibility. When a geometry node is rendered, it

  1. fires an event to export itself,
  2. the renderer module collects that, then fires an event to announce geometry is rendering
  3. various modules (like modules for material, texture, model transform) respond by firing export events (unless they have already exported up to date state for the last geometry)
  4. rendering module collects those, then builds a hashcode, finds the right shader from that hash
  5. adds geometry to display list, linked to currently exported nodes

Then when traversal done, SceneJS sorts and renders the display list.

There's a lot of event creation going on in there for rendering a geometry, which involves looking up listeners, creating param objects etc. That should be replaced by callbacks, where each (texture, material etc) module should register a callback directly on the renderer module through which the latter can just directly pull state.

Reduce Getters and Setters on Node Classes

Since the JavaScript API is deprecated, the way is clear to make that inner JS workings more functionally-oriented. Since we now have them encapsulated behind JSON we can relax the design of the node classes and do things like expose a lot of their state as property members instead of through getter and setter methods.

Memoize Scene State Hashes

Compute the hashcodes for nodes like material, geometry etc. within their modules. Retain those hash codes and only re-compute them when attributes change.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.

Shared Ticket Bins

People watching this ticket

Pages