Advertisement
ShaXbee

eu07.idl

Sep 10th, 2014
3,489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
IDL 1.03 KB | None | 0 0
  1. namespace eu07;
  2.  
  3. struct Vertex {
  4.   x: float;
  5.   y: float;
  6.   z: float;
  7. }
  8.  
  9. struct Quaternion {
  10.   x: float;
  11.   y: float;
  12.   z: float;
  13.   w: float;
  14. }
  15.  
  16. table Texture {
  17.   name: string;
  18. }
  19.  
  20. table Program {
  21.   geometry: string;
  22.   fragment: string;
  23. }
  24.  
  25. enum NormalFormat: byte = { DISABLED = 0, FLOAT = 1, INT_2_10_10_10 = 2 }
  26. enum TexCoordFormat: byte = { FLOAT = 0, HALF_FLOAT = 2, SHORT = 3, BYTE = 4 }
  27.  
  28. struct VertexFormat {
  29.   normal: NormalFormat;
  30.   texCoord: TexCoordFormat;
  31.   texCoordCount: byte;
  32. }
  33.  
  34. table Header {
  35.   version: uint;
  36.   textures: [Texture];
  37.   programs: [Program];
  38. }
  39.  
  40. table Mesh {
  41.   position: Vertex;
  42.   orientation: Quaternion;
  43.   format: VertexFormat;
  44.   data: [ubyte]; // vertex data
  45.   uniforms: [ubyte];
  46.   textures: [ubyte]; // texture index in header, UCHAR_MAX - n for replaceable textures
  47.   program: ubyte; // GLSL program index in header
  48. }
  49.  
  50. table InstancedMesh {
  51.   mesh: Mesh;
  52.   count: uint;
  53. }
  54.  
  55. table AnimatedMesh {
  56.   mesh: Mesh;
  57. }
  58.  
  59. union AnyMesh { Mesh, InstancedMesh, AnimatedMesh }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement