Contenu connexe
Similaire à 07 Collada Overview
Similaire à 07 Collada Overview (20)
07 Collada Overview
- 1. COLLADA Overview
Mark Barnes
COLLADA Project Lead
Sony Computer Entertainment
© Copyright Khronos Group, 2006 - Page 1
- 2. COLLADA History
COLLADA was announced at SIGGRAPH 2004
and has become a Khronos standard
• Since then we have
- Formed the COLLADA work groups
- Released the 1.4 specification
- Been adopted by thousands of users (about 15% of the market)
© Copyright Khronos Group, 2006 - Page 2
- 3. What is COLLADA?
• COLLADA is a database schema for 3D assets
- COLLADA is an interchange format.
- COLLADA is an intermediate format.
- COLLADA is not a delivery format.
• COLLADA is a comprehensive format.
- COLLADA can encode visual scenes and physics scenes.
- COLLADA can contain libraries of assets.
- COLLADA can contain many types of objects.
- COLLADA is not a scene graph.
© Copyright Khronos Group, 2006 - Page 3
- 4. What is COLLADA?
• COLLADA is an open format
- COLLADA is a documented, open standard built using standard technologies: XML, UTF8,
URLs, Base64, XML Schema, etc.
- COLLADA is not a proprietary format.
• COLLADA is an open standard
- COLLADA is a standard technology of The Khronos Group industry consortium.
• COLLADA seeks to liberate your 3D assets
- COLLADA is an open, archive-grade format that retains meta information.
- When your DCC tool upgrades, you keep your assets.
© Copyright Khronos Group, 2006 - Page 4
- 5. COLLADA is your data in
motion
• COLLADA is designed to transport your content between applications
- It is the glue that binds together your DCC and 3D processing tools into a production pipeline
- It allows applications to talk with each other using the same language
- It opens up new opportunities for developers and tool makers to build on each other's strengths
without reinventing the wheel
© Copyright Khronos Group, 2006 - Page 5
- 6. COLLADA Documents
• We call them quot;documentsquot; not quot;filesquot;
- XML can be more than just files on a file system.
- XML may be the formatted result of a SQL database query.
- XML may come from an HTTP request sent to a remote server.
- XML might be a temporary output fragment from a DCC tool.
- XML could be a small subset of a large source control system, selected by quot;assets most
recently altered by Davidquot;.
• Using XML to represent structured data enables 3D tools to use the full
arsenal of modern database tools
© Copyright Khronos Group, 2006 - Page 6
- 7. Document Structure
• Every COLLADA document is expressed in XML, with
a header, <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<COLLADA>
<asset> ... </asset>
<library_geometries>
<geometry id=“Teapot”> ... </geometry>
</library_geometries>
a set of libraries, <library_visual_scenes>
<visual_scene id=“Worldquot;>
<node>
<instance_geometry url=quot;#Teapotquot;/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
and a scene. <instance_visual_scene url=quot;#Worldquot;/>
</scene>
</COLLADA>
© Copyright Khronos Group, 2006 - Page 7
- 8. Libraries
• Libraries hold and organize many types of objects
<library_animations> <library_lights>
<library_cameras> <library_materials>
<library_effects> <library_nodes>
<library_controllers> <library_rigid_bodies>
<library_geometries> <library_physics_models>
• COLLADA documents are modular containers of information
© Copyright Khronos Group, 2006 - Page 8
- 9. Assets
• Every COLLADA document is an asset and can be managed using the
meta-information
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<COLLADA>
<asset>
<contributor>
<author>John Doe</author>
<authoring_tool>Maya Collada exporter v0.7.4</authoring_tool>
</contributor>
<created>2004-12-20T03:14:58Z</created>
<modified>2004-12-20T22:10:18Z</modified>
<revision>12.3.257</revision>
<up_axis>Y_UP</up_axis>
</asset>
</COLLADA>
© Copyright Khronos Group, 2006 - Page 9
- 10. Assets
• Every COLLADA document also contains assets that can be managed
individually
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<COLLADA>
<asset> ... </asset>
<library_geometries>
<geometry id=quot;3f454bb2quot; name=quot;Teapot>quot;>
<asset>
<contributor>
<author>Jane Doe</author>
<authoring_tool>XSI COLLADA exporter v5.1</authoring_tool>
</contributor>
<created>2005-01-13T18:33:17Z</created>
<modified>2005-01-13T18:33:17Z</modified>
<revision>1.04</revision>
</asset>
</geometry>
</library_geometries>
</COLLADA>
© Copyright Khronos Group, 2006 - Page 10
- 11. Models and Geometry
• Geometry contain multiple streams of data at each vertex, indexed from
raw arrays of values
<source id=quot;revolve_Posquot;>
<float_array count=quot;1824quot;>
6.44546 2.22100 0.04451 8.94581 ...
</float_array>
</source>
<vertices id=quot;revolve-Vtxquot;>
<input semantic=quot;POSITIONquot; source=quot;#revolve-Posquot;/>
</vertices>
<polygons count=quot;720quot; material=quot;Defaultquot;>
<input semantic=quot;VERTEXquot; source=quot;#revolve-Vtxquot; offset=quot;0quot;/>
<input semantic=quot;NORMALquot; source=quot;#revolve-0-Normalquot; offset=quot;1quot;/>
<input semantic=quot;TEXCOORDquot; source=quot;#revolve-0-TexCoord0quot; offset=quot;2quot;/>
<input semantic=quot;TEXCOORDquot; source=quot;#revolve-0-TexCoord1quot; offset=quot;3quot;/>
<input semantic=quot;TANGENTquot; source=quot;#revolve-0-Tangentquot; offset=quot;5quot;/>
<p>0 0 0 0 0 0 31 1 1 1 1 1 32 2 2 2 2 2 1 3 3 3 3 3</p>
...
</polygons>
© Copyright Khronos Group, 2006 - Page 11
- 12. Scene Descriptions
• Each COLLADA <visual_scene> describes a hierarchy or scene
graph of objects in the same space
<visual_scene id=“Worldquot;>
<node id=quot;Cameraquot;>
<lookat> ... </lookat>
<instance_camera url=quot;#cameraquot;/>
</node>
<node id=quot;Lightquot; name=quot;Main_Lightquot;>
<translate>-5.0 10.0 4.0</translate>
<rotate>0 0 1 0</rotate>
<instance_light url=quot;#Lt-Lightquot;/>
<node id=quot;Teapotquot;>
<instance_node url=quot;#teapot-lod-02quot;/>
</node>
</node>
</visual_scene>
© Copyright Khronos Group, 2006 - Page 12
- 16. What’s in COLLADA 1.4?
COLLADA FX COLLADA Physics
Conformance and Reconfigurable
Standardization Production Pipelines
© Copyright Khronos Group, 2006 - Page 16
- 17. What are Shader Effects?
• Shaders are programs that run on a GPU and produce graphical effects
• Shader Effects additionally describe the environment that a shader is
designed to run within:
- Set render states (culling, blending, depth tests, etc.)
- Which shader to use in which pipeline stage.
- Which parameters are automatically set by the runtime.
- Which parameters are tweakable by users.
- How many passes are required to finish the effect.
- Which textures are used during which pass.
© Copyright Khronos Group, 2006 - Page 17
- 18. The Shader Effects
Problem
• Each platform has its own proprietary file format (or none at all) that
expresses multi-pass shader effects.
Cg CgFX effect format
HLSL .FX effect format
GLSL No effect format yet
OpenGL|ES No standard effect format
• If you are designing a multi-platform game, you have a real resource
management problem.
© Copyright Khronos Group, 2006 - Page 18
- 19. COLLADA FX
• COLLADA FX is designed to:
- Allow interchange of complex, multi-pass shader effects.
- Encapsulate multiple descriptions of an effect.
- E.g. levels of detail, daytime/nighttime versions, etc.
- Encode shaders for multiple platforms in one file.
- e.g. CG and GLSL versions of your effect in one document.
- Supports both fixed-function and programmable-pipeline effects in the same format.
© Copyright Khronos Group, 2006 - Page 19
- 20. COLLADA FX
• Additional features:
- COLLADA FX can be coded as stand-alone COLLADA documents.
- Each document can contain all the elements of an effect inline.
- COLLADA FX supports advanced shader language techniques.
- Use Interface objects and declare Unsized Arrays.
- Multiple Render Targets and off-screen buffers.
- Share simple parameters across all platforms
- Control multiple platforms or techniques with a single parameter.
- Share source code between multiple techniques.
- All elements can be annotated with meta-information
© Copyright Khronos Group, 2006 - Page 20
- 21. How COLLADA FX works
• COLLADA FX does not attempt to
create a single set of render states <effect id=quot;MossyRockEffectquot;>
or an intermediate shader language <profile_GLSL id=“GLSL_medium_LOD”>
...
</profile_GLSL>
- Platform specific elements allow access to
<profile_CG id=quot;CG_with_lightingquot;>
the full set of data types and render states ...
for that platform </profile_CG>
</effect>
- COLLADA FX assumes the use of a Run-
time API that holds state
- COLLADA FX does not require that a run-
time supports a scripting interpreter
© Copyright Khronos Group, 2006 - Page 21
- 22. Techniques and Passes
• COLLADA FX files are organized <effect id=quot;Level3-spaceship-damaged quot;>
into techniques and passes. <profile_GLSL id=quot;high-LOD-shadowsquot;>
<technique sid=“Multipass1”>
<code> ... </code>
<pass sid=quot;shadow-passquot;>
...
</pass>
<pass sid=quot;specular-reflectionquot;>
...
</pass>
</technique>
</profile_GLSL>
</effect>
© Copyright Khronos Group, 2006 - Page 22
- 23. Passes
• Each pass sets render states and <pass sid=quot;pass0quot;>
declares as many programmable <shader stage=quot;VERTEXquot;>
pipeline stages as your platform <compiler_target>vs_2_x</compiler_target>
<name>vertex_function</name>
supports </shader>
<depth_test_enable> TRUE </depth_test_enable>
• Uniform shader inputs can be <depth_func> LEQUAL </depth_func>
<cull_face> BACK </cull_face>
bound to variables or literal values
<shader stage=quot;FRAGMENTquot;>
<compiler_target>ps_2_x</compiler_target>
• Profiles without programmable <name>pixel_function</name>
<bind symbol=quot;damagequot;>
shaders can only set render states <param ref=quot;damage_amountquot;/>
</bind>
</shader>
• Render states can be set by literal
values or by reading a parameter </pass>
© Copyright Khronos Group, 2006 - Page 23
- 24. Parameters
<effect id=quot;ThinFilm2quot;>
<profile_CG>
• Parameters declared within
source code can be given values
<include sid=“thin1” url=quot;#thinfilm_codequot;/>
using <setparam>
<technique sid=“Thin1”>
<annotate name=quot;UINamequot;>
<string>Light Pos 1</string> • Parameters can have multiple
</annotate> annotations. COLLADA FX does
<annotate name=quot;Objectquot;>
<string>PointLight</string> not interpret these annotations in
</annotate>
<annotate name=quot;Spacequot;>
any way
<string>World</string>
</annotate>
<setparam ref=quot;LightPosP1quot;>
• Parameters can be created from
<float3> 10.0 10.0 10.0 </float3> data types defined in source
</setparam>
code using <newparam>
...
© Copyright Khronos Group, 2006 - Page 24
- 25. Render to Texture
• COLLADA FX supports Multiple Render Targets using indexed output
<surface> objects that can persist between passes in an effect.
<pass sid=quot;pass0quot;>
<color_target index=quot;0quot;> color_surface </color_target>
<color_target index=quot;1quot;> normal_surface </color_target>
<depth_target> depth_stencil_surface </depth_target>
<stencil_target> depth_stencil_surface </stencil_target>
<clear_color index=quot;0quot;> 0 0 0 </clear_color>
<clear_color index=quot;1quot;> 0 0 0 </clear_color>
<clear_depth> 1.0 </clear_depth>
<clear_stencil> 128 </clear_stencil>
<draw>SCENE</draw>
...
</pass>
© Copyright Khronos Group, 2006 - Page 25
- 26. Advanced Shaders
• Cg style variable-length arrays and interface objects are supported by
COLLADA FX
- Structures and Interfaces are instanced as parameters of type <usertype>
- Structures can be initialized by leaf-node order or by element name.
- Array types can be given a size at creation time or by setting the array length using
<setparam>.
- After creation and setting up, these dynamically created parameters can be bound to uniform
inputs, as usual, using <bind>.
© Copyright Khronos Group, 2006 - Page 26
- 27. The COLLADA FX
Schema
The schema is designed to be flexible
and expressive – with clear ways to
declare and implement effects.
There are clear, one-to-one mappings
between a validating XML document
and a sequence of calls in each shader
runtime.
© Copyright Khronos Group, 2006 - Page 27
- 28. Development Roadmap
2006
18 January COLLADA v1.4.0 specification released.
March COLLADA has strong presence at GDC.
24 April Khronos work group meets in Tokyo.
30 June COLLADA v1.4.1 schema update.
1 August COLLADA at SIGGRAPH.
1 September COLLADA at Eurographics.
23 October Khronos work group meets in Cambridge, UK.
Q4 2006 COLLADA Conformance Test Suite.
Q1 2007 COLLADA 1.4.2 schema update.
© Copyright Khronos Group, 2006 - Page 28
- 29. Summary
COLLADA is an open standard for the
interactive entertainment industry
• Academic Researchers, please investigate COLLADA!
- Collaborative, many open source projects including:
- COLLADA plug-in for Maya - http://sourceforge.net/projects/colladamaya
- COLLADA DOM - http://sourceforge.net/projects/collada-dom
- COLLADA plug-in for Blender - http://sourceforge.net/projects/colladablender
- COLLADA plug-in for OpenSceneGraph - http://sourceforge.net/projects/osgdb-collada
- Make tools and extend the standard.
• Read the documentation and visit the Khronos website at:
http://khronos.org/collada
• Join Khronos, join a working group and help define the standard.
© Copyright Khronos Group, 2006 - Page 29