-
Notifications
You must be signed in to change notification settings - Fork 8
Collada
You can try out by fetching ‘collada’ branch.
- Extensions to SC language to allow
- Parser for DAE files
- Ability to cross-reference library elements (geometries, nodes, materials, …)
There are 2 way you can use COLLADA data with Sunflow. One is to include geometry from DAE file in your SC.
Another is to provide Sunflow with DAE file on command line. This is the preferred way of rendering COLLADA.
Parser picks instance of <visual_scene> from the main <scene> element. Optionally, it could be nice to have command line switch to choose which visual scene and which camera to render.
You can specify image settings and background color (shader later) by providing <extra> element in you visual scene.
...
<library_visual_scenes>
<visual_scene id="VisualSceneNode" name="Mansion">
<extra>
<technique sid="sunflow">
<background>
<color>1.0 1.0 1.0</color>
</ background>
<image>
<resolution>800 600</resolution>
<aa>0 2</aa>
<filter>gaussian</ filter>
</ image>
</ technique>
</ extra>
<node id="Camera" name="Camera">
sorry for XML formatting, github cannot handle XMLs in wiki
It supports following Sunflow properties (specified as XML elements with same names): resolution, sampler, samples, contrast, jitter, cache, filter
…it’s there.
Parser will pick up first camera from main scene. Sunflow’s thinlens camera is supported through core COLLADA’s <zfar> and <znear> elements (in camera).
You can instantiate geometry by defining object with ‘collada’ as a type:
object {
shader orange
type collada
name Fruity
filename path/to.dae
id id-of-collada-geometry
}
Currently this imports only from COLLADA’s <triangles>1 element. You have to specify an ID of <geometry>1
1 As explained in COLLADA 1.4.1 spec link
[collada_spec]http://www.khronos.org/files/collada_spec_1_4.pdf