Skip to content
lachsen edited this page Feb 27, 2014 · 2 revisions

Old Syntax

Instancing in main document

<group style="transform: scale3d(...)" >
  <group style="transform: ...">
    <multimesh src="res/houses.xml#house1" style="transform: ..." />
    <multimesh src="res/houses.xml#house2" style="transform: ..." />
    <multimesh src="res/houses.xml#house3" style="transform: ..." />
  </group>
  <multimesh src="res/houses.xml#house4" style="transform: ..." />
  <transform id="t_player" >
  <group transform="#t_player" >
    <multimesh src="res/player.xml#skinned" >
      <subdata name="base" >
        <float name="animKey" >0.12</float>
      </subdata>
    </multimesh>
  </group>
</group>

Static Geometry

<datalist id="housedatalist" >
  <subdata name="roof" meshtype="triangles" shader="#roofShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </subdata>
  <subdata name="front" meshtype="triangles" shader="#frontShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </subdata>
  <subdata name="right" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </subdata>
  <subdata name="left" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </subdata>
  <subdata name="back" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </subdata>
</datalist>

Dynamic Geometry

<datalist id="sniperdatalist" >
  <subdata name="base">
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float2 name="texcoord" >...</float2>
    ...
  </subdata >
  <subdata name="head" includes="base" meshtype="triangles" shader="#headShader" >
    <int name="index" >...</int> 
  </subdata>
  <subdata name="eyeball_r" includes="base" meshtype="triangles" shader="#eyeShader" >
    <int name="index" >...</int> 
  </subdata>
  <subdata name="eyeball_l" includes="base" meshtype="triangles" shader="#eyeShader" >
    <int name="index" >...</int> 
  </subdata>
  <subdata name="body" includes="base" meshtype="triangles" shader="#bodyShader" >
    <int name="index" >...</int> 
  </subdata>
  <subdata name="lens" includes="base" meshtype="triangles" shader="#lensShader" >
    <int name="index" >...</int> 
  </subdata>
  <subdata name="lens" includes="base" meshtype="triangles" shader="#lensShader" >
    <int name="index" >...</int> 
  </subdata>
</datalist>

<!-- With embedded skinning -->
<datalist id="sniperSkinned" src="#sniperdatalist" >
  <subdata name="base" compute="dataflow['#skinning']" >
    <data src="#someAnimationData" />
    <float name="animKey">0.0</float>
  </subdata>
</datalist >

Proposal <object3d>, <objectdata>, <submesh> and <subdata>

Instancing in main document

<group style="transform: scale3d(...)" >
  <group style="transform: ...">
    <object3d src="res/houses.xml#house1" style="transform: ..." />
    <object3d src="res/houses.xml#house2" style="transform: ..." />
    <object3d src="res/houses.xml#house3" style="transform: ..." />
  </group>
  <object3d src="res/houses.xml#house4" style="transform: ..." />
  <transform id="t_player" >
  <group transform="#t_player" >
    <object3d src="res/player.xml#skinned" >
      <subdata name="base" >
        <float name="animKey" >0.12</float>
      </subdata>
    </object3d>
  </group>
</group>

Static Geometry

<objectdata id="houseobjectdata" >
  <submesh name="roof" meshtype="triangles" shader="#roofShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </submesh>
  <submesh name="front" meshtype="triangles" shader="#frontShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </submesh>
  <submesh name="right" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </submesh>
  <submesh name="left" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </submesh>
  <submesh name="back" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </submesh>
</objectdata>

Dynamic Geometry

<objectdata id="sniperobjectdata" >
  <subdata name="base">
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float2 name="texcoord" >...</float2>
    ...
  </subdata >
  <submesh name="head" includes="base" meshtype="triangles" shader="#headShader" >
    <int name="index" >...</int> 
  </submesh>
  <submesh name="eyeball_r" includes="base" meshtype="triangles" shader="#eyeShader" >
    <int name="index" >...</int> 
  </submesh>
  <submesh name="eyeball_l" includes="base" meshtype="triangles" shader="#eyeShader" >
    <int name="index" >...</int> 
  </submesh>
  <submesh name="body" includes="base" meshtype="triangles" shader="#bodyShader" >
    <int name="index" >...</int> 
  </submesh>
  <submesh name="lens" includes="base" meshtype="triangles" shader="#lensShader" >
    <int name="index" >...</int> 
  </submesh>
  <submesh name="lens" includes="base" meshtype="triangles" shader="#lensShader" >
    <int name="index" >...</int> 
  </submesh>
</objectdata>

<!-- With embedded skinning -->
<objectdata id="sniperSkinned" src="#sniperobjectdata" >
  <subdata name="base" compute="dataflow['#skinning']" >
    <data src="#someAnimationData" />
    <float name="animKey">0.0</float>
  </subdata>
</objectdata >

Proposal <object3d>, <asset> and <assetdata>

Instancing in main document

<group style="transform: scale3d(...)" >
  <group style="transform: ...">
    <object3d src="res/houses.xml#house1" style="transform: ..." />
    <object3d src="res/houses.xml#house2" style="transform: ..." />
    <object3d src="res/houses.xml#house3" style="transform: ..." />
  </group>
  <object3d src="res/houses.xml#house4" style="transform: ..." />
  <transform id="t_player" >
  <group transform="#t_player" >
    <object3d src="res/player.xml#skinned" >
      <assetdata name="base" >
        <float name="animKey" >0.12</float>
      </assetdata>
    </object3d>
  </group>
</group>

Static Geometry

<asset id="houseasset" >
  <assetdata name="roof" meshtype="triangles" shader="#roofShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </assetdata>
  <assetdata name="front" meshtype="triangles" shader="#frontShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </assetdata>
  <assetdata name="right" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </assetdata>
  <assetdata name="left" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </assetdata>
  <assetdata name="back" meshtype="triangles" shader="#wallShader" >
    <int name="index" >...</int>
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float4x4 name="transform">...</float4x4>
  </assetdata>
</asset>

Dynamic Geometry

<asset id="sniperasset" >
  <assetdata name="base">
    <float3 name="position" >...</float3>
    <float3 name="normal" >...</float3>
    <float2 name="texcoord" >...</float2>
    ...
  </assetdata >
  <assetdata name="head" includes="base" meshtype="triangles" shader="#headShader" >
    <int name="index" >...</int> 
  </assetdata>
  <assetdata name="eyeball_r" includes="base" meshtype="triangles" shader="#eyeShader" >
    <int name="index" >...</int> 
  </assetdata>
  <assetdata name="eyeball_l" includes="base" meshtype="triangles" shader="#eyeShader" >
    <int name="index" >...</int> 
  </assetdata>
  <assetdata name="body" includes="base" meshtype="triangles" shader="#bodyShader" >
    <int name="index" >...</int> 
  </assetdata>
  <assetdata name="lens" includes="base" meshtype="triangles" shader="#lensShader" >
    <int name="index" >...</int> 
  </assetdata>
  <assetdata name="lens" includes="base" meshtype="triangles" shader="#lensShader" >
    <int name="index" >...</int> 
  </assetdata>
</asset>

<!-- With embedded skinning -->
<asset id="sniperSkinned" src="#sniperasset" >
  <assetdata name="base" compute="dataflow['#skinning']" >
    <data src="#someAnimationData" />
    <float name="animKey">0.0</float>
  </assetdata>
</asset >
Clone this wiki locally