1 GPAC Scene Graph generator documentation - v0.4.0 2 3 Last Modified: July 2005 4 5 6 70 - Foreword 8 9 10 11The sets (MPEG4, X3D and SVG) of nodes handled by the GPAC are genrated through "Scene Generators" applications: 12 13applications/generators/MPEG4 for MPEG4 along with the official MPEG-4 template files needed to generate nodes and their encoding tables. 14 15applications/generators/X3D for X3D along with the X3D template file needed to generate nodes. 16 17applications/generators/SVG for SVG along with the SVG template. 18 19 20 21MPEG-4 Template files are numbered by versions of amendments to the MPEG-4 systems standard. 22 23X3D and SVG templates do not have versionning. 24 25 26 271 - Regenerating the scene graph 28 29 30 31First recompile the appropriated scene generator application. You don't need to recompile GPAC to recompile it. 32 33The generators DIRECTLY overwrites source code files in the GPAC distribution, you MUST NOT try to run it from a different 34 35location than gpac/applications/generators/* 36 37 38 39For MPEG-4 you must provide MPEG4Gen with the set of template files. For example, if you're planning to use only nodes defined in the 40 41first version of the standard (1998) described in templates1.txt file, just type: 42 43 44 45MPEG4Gen templates1.txt 46 47 48 49Template files MUST be fed in order, and versions cannot be skipped: you SHALL NOT try to generate version1 and version3 without version2. 50 51To generate a scene graph handling v1 to v3 of the BIFS system, type: 52 53MPEG4Gen templates1.txt templates2.txt templates3.txt 54 55 56 57For X3D, simply run X3DGen, it will automatically load the "templates_X3D.txt" file 58 59For SVG, simply run SVGGen completesvgt12rng.xml 60 61 62 63 64 652 - Customizing the scene graph 66 67 68 69As of 0.2.2, all nodes in current gpac version are supported by renderers and cannot be removed. You will therefore have to REMOVE some code in the renderers 70 71and the scene graph in order to recompile GPAC. You should therefore not try to customize the scene graph unless you know what you're doing. 72 73 74 75 2.1 - Customizing the MPEG-4 scene graph 76 77 78 79As 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. 80 81However MPEG4Gen allows you to specify which nodes should be supported or not in the scene graph. This is currently specified 82 83with a simple text file where unwanted nodes are listed one by line ('#' acting as a line comment). The file is specified by 84 85the "-p " switch 86 87 88 89For example, generating a scene graph for BIFS V1 without support for the BIFS audio nodes will be: 90 91MPEG4Gen -p skip_audio.txt templates1.txt 92 93 94 95and the content of skip_audio.txt file will be 96 97 98 99AudioBuffer 100 101AudioClip 102 103AudioDelay 104 105AudioFX 106 107AudioMix 108 109AudioSwitch 110 111AudioSource 112 113 114 115 2.2 - Customizing the X3D scene graph 116 117 118 119X3DGen uses the same mechanism as MPEG4Gen for node skinpping, eg: X3DGen skipfile 120 121 122 123 2.3 - Customizing the SVG scene graph 124 125 126 127This is undocumented and probably not supported 128 129 130 1313 - Advanced Manupulations 132 133 134 135 It is possible to develop custom templates. The resulting encoding/decoding will not be compliant with MPEG-4 BIFS but it can 136 137be interesting to see how a single-version mechanism with only the desired nodes reduces applications and bitstreams sizes 138 139To write your own templates, you must: 140 141 follow the syntax of regular templates 142 143 make sure the SFWorldNode type is defined and used by all nodes (needed for BIFS updates) 144 145 make sure at least one node will be of type SFTopNode (needed for BIFS Scene Replace command) 146 147 148 149