		GPAC Scene Graph generator documentation - v0.2.0
			Last Modified: September 2004

0 - Foreword

The set of nodes (MPEG-4/VRML) handled by the GPAC scene graph can be changed almost at will (there may be one or two nodes so vital
that things won't recompile, hopefully not). 
The scene graph generator application is called SGGen and is located in:
	gpac/Applications/SGGen

along with the official MPEG-4 template files needed to generate nodes and their encoding tables.

Template files are numbered by versions of amendments to the MPEG-4 systems standard. 


1 - Regenerating the scene graph

First recompile the SGGen application. You don't need to recompile GPAC to recompile it.
SGGen DIRECTLY overwrites source code files in the GPAC distribution, you MUST NOT try to run it from a different 
location than gpac/Applications/SGGen

Then you must provide SGGen with the set of template files. For example, if you're planning to use only nodes defined in the 
first version of the standard (1998) described in templates1.txt file, just type:

SGGen templates1.txt

Template files MUST be fed in order, and versions cannot be skipped: you SHALL NOT try to generate version1 and version3 without version2. 
To generate a scene graph handling v1 to v3 of the BIFS system, type:
SGGen templates1.txt templates2.txt templates3.txt


2 - Customizing the scene graph

As said above, it is not possible to skip a BIFS version when regenerating the scene graph since this will break binary encoding of the nodes.
However SGGen allows you to specify which nodes should be supported or not in the scene graph. This is currently specified
with a simple text file where unwanted nodes are listed one by line ('#' acting as a line comment). The file is specified by
the "-p " switch

For example, generating a scene graph for BIFS V1 without support for the BIFS audio nodes will be:
SGGen -p skip_audio.txt templates1.txt

and the content of skip_audio.txt file will be

AudioBuffer
AudioClip
AudioDelay
AudioFX
AudioMix
AudioSwitch
AudioSource


All code related to nodes in the renderer is #def'ed out when a node is not defined (or should be :)
The "skip.txt" file present in gpac/Applications/SGGen is the file used to generate the scene graph present in the current gpac distribution.
As of 0.2.0, this file includes all MPEG-4 nodes except v5 nodes (eg AFX).


3 - Advanced Manupulations

	It is possible to develop custom templates. The resulting encoding/decoding will not be compliant with MPEG-4 BIFS but it can
be interesting to see how a single-version mechanism with only the desired nodes reduces applications and bitstreams sizes
To write your own templates, you must:
	follow the syntax of regular templates
	make sure the SFWorldNode type is defined and used by all nodes (needed for BIFS updates)
	make sure at least one node will be of type SFTopNode (needed for BIFS Scene Replace command)

