<?xml version="1.0" encoding="UTF-8"?>
<!--
	toxic - A Global Illumination Renderer
	Copyright (C) 2003-2004 Francois Beaune
	Contact: http://toxicengine.sourceforge.net/

	This file is part of toxic.

	toxic is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	toxic is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with toxic; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xsd:annotation>
		<xsd:documentation xml:lang="en">
			This is the XML Schema defining toxic scene settings file format.
		</xsd:documentation>
	</xsd:annotation>
	<xsd:element name="ToxicSceneSettings">
		<xsd:complexType>
			<xsd:all>
				<xsd:element name="Rendering">
					<xsd:complexType>
						<xsd:all>
							<xsd:element name="PixelSampling">
								<xsd:complexType>
									<xsd:choice>
										<xsd:element name="Supersampling" type="samplingSettings"/>
										<xsd:element name="WhittedAdaptiveSampling">
											<xsd:complexType>
												<xsd:attribute name="contrastthreshold" type="positiveDouble" use="required"/>
												<xsd:attribute name="maxdepth" type="xsd:nonNegativeInteger" use="required"/>
											</xsd:complexType>
										</xsd:element>
									</xsd:choice>
								</xsd:complexType>
							</xsd:element>
							<xsd:element name="Components">
								<xsd:complexType>
									<xsd:all>
										<xsd:element name="DirectLighting" minOccurs="0">
											<xsd:complexType>
												<xsd:all>
													<xsd:element name="ArealightSampling" type="samplingSettings"/>
												</xsd:all>
											</xsd:complexType>
										</xsd:element>
										<xsd:element name="IndirectLighting" minOccurs="0">
											<xsd:complexType>
												<xsd:all>
													<xsd:element name="PhotonTracing">
														<xsd:complexType>
															<xsd:attribute name="photons" type="xsd:positiveInteger" use="required"/>
														</xsd:complexType>
													</xsd:element>
													<xsd:element name="RadiancePrecomputation" minOccurs="0">
														<xsd:complexType>
															<xsd:attribute name="spacing" type="xsd:positiveInteger" use="required"/>
															<xsd:attribute name="maxsearchdistance" type="positiveDouble" use="required"/>
														</xsd:complexType>
													</xsd:element>
													<xsd:element name="RadianceEstimate" type="radianceEstimateSettings"/>
													<xsd:element name="PrimaryFinalGathering" type="samplingSettings" minOccurs="0"/>
													<xsd:element name="SecondaryFinalGathering" minOccurs="0">
														<xsd:complexType>
															<xsd:complexContent>
																<xsd:extension base="samplingSettings">
																	<xsd:attribute name="distancethreshold" type="positiveDouble" use="required"/>
																</xsd:extension>
															</xsd:complexContent>
														</xsd:complexType>
													</xsd:element>
												</xsd:all>
											</xsd:complexType>
										</xsd:element>
										<xsd:element name="SpecularReflections" minOccurs="0">
											<xsd:complexType>
												<xsd:attribute name="maxdepth" type="xsd:nonNegativeInteger" use="required"/>
											</xsd:complexType>
										</xsd:element>
										<xsd:element name="Caustics" minOccurs="0">
											<xsd:complexType>
												<xsd:all>
													<xsd:element name="PhotonTracing">
														<xsd:complexType>
															<xsd:attribute name="photons" type="xsd:positiveInteger" use="required"/>
														</xsd:complexType>
													</xsd:element>
													<xsd:element name="RadianceEstimate" type="radianceEstimateSettings"/>
												</xsd:all>
											</xsd:complexType>
										</xsd:element>
									</xsd:all>
								</xsd:complexType>
							</xsd:element>
						</xsd:all>
					</xsd:complexType>
				</xsd:element>
				<xsd:element name="Output">
					<xsd:complexType>
						<xsd:all>
							<xsd:element name="RenderArea" minOccurs="0">
								<xsd:complexType>
									<xsd:attribute name="x0" type="xsd:nonNegativeInteger" use="required"/>
									<xsd:attribute name="y0" type="xsd:nonNegativeInteger" use="required"/>
									<xsd:attribute name="x1" type="xsd:nonNegativeInteger" use="required"/>
									<xsd:attribute name="y1" type="xsd:nonNegativeInteger" use="required"/>
								</xsd:complexType>
							</xsd:element>
							<xsd:element name="GammaCorrection" minOccurs="0">
								<xsd:complexType>
									<xsd:attribute name="targetgamma" type="positiveDouble" use="required"/>
								</xsd:complexType>
							</xsd:element>
						</xsd:all>
					</xsd:complexType>
				</xsd:element>
			</xsd:all>
		</xsd:complexType>
	</xsd:element>
	<xsd:simpleType name="positiveDouble">
		<xsd:restriction base="xsd:double">
			<xsd:minExclusive value="0" fixed="false"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="samplingSettings">
		<xsd:choice>
			<xsd:element name="RandomSampling">
				<xsd:complexType>
					<xsd:attribute name="samples" type="xsd:positiveInteger" use="required"/>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="RegularSampling">
				<xsd:complexType>
					<xsd:attribute name="width" type="xsd:positiveInteger" use="required"/>
					<xsd:attribute name="height" type="xsd:positiveInteger" use="required"/>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="StratifiedSampling">
				<xsd:complexType>
					<xsd:attribute name="width" type="xsd:positiveInteger" use="required"/>
					<xsd:attribute name="height" type="xsd:positiveInteger" use="required"/>
				</xsd:complexType>
			</xsd:element>
		</xsd:choice>
	</xsd:complexType>
	<xsd:complexType name="radianceEstimateSettings">
		<xsd:attribute name="maxphotons" type="xsd:positiveInteger" use="required"/>
		<xsd:attribute name="maxdistance" type="positiveDouble" use="required"/>
	</xsd:complexType>
</xsd:schema>
