calacirya
diff doc/scnfmt.tex @ 3:71a3eb026e80
writing the scene file spec
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Thu, 22 Sep 2011 02:23:50 +0300 |
parents | 0c1aab0534c5 |
children |
line diff
1.1 --- a/doc/scnfmt.tex Thu Sep 22 01:19:37 2011 +0300 1.2 +++ b/doc/scnfmt.tex Thu Sep 22 02:23:50 2011 +0300 1.3 @@ -1,16 +1,85 @@ 1.4 -chunk 1.5 ------- 1.6 -offs size description 1.7 -0 4 type id (four-cc) 1.8 -4 4 size (including header and children) 1.9 -8 sz-8 data (chunk specific) 1.10 +\documentclass[a4paper]{article} 1.11 1.12 -defined chunk ids 1.13 ------------------ 1.14 -root "root" 1.15 -material "mtl " 1.16 -object "obj " 1.17 -camera "cam " 1.18 +\title{ARDA \\ 1.19 +\large \emph{a 3D scene file format for the calacirya renderer}} 1.20 +\author{} 1.21 +\date{} 1.22 1.23 -chunk description 1.24 ------------------ 1.25 +\begin{document} 1.26 +\maketitle 1.27 + 1.28 +\begin{abstract} 1.29 +Arda is a scene description format for the calacirya photorealistic renderer. 1.30 +It's a binary hierarchical chunk-based format, designed for simplicity and 1.31 +extensibility. 1.32 +\end{abstract} 1.33 + 1.34 +\tableofcontents 1.35 +\newpage 1.36 + 1.37 +\section{Overview} 1.38 +The ARDA file format is a hierarchical scene description for the 1.39 +\emph{calacirya} photorealistic renderer. The idea behind 1.40 +ARDA is to allow the core of the renderer to be completely oblivious about 1.41 +the file format beyond the root, and just prune subtrees and pass them to other 1.42 +modules for parsing. For instance, the core doesn't need to know anything about 1.43 +how triangle meshes are structured, it just cuts off that whole subtree and 1.44 +gives it to the mesh module for parsing. 1.45 + 1.46 +\section{Chunk layout} 1.47 + 1.48 +\begin{tabular}{ccl} 1.49 +offs & size & description \\ 1.50 +0 & 4 & type id (four-cc) \\ 1.51 +4 & 4 & size (including header and children) \\ 1.52 +8 & size - 8 & data (chunk specific) 1.53 +\end{tabular} 1.54 + 1.55 +%defined chunk ids 1.56 +%----------------- 1.57 +%root "root" 1.58 +%material "mtl " 1.59 +%object "obj " 1.60 +%camera "cam " 1.61 + 1.62 +\section{Chunks} 1.63 + 1.64 +A description of all predefined chunks follows. 1.65 + 1.66 +\subsection{Root} 1.67 +\begin{tabular}{rl} 1.68 +chunk id: & ``root'' \\ 1.69 +data: & none \\ 1.70 +children: & object (0 or more), material (0 or more), camera (0 or more) 1.71 +\end{tabular} 1.72 + 1.73 +This is the root node of the scene graph. Allowable children are any number of 1.74 +objects, materials, and cameras. 1.75 + 1.76 +\subsection{Material} 1.77 +\begin{tabular}{rl} 1.78 +chunk id: & ``mtl '' \\ 1.79 +data: & none \\ 1.80 +children: & name (1), shader (0 or 1), material attribute (0 or more). 1.81 +\end{tabular} 1.82 + 1.83 +\subsection{Material attribute} 1.84 +\begin{tabular}{rl} 1.85 +chunk id: & ``matr'' \\ 1.86 +data: & none \\ 1.87 +children: & name (1), vec3 (0 or 1), float (0 or 1), texture (0 or 1). 1.88 +\end{tabular} 1.89 + 1.90 +The material attribute carries its value as a vec3 or a float or both, 1.91 +modulated by a texture image. 1.92 + 1.93 + 1.94 +\subsection{Name} 1.95 +\begin{tabular}{rl} 1.96 +chunk id: & ``name'' \\ 1.97 +data: & zero-terminated string of characters \\ 1.98 +children: & none 1.99 +\end{tabular} 1.100 + 1.101 + 1.102 +\end{document}