Archive for the ‘shadow mesh’ tag

Rambling Thoughts on a Renderable Class

without comments

I’m using this blog post as a brain dump of thoughts on future work for LxEngine…

Instance

After the material system refactoring, it seems that the Instance class may need a more complex encapsulating class.

The Instance class currently contains a set of data about one logical “instance” of geometry in the scene. It must contain a shared pointer to the actual geometry to render. It then can optionally contain a shared pointer to a material, transformation, camera, light set, and bounding box information; if any of these items is missing, it simply uses a reasonable default (i.e. default material for the pass, identity transformation, scene camera, scene light set, infinite bounds, etc.), but this easily allows per-entity information to be specified.

Renderable

The Renderable would be a encapsulating class of Instance. In its simplest form, a Renderable would contain just an Instance. Nothing special.

However, the Renderable might have the ability to store a set of Instances. For example, an entity might want to use a simplified mesh for shadow rendering versus a higher-res mesh for display. The Renderable would contain a “cache” of instances which might store different Instances for different circumstances. (Or maybe just a cache of different Geometry objects?). Similarly, it might be have a spot to store dynamically generated LODs.

It might also contain a JSON object of “rendering properties.” These would be not strictly typed properties that might vary from application to application. For example, “shadows : { cast : true, receive : false }” might be a valid property. This would only make sense to an application supporting shadows – so it is not part of the core rendering system, but it does have a logic place on the Renderable.

The long and short of it would be that Renderable would be a dynamic, extensive class that allows for different Instances and configurations dependent on the rendering circumstances. The Renderable would interact with the “higher-level” rendering algorithm (LOD, rendering pass, etc.) while the Instance would describe the specific what-needs-to-be-rendered-now data.

Written by arthur

March 24th, 2012 at 8:44 pm