# HG changeset patch # User John Tsiombikas # Date 1316647430 -10800 # Node ID 71a3eb026e80af8138dfcc31f4f74dd8356428a9 # Parent 0c1aab0534c577a128a23d0d9fa040626b2f497b writing the scene file spec diff -r 0c1aab0534c5 -r 71a3eb026e80 doc/scnfmt.tex --- a/doc/scnfmt.tex Thu Sep 22 01:19:37 2011 +0300 +++ b/doc/scnfmt.tex Thu Sep 22 02:23:50 2011 +0300 @@ -1,16 +1,85 @@ -chunk ------- -offs size description -0 4 type id (four-cc) -4 4 size (including header and children) -8 sz-8 data (chunk specific) +\documentclass[a4paper]{article} -defined chunk ids ------------------ -root "root" -material "mtl " -object "obj " -camera "cam " +\title{ARDA \\ +\large \emph{a 3D scene file format for the calacirya renderer}} +\author{} +\date{} -chunk description ------------------ +\begin{document} +\maketitle + +\begin{abstract} +Arda is a scene description format for the calacirya photorealistic renderer. +It's a binary hierarchical chunk-based format, designed for simplicity and +extensibility. +\end{abstract} + +\tableofcontents +\newpage + +\section{Overview} +The ARDA file format is a hierarchical scene description for the +\emph{calacirya} photorealistic renderer. The idea behind +ARDA is to allow the core of the renderer to be completely oblivious about +the file format beyond the root, and just prune subtrees and pass them to other +modules for parsing. For instance, the core doesn't need to know anything about +how triangle meshes are structured, it just cuts off that whole subtree and +gives it to the mesh module for parsing. + +\section{Chunk layout} + +\begin{tabular}{ccl} +offs & size & description \\ +0 & 4 & type id (four-cc) \\ +4 & 4 & size (including header and children) \\ +8 & size - 8 & data (chunk specific) +\end{tabular} + +%defined chunk ids +%----------------- +%root "root" +%material "mtl " +%object "obj " +%camera "cam " + +\section{Chunks} + +A description of all predefined chunks follows. + +\subsection{Root} +\begin{tabular}{rl} +chunk id: & ``root'' \\ +data: & none \\ +children: & object (0 or more), material (0 or more), camera (0 or more) +\end{tabular} + +This is the root node of the scene graph. Allowable children are any number of +objects, materials, and cameras. + +\subsection{Material} +\begin{tabular}{rl} +chunk id: & ``mtl '' \\ +data: & none \\ +children: & name (1), shader (0 or 1), material attribute (0 or more). +\end{tabular} + +\subsection{Material attribute} +\begin{tabular}{rl} +chunk id: & ``matr'' \\ +data: & none \\ +children: & name (1), vec3 (0 or 1), float (0 or 1), texture (0 or 1). +\end{tabular} + +The material attribute carries its value as a vec3 or a float or both, +modulated by a texture image. + + +\subsection{Name} +\begin{tabular}{rl} +chunk id: & ``name'' \\ +data: & zero-terminated string of characters \\ +children: & none +\end{tabular} + + +\end{document}