Просмотр исходного кода

- Changing the Material class
- Moving ilumination stage to 3.3 core

Panagiotis Christopoulos Charitos 15 лет назад
Родитель
Сommit
9bd11fa0d1

+ 245 - 253
.cproject

@@ -2,257 +2,249 @@
 <?fileVersion 4.0.0?>
 
 <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
-<storageModule moduleId="org.eclipse.cdt.core.settings">
-<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304">
-<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304" moduleId="org.eclipse.cdt.core.settings" name="Default">
-<externalSettings/>
-<extensions>
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-</extensions>
-</storageModule>
-<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<configuration artifactName="anki" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
-<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304.1771284297" name="/" resourcePath="">
-<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.652528495" name="cdt.managedbuild.toolchain.gnu.cross.base" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
-<option id="cdt.managedbuild.option.gnu.cross.prefix.124248385" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
-<option id="cdt.managedbuild.option.gnu.cross.path.568633506" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
-<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.2099631" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
-<builder arguments="make -j 4" autoBuildTarget="all" buildPath="${workspace_loc:/anki/build/debug}" cleanBuildTarget="clean" command="nice" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304.618553305" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelizationNumber="1" superClass="org.eclipse.cdt.build.core.settings.default.builder">
-<outputEntries>
-<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="build/debug"/>
-</outputEntries>
-</builder>
-<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.454660912" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
-<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.264866474" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.628710088" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
-<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.444788722" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
-<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
-<additionalInput kind="additionalinput" paths="$(LIBS)"/>
-</inputType>
-</tool>
-</toolChain>
-</folderInfo>
-<sourceEntries>
-<entry excluding="Collision" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
-</sourceEntries>
-</configuration>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
-<storageModule moduleId="scannerConfiguration">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="false"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="false"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1593777304;cdt.managedbuild.toolchain.gnu.cross.base.1593777304.1771284297;cdt.managedbuild.tool.gnu.cross.cpp.compiler.454660912;cdt.managedbuild.tool.gnu.cpp.compiler.input.264866474">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="false"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="false"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-</scannerConfigBuildInfo>
-</storageModule>
-</cconfiguration>
-</storageModule>
-<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<project id="anki.null.323176720" name="anki"/>
-</storageModule>
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
+		<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304" moduleId="org.eclipse.cdt.core.settings" name="Default">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="anki" buildProperties="" description="" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser" id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
+					<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304.1771284297" name="/" resourcePath="">
+						<toolChain errorParsers="" id="cdt.managedbuild.toolchain.gnu.cross.base.652528495" name="cdt.managedbuild.toolchain.gnu.cross.base">
+							<option id="cdt.managedbuild.option.gnu.cross.prefix.124248385" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
+							<option id="cdt.managedbuild.option.gnu.cross.path.568633506" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
+							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.2099631" isAbstract="false" osList="all"/>
+							<builder arguments="make -j 4" autoBuildTarget="all" buildPath="${workspace_loc:/anki/build/debug}" cleanBuildTarget="clean" command="nice" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304.618553305" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelizationNumber="1" superClass="org.eclipse.cdt.build.core.settings.default.builder">
+								<outputEntries>
+									<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="build/debug"/>
+								</outputEntries>
+							</builder>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry excluding="Collision" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+			<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+			<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+			<storageModule moduleId="scannerConfiguration">
+				<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+				<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+					<buildOutputProvider>
+						<openAction enabled="true" filePath=""/>
+						<parser enabled="true"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+					<buildOutputProvider>
+						<openAction enabled="true" filePath=""/>
+						<parser enabled="true"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="makefileGenerator">
+						<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+					<buildOutputProvider>
+						<openAction enabled="true" filePath=""/>
+						<parser enabled="true"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+					<buildOutputProvider>
+						<openAction enabled="true" filePath=""/>
+						<parser enabled="true"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+					<buildOutputProvider>
+						<openAction enabled="true" filePath=""/>
+						<parser enabled="true"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+					<buildOutputProvider>
+						<openAction enabled="true" filePath=""/>
+						<parser enabled="true"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+					<buildOutputProvider>
+						<openAction enabled="true" filePath=""/>
+						<parser enabled="true"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+					<buildOutputProvider>
+						<openAction enabled="true" filePath=""/>
+						<parser enabled="true"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile">
+					<buildOutputProvider>
+						<openAction enabled="false" filePath=""/>
+						<parser enabled="false"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP">
+					<buildOutputProvider>
+						<openAction enabled="false" filePath=""/>
+						<parser enabled="false"/>
+					</buildOutputProvider>
+					<scannerInfoProvider id="specsFile">
+						<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/>
+						<parser enabled="true"/>
+					</scannerInfoProvider>
+				</profile>
+				<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1593777304;cdt.managedbuild.toolchain.gnu.cross.base.1593777304.1771284297;cdt.managedbuild.tool.gnu.cross.cpp.compiler.454660912;cdt.managedbuild.tool.gnu.cpp.compiler.input.264866474">
+					<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+					<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+						<buildOutputProvider>
+							<openAction enabled="true" filePath=""/>
+							<parser enabled="true"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+						<buildOutputProvider>
+							<openAction enabled="true" filePath=""/>
+							<parser enabled="true"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="makefileGenerator">
+							<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+						<buildOutputProvider>
+							<openAction enabled="true" filePath=""/>
+							<parser enabled="true"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+						<buildOutputProvider>
+							<openAction enabled="true" filePath=""/>
+							<parser enabled="true"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+						<buildOutputProvider>
+							<openAction enabled="true" filePath=""/>
+							<parser enabled="true"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+						<buildOutputProvider>
+							<openAction enabled="true" filePath=""/>
+							<parser enabled="true"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+						<buildOutputProvider>
+							<openAction enabled="true" filePath=""/>
+							<parser enabled="true"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+						<buildOutputProvider>
+							<openAction enabled="true" filePath=""/>
+							<parser enabled="true"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile">
+						<buildOutputProvider>
+							<openAction enabled="false" filePath=""/>
+							<parser enabled="false"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+					<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP">
+						<buildOutputProvider>
+							<openAction enabled="false" filePath=""/>
+							<parser enabled="false"/>
+						</buildOutputProvider>
+						<scannerInfoProvider id="specsFile">
+							<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/>
+							<parser enabled="true"/>
+						</scannerInfoProvider>
+					</profile>
+				</scannerConfigBuildInfo>
+			</storageModule>
+		</cconfiguration>
+	</storageModule>
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+		<project id="anki.null.323176720" name="anki"/>
+	</storageModule>
 </cproject>

+ 0 - 0
shaders/dp.glsl → shaders/Dp.glsl


+ 51 - 0
shaders/DpGeneric.glsl

@@ -0,0 +1,51 @@
+/// Control defines:
+/// ALPHA_TESTING, HARDWARE_SKINNING
+
+#pragma anki vertShaderBegins
+
+#pragma anki include "shaders/hw_skinning.glsl"
+
+uniform mat4 modelViewProjectionMat;
+
+in vec3 position;
+
+#if defined(ALPHA_TESTING)
+	in vec2 texCoords;
+	out vec2 vTexCoords;
+#endif
+
+void main()
+{
+	#if defined(ALPHA_TESTING)
+		vTexCoords = texCoords;
+	#endif
+
+	#if defined(HARDWARE_SKINNING)
+		mat3 _rot_;
+		vec3 _tsl_;
+
+		HWSkinning(_rot_, _tsl_);
+
+		vec3 _posLocalSpace_ = (_rot_ * position) + _tsl_;
+		gl_Position = modelViewProjectionMat * vec4(_posLocalSpace_, 1.0);
+	#else
+	  gl_Position = modelViewProjectionMat * vec4(position, 1.0);
+	#endif
+}
+
+#pragma anki fragShaderBegins
+
+#if defined(ALPHA_TESTING)
+	uniform sampler2D diffuseMap;
+	in vec2 vTexCoords;
+#endif
+
+void main()
+{
+	#if defined(ALPHA_TESTING)
+		if(texture2D(diffuseMap, vTexCoords).a == 0.0)
+		{
+			discard;
+		}
+	#endif
+}

+ 6 - 2
shaders/IsAp.glsl

@@ -1,3 +1,5 @@
+/// @file
+/// Ilumination stage ambient pass shader program
 #pragma anki vertShaderBegins
 
 #pragma anki include "shaders/SimpleVert.glsl"
@@ -7,9 +9,11 @@
 uniform vec3 ambientCol;
 uniform sampler2D sceneColMap;
 
-varying vec2 vTexCoords;
+in vec2 vTexCoords;
+
+out vec3 fColor;
 
 void main()
 {
-	gl_FragData[0].rgb = texture2D( sceneColMap, vTexCoords ).rgb * ambientCol;
+	fColor = texture2D(sceneColMap, vTexCoords).rgb * ambientCol;
 }

+ 55 - 74
shaders/IsLpGeneric.glsl

@@ -1,18 +1,14 @@
-/**
- * @file
- *
- * Illumination stage lighting pass general shader program
- */
+/// @file
+///
+/// Illumination stage lighting pass general shader program
 
 #pragma anki vertShaderBegins
 
-#pragma anki attribute viewVector 1
-attribute vec3 viewVector;
-#pragma anki attribute position 0
-attribute vec2 position; ///< the vert coords are {1.0,1.0}, {0.0,1.0}, {0.0,0.0}, {1.0,0.0}
+layout(location = 0) in vec2 position; ///< the vert coords are {1.0,1.0}, {0.0,1.0}, {0.0,0.0}, {1.0,0.0}
+layout(location = 1) in vec3 viewVector;
 
-varying vec2 vTexCoords;
-varying vec3 vPosition;
+out vec2 vTexCoords;
+out vec3 vPosition;
 
 
 //======================================================================================================================
@@ -31,9 +27,8 @@ void main()
 
 #pragma anki include "shaders/Pack.glsl"
 
-/*
- * Uniforms
- */
+/// @name Uniforms
+/// @{
 uniform sampler2D msNormalFai, msDiffuseFai, msSpecularFai, msDepthFai;
 uniform vec2 planes; ///< for the calculation of frag pos in view space	
 uniform vec3 lightPos; ///< Light pos in eye space
@@ -47,26 +42,32 @@ uniform vec3 lightSpecularCol;
 		uniform sampler2DShadow shadowMap;
 	#endif
 #endif
+/// @}
 
-/*
- * Varyings
- */
-varying vec2 vTexCoords;
-varying vec3 vPosition; ///< for the calculation of frag pos in view space
+/// @name Varyings
+/// @{
+in vec2 vTexCoords;
+in vec3 vPosition; ///< for the calculation of frag pos in view space
+/// @}
+
+/// @name Output
+/// @{
+out vec3 fColor;
+/// @}
 
 
 //======================================================================================================================
 // getFragPosVSpace                                                                                                    =
 //======================================================================================================================
-/**
- * @return frag pos in view space
- */
+/// @return frag pos in view space
 vec3 getFragPosVSpace()
 {
 	float _depth_ = texture2D(msDepthFai, vTexCoords).r;
 
 	if(_depth_ == 1.0)
+	{
 		discard;
+	}
 
 	vec3 _fragPosVspace_;
 	vec3 _vposn_ = normalize(vPosition);
@@ -79,10 +80,7 @@ vec3 getFragPosVSpace()
 //======================================================================================================================
 // getAttenuation                                                                                                      =
 //======================================================================================================================
-/**
- * @return The attenuation factor fiven the distance from the frag to the light
- * source
- */
+/// @return The attenuation factor fiven the distance from the frag to the light source
 float getAttenuation(in float _fragLightDist_)
 {
 	return clamp(1.0 - sqrt(_fragLightDist_) / lightRadius, 0.0, 1.0);
@@ -90,15 +88,12 @@ float getAttenuation(in float _fragLightDist_)
 }
 
 
-#if defined(SPOT_LIGHT_ENABLED) && defined(SHADOW_ENABLED)
-
-
 //======================================================================================================================
 // pcfLow                                                                                                              =
 //======================================================================================================================
-/**
- * @return The blurred shadow
- */
+#if defined(SPOT_LIGHT_ENABLED) && defined(SHADOW_ENABLED)
+
+/// @return The blurred shadow
 float pcfLow(in vec3 _shadowUv_)
 {
 	const float _mapScale_ = 1.0 / SHADOWMAP_SIZE;
@@ -122,7 +117,7 @@ float pcfLow(in vec3 _shadowUv_)
 		_shadowCol_ += shadow2D(shadowMap, _uvCoord_).r;
 	}
 	
-	_shadowCol_ *= (1.0/9.0);
+	_shadowCol_ *= (1.0 / 9.0);
 	return _shadowCol_;
 }
 
@@ -132,48 +127,38 @@ float pcfLow(in vec3 _shadowUv_)
 //======================================================================================================================
 // doPhong                                                                                                             =
 //======================================================================================================================
-/**
- * Performs phong lighting using the MS FAIs and a few other things
- * @param _fragPosVspace_ The fragment position in view space
- * @param _fragLightDist_ Output needed for the attenuation calculation
- * @return The final color
- */
+/// Performs phong lighting using the MS FAIs and a few other things
+/// @param _fragPosVspace_ The fragment position in view space
+/// @param _fragLightDist_ Output needed for the attenuation calculation
+/// @return The final color
 vec3 doPhong(in vec3 _fragPosVspace_, out float _fragLightDist_)
 {
 	// get the vector from the frag to the light
 	vec3 _frag2LightVec_ = lightPos - _fragPosVspace_;
 
-	/*
-	 * Instead of using normalize(_frag2LightVec_) we brake the operation because we want _fragLightDist_ for the calc of
-	 * the attenuation
-	 */
+	// Instead of using normalize(_frag2LightVec_) we brake the operation because we want _fragLightDist_ for the calc of
+	// the attenuation
 	_fragLightDist_ = dot(_frag2LightVec_, _frag2LightVec_);
 	vec3 _lightDir_ = _frag2LightVec_ * inversesqrt(_fragLightDist_);
 
-	/*
-	 * Read the normal
-	 */
+	// Read the normal
 	vec3 _normal_ = unpackNormal(texture2D(msNormalFai, vTexCoords).rg);
 
-	/*
-	 * Lambert term
-	 */
+	// Lambert term
 	float _lambertTerm_ = dot(_normal_, _lightDir_);
 
 	if(_lambertTerm_ < 0.0)
+	{
 		discard;
+	}
 	//_lambertTerm_ = max(0.0, _lambertTerm_);
 
-	/*
-	 * Diffuce
-	 */
+	// Diffuce
 	vec3 _diffuse_ = texture2D(msDiffuseFai, vTexCoords).rgb;
 	_diffuse_ *= lightDiffuseCol;
 	vec3 _color_ = _diffuse_ * _lambertTerm_;
 
-	/*
-	 * Specular
-	 */
+	// Specular
 	vec4 _specularMix_ = texture2D(msSpecularFai, vTexCoords); // the MS specular FAI has the color and the shininess
 	vec3 _specular_ = _specularMix_.xyz;
 	float _shininess_ = _specularMix_.w;
@@ -183,9 +168,7 @@ vec3 doPhong(in vec3 _fragPosVspace_, out float _fragLightDist_)
 	float _specIntensity_ = pow(max(0.0, dot(_normal_, _h_)), _shininess_);
 	_color_ += _specular_ * lightSpecularCol * (_specIntensity_ * _lambertTerm_);
 	
-	/*
-	 * end
-	 */
+	// end
 	return _color_;
 }
 
@@ -198,21 +181,19 @@ void main()
 	// get frag pos in view space
 	vec3 fragPosVspace = getFragPosVSpace();
 
-	/*
-	 * Point light
-	 */
+	//
+	// Point light
+	//
 	#if defined(POINT_LIGHT_ENABLED)
-		/*
-		 * The func doPhong calculates the frag to light distance (_fragLightDist_) and be cause we need that distance
-		 * latter for other calculations we export it
-		 */
+		// The func doPhong calculates the frag to light distance (_fragLightDist_) and be cause we need that distance
+		// latter for other calculations we export it
 		float _fragLightDist_;
 		vec3 _color_ = doPhong(fragPosVspace, _fragLightDist_);
-		gl_FragData[0].rgb = _color_ * getAttenuation(_fragLightDist_);
+		fColor = _color_ * getAttenuation(_fragLightDist_);
 
-	/*
-	 * Spot light
-	 */
+	//
+	// Spot light
+	//
 	#elif defined(SPOT_LIGHT_ENABLED)
 		vec4 _vTexCoords2_ = texProjectionMat * vec4(fragPosVspace, 1.0);
 		vec3 _vTexCoords3_ = _vTexCoords2_.xyz / _vTexCoords2_.w;
@@ -224,9 +205,7 @@ void main()
 		   _vTexCoords3_.y < 1.0 &&
 		   _vTexCoords2_.w < lightRadius)
 		{
-			/*
-			 * Get shadow
-			 */
+			// Get shadow
 			#if defined(SHADOW_ENABLED)
 				#if defined(PCF_ENABLED)
 					float _shadowCol_ = pcfLow(_vTexCoords3_);
@@ -235,7 +214,9 @@ void main()
 				#endif
 
 				if(_shadowCol_ == 0.0)
+				{
 					discard;
+				}
 			#endif
 
 			float _fragLightDist_;
@@ -245,9 +226,9 @@ void main()
 			float _att_ = getAttenuation(_fragLightDist_);
 
 			#if defined(SHADOW_ENABLED)
-				gl_FragData[0].rgb = _lightTexCol_ * _color_ * (_shadowCol_ * _att_);
+				fColor = _lightTexCol_ * _color_ * (_shadowCol_ * _att_);
 			#else
-				gl_FragData[0].rgb = _lightTexCol_ * _color_ * _att_;
+				fColor = _lightTexCol_ * _color_ * _att_;
 			#endif
 		}
 		else

+ 5 - 1
shaders/IsSmo.glsl

@@ -1,3 +1,7 @@
+/// @file
+///
+/// Ilunimation stage stencil masking optimizations shader program
+
 #pragma anki vertShaderBegins
 
 #pragma anki attribute position 0
@@ -7,7 +11,7 @@ uniform mat4 modelViewProjectionMat;
 
 void main()
 {
-	gl_Position = modelViewProjectionMat * vec4( position, 1.0 );
+	gl_Position = modelViewProjectionMat * vec4(position, 1.0);
 }
 
 #pragma anki fragShaderBegins

+ 51 - 55
shaders/MsMpGeneric.glsl

@@ -1,13 +1,11 @@
-/**
- * @file
- *
- * This a generic shader to fill the deferred shading buffers. You can always build your own if you dont need to write
- * in all the buffers
- *
- * Control defines:
- * DIFFUSE_MAPPING, NORMAL_MAPPING, SPECULAR_MAPPING, PARALLAX_MAPPING, ENVIRONMENT_MAPPING, ALPHA_TESTING,
- * HARDWARE_SKINNING
- */
+/// @file
+/// 
+/// This a generic shader to fill the deferred shading buffers. You can always build your own if you dont need to write
+/// in all the buffers
+/// 
+/// Control defines:
+/// DIFFUSE_MAPPING, NORMAL_MAPPING, SPECULAR_MAPPING, PARALLAX_MAPPING, ENVIRONMENT_MAPPING, ALPHA_TESTING,
+/// HARDWARE_SKINNING
  
 #if defined(ALPHA_TESTING) && !defined(DIFFUSE_MAPPING)
 	#error "Cannot have ALPHA_TESTING without DIFFUSE_MAPPING"
@@ -33,9 +31,8 @@
 	#pragma anki include "shaders/hw_skinning.glsl"
 #endif
 
-/*
- * Attributes
- */
+/// @name Attributes
+/// @{
 in vec3 position;
 in vec3 normal;
 #if NEEDS_TEX_MAPPING
@@ -44,25 +41,26 @@ in vec3 normal;
 #if NEEDS_TANGENT
 	in vec4 tangent;
 #endif
+/// @}
 
-/*
- * Uniforms
- */
+/// @name Uniforms
+/// @{
 uniform mat4 modelMat;
 uniform mat4 viewMat;
 uniform mat4 projectionMat;
 uniform mat4 modelViewMat;
 uniform mat3 normalMat;
 uniform mat4 modelViewProjectionMat;
+/// @}
 
-/*
- * Varyings
- */
+/// @name Varyings
+/// @{
 out vec3 vNormal;
 out vec2 vTexCoords;
 out vec3 vTangent;
 out float vTangentW;
-out vec3 vVertPosViewSpace; ///< For env mapping. AKA view_vector
+out vec3 vVertPosViewSpace; ///< For env mapping. AKA view vector
+/// @}
 
 
 
@@ -121,14 +119,12 @@ void main()
 
 #pragma anki fragShaderBegins
 
-/**
- * Note: The process of calculating the diffuse color for the diffuse MSFAI is divided into two parts. The first happens
- * before the normal calculation and the other just after it. In the first part we read the texture (or the gl_Color)
- * and we set the _diffColl_. In case of grass we discard. In the second part we calculate a SEM color and we combine
- * it with the _diffColl_. We cannot put the second part before normal calculation because SEM needs the _normal_.
- * Also we cannot put the first part after normal calculation because in case of grass we will waste calculations for
- * the normal. For that two reasons we split the diffuse calculations in two parts
- */
+/// @note The process of calculating the diffuse color for the diffuse MSFAI is divided into two parts. The first
+/// happens before the normal calculation and the other just after it. In the first part we read the texture (or the
+/// gl_Color) and we set the _diffColl_. In case of grass we discard. In the second part we calculate a SEM color and
+/// we combine it with the _diffColl_. We cannot put the second part before normal calculation because SEM needs
+/// the _normal_. Also we cannot put the first part after normal calculation because in case of grass we will waste
+/// calculations for the normal. For that two reasons we split the diffuse calculations in two parts
 
 #pragma anki include "shaders/Pack.glsl"
 
@@ -170,10 +166,10 @@ layout(location = 2) out vec4 fMsSpecularFai;
 //======================================================================================================================
 void main()
 {
-	/*
-	 * Paralax Mapping Calculations
-	 * The code below reads the height map, makes some calculations and returns a new texCoords
-	 */
+	//
+	// Paralax Mapping Calculations
+	// The code below reads the height map, makes some calculations and returns a new texCoords
+	//
 	#if defined(PARALLAX_MAPPING)
 		/*const float _scale = 0.04;
 		const float _bias = scale * 0.4;
@@ -211,10 +207,10 @@ void main()
 	#endif
 
 
-	/*
-	 * Diffuse Calculations (Part I)
-	 * Get the color from the diffuse map and discard if alpha testing is on and alpha is zero
-	 */
+	//
+	// Diffuse Calculations (Part I)
+	// Get the color from the diffuse map and discard if alpha testing is on and alpha is zero
+	//
 	vec3 _diffColl_;
 	#if defined(DIFFUSE_MAPPING)
 
@@ -233,10 +229,10 @@ void main()
 	#endif
 
 
-	/*
-	 * Normal Calculations
-	 * Either use a normap map and make some calculations or use the vertex normal
-	 */
+	//
+	// Normal Calculations
+	// Either use a normap map and make some calculations or use the vertex normal
+	//
 	#if defined(NORMAL_MAPPING)
 		vec3 _n_ = normalize(vNormal);
 		vec3 _t_ = normalize(vTangent);
@@ -252,16 +248,16 @@ void main()
 	#endif
 
 
-	/*
-	 * Diffuse Calculations (Part II)
-	 * If SEM is enabled make some calculations (using the vVertPosViewSpace, environmentMap and the _normal_) and combine
-	 * colors of SEM and the _diffColl_
-	 */
+	//
+	// Diffuse Calculations (Part II)
+	// If SEM is enabled make some calculations (using the vVertPosViewSpace, environmentMap and the _normal_) and
+	/// combine colors of SEM and the _diffColl_
+	//
 	#if defined(ENVIRONMENT_MAPPING)
-		/*
-		 * In case of normal mapping I could play with vertex's normal but this gives better results and its allready
-		 * computed
-		 */
+		//
+		// In case of normal mapping I could play with vertex's normal but this gives better results and its allready
+		// computed
+		//
 		vec3 _u_ = normalize(vVertPosViewSpace);
 		vec3 _r_ = reflect(_u_, _normal_);
 		_r_.z += 1.0;
@@ -273,9 +269,9 @@ void main()
 	#endif
 
 
-	/*
-	 * Specular Calculations
-	 */
+	//
+	// Specular Calculations
+	//
 	#if defined(SPECULAR_MAPPING)
 		vec4 _specularCol_ = vec4(texture2D(specularMap, _superTexCoords_).rgb * specularCol, shininess);
 	#else // no specular map
@@ -283,9 +279,9 @@ void main()
 	#endif
 
 
-	/*
-	 * Final Stage. Write all data
-	 */
+	//
+	// Final Stage. Write all data
+	//
 	fMsNormalFai = packNormal(_normal_);
 	fMsDiffuseFai = _diffColl_;
 	fMsSpecularFai = _specularCol_;

+ 0 - 1
shaders/SimpleVert.glsl

@@ -3,7 +3,6 @@
 /// get the Normalized Display Coordinates ([-1,1]) simply by looking in the vertex
 /// position. The vertex positions of the quad are from 0.0 to 1.0 for both axis.
 
-//#pragma anki attribute position 0
 layout(location = 0) in vec2 position;
 
 out vec2 vTexCoords;

+ 0 - 43
shaders/dp_generic.glsl

@@ -1,43 +0,0 @@
-//
-#pragma anki vertShaderBegins
-
-#pragma anki include "shaders/hw_skinning.glsl"
-
-attribute vec3 position;
-attribute vec2 texCoords;
-
-uniform mat4 modelViewProjectionMat;
-
-varying vec2 texCoords_v2f;
-
-void main()
-{
-	#if defined( _GRASS_LIKE_ )
-		texCoords_v2f = texCoords;
-	#endif
-
-	#if defined( _HW_SKINNING_ )
-		mat3 _rot;
-		vec3 _tsl;
-
-		HWSkinning( _rot, _tsl );
-		
-		vec3 pos_lspace = ( _rot * position) + _tsl;
-		gl_Position =  modelViewProjectionMat * vec4(pos_lspace, 1.0);
-	#else
-	  gl_Position =  modelViewProjectionMat * vec4(position, 1.0);
-	#endif
-}
-
-#pragma anki fragShaderBegins
-
-uniform sampler2D diffuseMap;
-varying vec2 texCoords_v2f;
-
-void main()
-{
-	#if defined( _GRASS_LIKE_ )
-		vec4 _diff = texture2D( diffuseMap, texCoords_v2f );
-		if( _diff.a == 0.0 ) discard;
-	#endif
-}

+ 1 - 1
src/Main.cpp

@@ -385,7 +385,7 @@ int main(int argc, char* argv[])
 	}
 	catch(std::exception& e)
 	{
-		ERROR("Fatal error: " + e.what());
+		ERROR("Aborting: " + e.what());
 		//abort();
 		return 1;
 	}

+ 14 - 11
src/Misc/Parser.h

@@ -6,13 +6,10 @@
 #include "Scanner.h"
 
 
-/// It contains some functions and macros that include code commonly used while parsing
+/// It contains some functions and macros that are used pretty often while parsing
 namespace Parser {
 
-
-//======================================================================================================================
-// Parser macros                                                                                                       =
-//======================================================================================================================
+/// Parser macros
 #define PARSER_EXCEPTION(x) \
 	EXCEPTION("Parser exception (" + scanner.getScriptName() + ':' + \
 	boost::lexical_cast<std::string>(scanner.getLineNumber()) + "): " + x)
@@ -24,9 +21,6 @@ namespace Parser {
 	PARSER_EXCEPTION("Unexpected token " + scanner.getCrntToken().getInfoStr())
 
 
-//======================================================================================================================
-// parseArrOfNumbers                                                                                                   =
-//======================================================================================================================
 /// This template func is used for a common operation of parsing arrays of numbers
 ///
 /// It parses expressions like this one: { 10 -0.2 123.e-10 -0x0FF } and stores the result in the arr array. The
@@ -41,7 +35,6 @@ namespace Parser {
 template <typename Type>
 void parseArrOfNumbers(Scanner& scanner, bool bracket, bool signs, uint size, Type* arr);
 
-
 /// Parse a single number
 /// @param scanner The scanner that we will use
 /// @param sign If true expect sign or not
@@ -49,11 +42,21 @@ void parseArrOfNumbers(Scanner& scanner, bool bracket, bool signs, uint size, Ty
 template <typename Type>
 void parseNumber(Scanner& scanner, bool sign, Type& out);
 
-
-/// Parses a math structure (Vec3, Vec4, Mat3 etc) with leading and following brackets
+/// Parses a math structure (Vec3, Vec4, Mat3 etc) with leading and following brackets. Eg {0.1 0.2 0.3}
 template <typename Type>
 void parseMathVector(Scanner& scanner, Type& out);
 
+/// Parse true or false identifiers
+extern bool parseBool(Scanner& scanner);
+
+/// Parse identifier
+extern std::string parseIdentifier(Scanner& scanner, const char* expectedIdentifier = NULL);
+
+/// Is identifier
+extern bool isIdentifier(const Scanner::Token* token, const char* str);
+
+/// Parse string
+extern std::string parseString(Scanner& scanner);
 
 } // end namespace Parser
 

+ 78 - 0
src/Misc/Parser.inl.h

@@ -1,3 +1,4 @@
+#include <cstring>
 #include "Parser.h"
 #include "Exception.h"
 
@@ -171,5 +172,82 @@ void parseMathVector(Scanner& scanner, Type& out)
 }
 
 
+//======================================================================================================================
+// parseBool                                                                                                           =
+//======================================================================================================================
+inline bool parseBool(Scanner& scanner)
+{
+	const char* errMsg = "identifier true or false";
+
+	const Scanner::Token* token = &scanner.getNextToken();
+	if(token->getCode() != Scanner::TC_IDENTIFIER)
+	{
+		throw PARSER_EXCEPTION_EXPECTED(errMsg);
+	}
+
+	if(!strcmp(token->getValue().getString(), "true"))
+	{
+		return true;
+	}
+	else if (!strcmp(token->getValue().getString(), "false"))
+	{
+		return false;
+	}
+	else
+	{
+		throw PARSER_EXCEPTION_EXPECTED(errMsg);
+	}
+}
+
+
+//======================================================================================================================
+// parseIdentifier                                                                                                     =
+//======================================================================================================================
+inline std::string parseIdentifier(Scanner& scanner, const char* expectedIdentifier)
+{
+	const Scanner::Token* token = &scanner.getNextToken();
+	if(token->getCode() != Scanner::TC_IDENTIFIER)
+	{
+		if(expectedIdentifier == NULL)
+		{
+			throw PARSER_EXCEPTION_EXPECTED("identifier");
+		}
+		else
+		{
+			throw PARSER_EXCEPTION_EXPECTED("identifier " + expectedIdentifier);
+		}
+	}
+
+	if(expectedIdentifier != NULL && strcmp(token->getValue().getString(), expectedIdentifier))
+	{
+		throw PARSER_EXCEPTION_EXPECTED("identifier " + expectedIdentifier);
+	}
+
+	return token->getValue().getString();
+}
+
+
+//======================================================================================================================
+// isIdentifier                                                                                                        =
+//======================================================================================================================
+inline bool isIdentifier(const Scanner::Token* token, const char* str)
+{
+	return token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), str);
+}
+
+
+//======================================================================================================================
+// parseString                                                                                                         =
+//======================================================================================================================
+inline std::string parseString(Scanner& scanner)
+{
+	const Scanner::Token* token = &scanner.getNextToken();
+	if(token->getCode() != Scanner::TC_STRING)
+	{
+		throw PARSER_EXCEPTION_EXPECTED("string");
+	}
+	return token->getValue().getString();
+}
+
 
 } // End namespace Parser

+ 5 - 4
src/Renderer/Hdr.h

@@ -6,16 +6,17 @@
 #include "Texture.h"
 #include "RsrcPtr.h"
 #include "ShaderProg.h"
+#include "Properties.h"
 
 
 /// High dynamic range lighting pass
 class Hdr: private RenderingPass
 {
-	public:
-		Texture toneFai; ///< Vertical blur pass FAI
-		Texture hblurFai; ///< pass0Fai with the horizontal blur FAI
-		Texture fai; ///< The final FAI
+	PROPERTY_R(Texture, toneFai, getToneFai) ///< Vertical blur pass FAI
+	PROPERTY_R(Texture, hblurFai, getHblurFai) ///< pass0Fai with the horizontal blur FAI
+	PROPERTY_R(Texture, fai, getFai) ///< The final FAI
 
+	public:
 		Hdr(Renderer& r_, Object* parent): RenderingPass(r_, parent) {}
 		void init(const RendererInitializer& initializer);
 		void run();

+ 3 - 3
src/Renderer/Is.cpp

@@ -176,6 +176,7 @@ void Is::drawLightPassQuad() const
 	vao->bind();
 	glDrawElements(GL_TRIANGLES, 2 * 3, GL_UNSIGNED_SHORT, 0);
 	vao->unbind();
+	ON_GL_FAIL_THROW_EXCEPTION();
 }
 
 
@@ -330,9 +331,6 @@ void Is::run()
 	// OGL stuff
 	Renderer::setViewport(0, 0, r.getWidth(), r.getHeight());
 
-	glMatrixMode(GL_MODELVIEW);
-	glLoadIdentity();
-
 	glDisable(GL_DEPTH_TEST);
 
 	// ambient pass
@@ -375,4 +373,6 @@ void Is::run()
 
 	// FBO
 	fbo.unbind();
+
+	ON_GL_FAIL_THROW_EXCEPTION();
 }

+ 4 - 3
src/Renderer/Is.h

@@ -7,6 +7,7 @@
 #include "RsrcPtr.h"
 #include "ShaderProg.h"
 #include "Math.h"
+#include "Properties.h"
 
 
 class PointLight;
@@ -20,9 +21,9 @@ class Vbo;
 /// Illumination stage
 class Is: private RenderingPass
 {
-	public:
-		Texture fai;
+	PROPERTY_R(Texture, fai, getFai) ///< The one and only FAI
 
+	public:
 		Is(Renderer& r_, Object* parent);
 		void init(const RendererInitializer& initializer);
 		void run();
@@ -45,7 +46,7 @@ class Is: private RenderingPass
 		Vao* vao; ///< This VAO is used in light passes only
 		/// @}
 
-		Vec2 planes; ///< Used to to calculate the frag pos in view space inside tha shader program
+		Vec2 planes; ///< Used to to calculate the frag pos in view space inside the shader program
 
 		/// Draws the vao that has attached the viewVectorsVbo as well. Used in light passes
 		void drawLightPassQuad() const;

+ 1 - 1
src/Renderer/MainRenderer.cpp

@@ -102,7 +102,7 @@ void MainRenderer::render(Camera& cam_)
 	glDisable(GL_DEPTH_TEST);
 	glDisable(GL_BLEND);
 	sProg->bind();
-	sProg->findUniVar("rasterImage")->setTexture(ms->getDiffuseFai(), 0);
+	sProg->findUniVar("rasterImage")->setTexture(ms->getSpecularFai(), 0);
 	//sProg->findUniVar("rasterImage")->setTexture(pps.postPassFai, 0);
 	drawQuad();
 }

+ 2 - 2
src/Renderer/Pps.cpp

@@ -123,7 +123,7 @@ void Pps::runPrePass()
 	Renderer::setViewport(0, 0, r.getWidth(), r.getHeight());
 
 	prePassSProg->bind();
-	prePassSProg->findUniVar("isFai")->setTexture(r.getIs().fai, 0);
+	prePassSProg->findUniVar("isFai")->setTexture(r.getIs().getFai(), 0);
 
 	if(ssao->isEnabled())
 	{
@@ -157,7 +157,7 @@ void Pps::runPostPass()
 
 	if(hdr->isEnabled())
 	{
-		postPassSProg->findUniVar("ppsHdrFai")->setTexture(hdr->fai, 1);
+		postPassSProg->findUniVar("ppsHdrFai")->setTexture(hdr->getFai(), 1);
 	}
 
 	r.drawQuad();

+ 5 - 6
src/Renderer/Renderer.cpp

@@ -41,8 +41,8 @@ void Renderer::init(const RendererInitializer& initializer)
 
 	// init the stages. Careful with the order!!!!!!!!!!
 	ms->init(initializer);
-	/*is.init(initializer);
-	pps.init(initializer);
+	is->init(initializer);
+	/*pps.init(initializer);
 	bs.init(initializer);*/
 
 	// quad VBOs and VAO
@@ -68,9 +68,8 @@ void Renderer::render(Camera& cam_)
 	viewProjectionMat = cam->getProjectionMatrix() * cam->getViewMatrix();
 
 	ms->run();
-
-	/*is.run();
-	pps.runPrePass();
+	is->run();
+	/*pps.runPrePass();
 	bs.run();
 	pps.runPostPass();*/
 
@@ -214,7 +213,7 @@ void Renderer::setupMaterial(const Material& mtl, const SceneNode& sceneNode, co
 
 	if(mtl.stdUniVars[Material::SUV_IS_FAI])
 	{
-		mtl.stdUniVars[Material::SUV_IS_FAI]->setTexture(is->fai, textureUnit++);
+		mtl.stdUniVars[Material::SUV_IS_FAI]->setTexture(is->getFai(), textureUnit++);
 	}
 
 	if(mtl.stdUniVars[Material::SUV_PPS_PRE_PASS_FAI])

+ 163 - 154
src/Resources/Material.cpp

@@ -49,21 +49,7 @@ Material::StdVarNameAndGlDataTypePair Material::stdUniVarInfos[SUV_NUM] =
 	{"sceneAmbientColor", GL_FLOAT_VEC3}
 };
 
-
-//======================================================================================================================
-// Stuff for custom material stage shader progs                                                                        =
-//======================================================================================================================
-
-/// A simple pair-like structure
-struct MsSwitch
-{
-	const char* switchName;
-	const char prefix;
-};
-
-
-/// See the docs for info about the switches
-static MsSwitch msSwitches [] =
+Material::PreprocDefines Material::msGenericDefines [] =
 {
 	{"DIFFUSE_MAPPING", 'd'},
 	{"NORMAL_MAPPING", 'n'},
@@ -75,6 +61,13 @@ static MsSwitch msSwitches [] =
 	{NULL, NULL}
 };
 
+Material::PreprocDefines Material::dpGenericDefines [] =
+{
+	{"ALPHA_TESTING", 'a'},
+	{"HARDWARE_SKINNING", 'h'},
+	{NULL, NULL}
+};
+
 
 //======================================================================================================================
 // Blending stuff                                                                                                      =
@@ -98,25 +91,46 @@ static BlendParam blendingParams[] =
 	{GL_ONE_MINUS_DST_ALPHA, "GL_ONE_MINUS_DST_ALPHA"},
 	{GL_SRC_ALPHA_SATURATE, "GL_SRC_ALPHA_SATURATE"},
 	{GL_SRC_COLOR, "GL_SRC_COLOR"},
-	{GL_ONE_MINUS_SRC_COLOR, "GL_ONE_MINUS_SRC_COLOR"}
+	{GL_ONE_MINUS_SRC_COLOR, "GL_ONE_MINUS_SRC_COLOR"},
+	{0, NULL}
 };
 
-const int BLEND_PARAMS_NUM = 11;
-
 static bool searchBlendEnum(const char* str, int& gl_enum)
 {
-	for(int i=0; i<BLEND_PARAMS_NUM; i++)
+	BlendParam* ptr = &blendingParams[0];
+	while(true)
 	{
-		if(!strcmp(blendingParams[i].str, str))
+		if(ptr->str == NULL)
 		{
-			gl_enum = blendingParams[i].glEnum;
+			break;
+		}
+
+		if(!strcmp(ptr->str, str))
+		{
+			gl_enum = ptr->glEnum;
 			return true;
 		}
 	}
+
 	return false;
 }
 
 
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
+Material::Material():
+	Resource(RT_MATERIAL)
+{
+	blends = false;
+	blendingSfactor = GL_ONE;
+	blendingDfactor = GL_ZERO;
+	depthTesting = true;
+	wireframe = false;
+	castsShadow = true;
+}
+
+
 //======================================================================================================================
 // load                                                                                                                =
 //======================================================================================================================
@@ -130,9 +144,9 @@ void Material::load(const char* filename)
 		token = &scanner.getNextToken();
 
 		//
-		// SHADER_PROG
+		// Shader program
 		//
-		if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "SHADER_PROG"))
+		if(Parser::isIdentifier(token, "shaderProg"))
 		{
 			if(shaderProg.get())
 			{
@@ -146,176 +160,117 @@ void Material::load(const char* filename)
 			{
 				shaderFilename = token->getValue().getString();
 			}
-			// build custom shader
-			else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getString(), "buildMsSProg"))
+			// Its { so... build custom shader
+			else if(token->getCode() == Scanner::TC_LBRACKET)
 			{
-				// (
-				token = &scanner.getNextToken();
-				if(token->getCode() != Scanner::TC_LPAREN)
+				std::string sProgFilename;
+				std::string source;
+				std::string prefix;
+
+				std::string op = Parser::parseIdentifier(scanner);
+				if(op == "customMsSProg")
 				{
-					throw PARSER_EXCEPTION_EXPECTED("(");
+					parseCustomShader(msGenericDefines, scanner, sProgFilename, source, prefix);
 				}
-
-				// shader prog
-				token = &scanner.getNextToken();
-				if(token->getCode() != Scanner::TC_STRING)
+				else if(op == "customDpSProg")
 				{
-					throw PARSER_EXCEPTION_EXPECTED("string");
+					parseCustomShader(dpGenericDefines, scanner, sProgFilename, source, prefix);
 				}
-				std::string sProgFilename = token->getValue().getString();
-
-				// get the switches
-				std::string source;
-				std::string prefix;
-				while(true)
+				else
 				{
-					token = &scanner.getNextToken();
-
-					if(token->getCode() == Scanner::TC_RPAREN)
-					{
-						break;
-					}
-
-					if(token->getCode() != Scanner::TC_IDENTIFIER)
-					{
-						throw PARSER_EXCEPTION_EXPECTED("identifier");
-					}
-
-					// Check if acceptable value. Loop the switches array
-					MsSwitch* mss = msSwitches;
-					while(mss->switchName != NULL)
-					{
-						if(!strcmp(mss->switchName, token->getString()))
-						{
-							break;
-						}
-
-						++mss;
-					}
-
-					if(mss->switchName == NULL)
-					{
-						throw PARSER_EXCEPTION("Incorrect switch " + token->getString());
-					}
-
-					source += std::string("#define ") + token->getString() + "\n";
-					prefix.push_back(mss->prefix);
-				} // end get the switches
-
-				std::sort(prefix.begin(), prefix.end());
+					throw PARSER_EXCEPTION_EXPECTED("identifier customMsSProg or customDpSProg");
+				}
 
 				shaderFilename = ShaderProg::createSrcCodeToCache(sProgFilename.c_str(), source.c_str(), prefix.c_str());
+
+				// }
+				token = &scanner.getNextToken();
+				if(token->getCode() != Scanner::TC_RBRACKET)
+				{
+					throw PARSER_EXCEPTION_EXPECTED("}");
+				}
 			}
 			else
 			{
-				throw PARSER_EXCEPTION_EXPECTED("string or buildMsSProg");
+				throw PARSER_EXCEPTION_EXPECTED("string or {");
 			}
 
 			shaderProg.loadRsrc(shaderFilename.c_str());
 		}
 		//
-		// DEPTH_PASS_MATERIAL
+		// dpMtl
 		//
-		else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "DEPTH_PASS_MATERIAL"))
+		else if(Parser::isIdentifier(token, "dpMtl"))
 		{
 			if(dpMtl.get())
 			{
 				throw PARSER_EXCEPTION("Depth material already loaded");
 			}
 
-			token = &scanner.getNextToken();
-			if(token->getCode() != Scanner::TC_STRING)
-			{
-				throw PARSER_EXCEPTION_EXPECTED("string");
-			}
-			dpMtl.loadRsrc(token->getValue().getString());
+			dpMtl.loadRsrc(Parser::parseString(scanner).c_str());
 		}
 		//
-		// BLENDS
+		// blendingStage
 		//
-		else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "BLENDS"))
+		else if(Parser::isIdentifier(token, "blendingStage"))
 		{
-			token = &scanner.getNextToken();
-			if(token->getCode() != Scanner::TC_NUMBER)
-			{
-				throw PARSER_EXCEPTION_EXPECTED("number");
-			}
-			blends = token->getValue().getInt();
+			blends = Parser::parseBool(scanner);
 		}
 		//
-		// BLENDING_SFACTOR
+		// blendFuncs
 		//
-		else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "BLENDING_SFACTOR"))
+		else if(Parser::isIdentifier(token, "blendFuncs"))
 		{
+			// {
 			token = &scanner.getNextToken();
-			if(token->getCode() != Scanner::TC_IDENTIFIER)
+			if(token->getCode() != Scanner::TC_LBRACKET)
 			{
-				throw PARSER_EXCEPTION_EXPECTED("identifier");
+				throw PARSER_EXCEPTION_EXPECTED("{");
 			}
+
+			// sFactor
+			Parser::parseIdentifier(scanner, "sFactor");
 			int gl_enum;
-			if(!searchBlendEnum(token->getValue().getString(), gl_enum))
+			if(!searchBlendEnum(Parser::parseIdentifier(scanner).c_str(), gl_enum))
 			{
 				throw PARSER_EXCEPTION("Incorrect blending factor \"" + token->getValue().getString() + "\"");
 			}
 			blendingSfactor = gl_enum;
-		}
-		//
-		// BLENDING_DFACTOR
-		//
-		else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "BLENDING_DFACTOR"))
-		{
-			token = &scanner.getNextToken();
-			if(token->getCode() != Scanner::TC_IDENTIFIER)
-			{
-				throw PARSER_EXCEPTION_EXPECTED("identifier");
-			}
-			int gl_enum;
-			if(!searchBlendEnum(token->getValue().getString(), gl_enum))
+
+			// dFactor
+			Parser::parseIdentifier(scanner, "dFactor");
+			if(!searchBlendEnum(Parser::parseIdentifier(scanner).c_str(), gl_enum))
 			{
 				throw PARSER_EXCEPTION("Incorrect blending factor \"" + token->getValue().getString() + "\"");
 			}
 			blendingDfactor = gl_enum;
+
 		}
 		//
-		// DEPTH_TESTING
+		// depthTesting
 		//
-		else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "DEPTH_TESTING"))
+		else if(Parser::isIdentifier(token, "depthTesting"))
 		{
-			token = &scanner.getNextToken();
-			if(token->getCode() != Scanner::TC_NUMBER)
-			{
-				throw PARSER_EXCEPTION_EXPECTED("number");
-			}
-			depthTesting = token->getValue().getInt();
+			depthTesting = Parser::parseBool(scanner);
 		}
 		//
-		// WIREFRAME
+		// wireframe
 		//
-		else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "WIREFRAME"))
+		else if(Parser::isIdentifier(token, "wireframe"))
 		{
-			token = &scanner.getNextToken();
-			if(token->getCode() != Scanner::TC_NUMBER)
-			{
-				throw PARSER_EXCEPTION_EXPECTED("number");
-			}
-			wireframe = token->getValue().getInt();
+			wireframe = Parser::parseBool(scanner);
 		}
 		//
-		// CASTS_SHADOW
+		// castsShadow
 		//
-		else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "CASTS_SHADOW"))
+		else if(Parser::isIdentifier(token, "castsShadow"))
 		{
-			token = &scanner.getNextToken();
-			if(token->getCode() != Scanner::TC_NUMBER)
-			{
-				throw PARSER_EXCEPTION_EXPECTED("number");
-			}
-			castsShadow = token->getValue().getInt();
+			castsShadow = Parser::parseBool(scanner);
 		}
 		//
-		// USER_DEFINED_VARS
+		// userDefinedVars
 		//
-		else if(token->getCode() == Scanner::TC_IDENTIFIER && !strcmp(token->getValue().getString(), "USER_DEFINED_VARS"))
+		else if(Parser::isIdentifier(token, "userDefinedVars"))
 		{
 			// first check if the shader is defined
 			if(shaderProg.get() == NULL)
@@ -363,15 +318,7 @@ void Material::load(const char* filename)
 				{
 					// texture
 					case GL_SAMPLER_2D:
-						token = &scanner.getNextToken();
-						if(token->getCode() == Scanner::TC_STRING)
-						{
-							var.value.texture.loadRsrc(token->getValue().getString());
-						}
-						else
-						{
-							throw PARSER_EXCEPTION_EXPECTED("string");
-						}
+						var.value.texture.loadRsrc(Parser::parseString(scanner).c_str());
 						break;
 					// float
 					case GL_FLOAT:
@@ -478,16 +425,78 @@ void Material::initStdShaderVars()
 
 
 //======================================================================================================================
-// Constructor                                                                                                         =
+// parseCustomShader                                                                                                   =
 //======================================================================================================================
-Material::Material():
-	Resource(RT_MATERIAL)
+void Material::parseCustomShader(const PreprocDefines defines[], Scanner& scanner,
+		                             std::string& shaderFilename, std::string& source, std::string& prefix)
 {
-	blends = false;
-	blendingSfactor = GL_ONE;
-	blendingDfactor = GL_ZERO;
-	depthTesting = true;
-	wireframe = false;
-	castsShadow = true;
-}
+	const Scanner::Token* token;
+
+	// {
+	token = &scanner.getNextToken();
+	if(token->getCode() != Scanner::TC_LBRACKET)
+	{
+		throw PARSER_EXCEPTION_EXPECTED("{");
+	}
+
+	// file
+	Parser::parseIdentifier(scanner, "file");
+
+	// the shader prog
+	shaderFilename = Parser::parseString(scanner);
+
+	// defines
+	Parser::parseIdentifier(scanner, "defines");
+
+	// {
+	token = &scanner.getNextToken();
+	if(token->getCode() != Scanner::TC_LBRACKET)
+	{
+		throw PARSER_EXCEPTION_EXPECTED("{");
+	}
+
+	// Get the defines
+	while(true)
+	{
+		token = &scanner.getNextToken();
+
+		// }
+		if(token->getCode() == Scanner::TC_RBRACKET)
+		{
+			break;
+		}
+		else if(token->getCode() != Scanner::TC_IDENTIFIER)
+		{
+			throw PARSER_EXCEPTION_EXPECTED("identifier");
+		}
+
+		// Check if acceptable value. Loop the switches array
+		const PreprocDefines* def = defines;
+		while(def->switchName != NULL)
+		{
+			if(!strcmp(def->switchName, token->getString()))
+			{
+				break;
+			}
+
+			++def;
+		}
 
+		if(def->switchName == NULL)
+		{
+			throw PARSER_EXCEPTION("Not acceptable define " + token->getString());
+		}
+
+		source += std::string("#define ") + token->getString() + "\n";
+		prefix.push_back(def->prefix);
+	} // end get the switches
+
+	// }
+	token = &scanner.getNextToken();
+	if(token->getCode() != Scanner::TC_RBRACKET)
+	{
+		throw PARSER_EXCEPTION_EXPECTED("}");
+	}
+
+	std::sort(prefix.begin(), prefix.end());
+}

+ 32 - 6
src/Resources/Material.h

@@ -9,6 +9,9 @@
 #include "RsrcPtr.h"
 
 
+class Scanner;
+
+
 /// Mesh material Resource
 ///
 /// Every material keeps info of how to render a MeshNode. Among this info it keeps the locations of attribute and
@@ -21,17 +24,20 @@
 /// File format:
 /// @code
 /// shaderProg <string> |
-/// 	standardMsSProg {
-/// 		shaderProg <string>
+/// {
+/// 	customMsSProg {
+/// 		file <string>
 /// 		defines {
 /// 			<identifier>
 /// 			<identifier>
 /// 			...
 /// 			<identifier>
 /// 		}
-/// 	}
+/// 	} |
+/// 	customDpSProg { <same as standardMsSProg> }
+/// }
 ///
-/// dpMtl <string>
+/// [dpMtl <string>]
 ///
 /// [blendingStage <true | false>]
 ///
@@ -51,7 +57,7 @@
 /// }]
 ///
 ///
-/// *: Has nothing to do with the blendFuncs. blendFuncs can be in material stage as well
+/// *: Has nothing to do with the blendingStage. blendFuncs can be in material stage as well
 /// **: Depends on the type of the var
 /// @endcode
 class Material: public Resource
@@ -85,6 +91,13 @@ class Material: public Resource
 			SAV_NUM
 		};
 
+		/// A simple pair-like structure
+		struct PreprocDefines
+		{
+			const char* switchName;
+			const char prefix;
+		};
+
 		/// Standard uniform variables. The Renderer sees what are applicable and sets them
 		/// After changing the enum update also:
 		/// - Some statics in Material.cpp
@@ -142,7 +155,8 @@ class Material: public Resource
 			const ShaderProg::UniVar* sProgVar;
 		}; // end UserDefinedVar
 
-
+		static PreprocDefines msGenericDefines[]; ///< Material stage defines accepted in MsGeneric.glsl
+		static PreprocDefines dpGenericDefines[]; ///< Depth pass defines accepted in DpGeneric.glsl
 		static StdVarNameAndGlDataTypePair stdAttribVarInfos[SAV_NUM];
 		static StdVarNameAndGlDataTypePair stdUniVarInfos[SUV_NUM];
 		const ShaderProg::AttribVar* stdAttribVars[SAV_NUM];
@@ -163,6 +177,18 @@ class Material: public Resource
 		void initStdShaderVars();
 
 		bool hasHWSkinning() const {return stdAttribVars[SAV_VERT_WEIGHT_BONES_NUM] != NULL;}
+
+		/// Parses the iostream for expressions like customMsSProg and customDpSProg in order to feed them into the
+		/// @ref ShaderProg::createSrcCodeToCache
+		/// @param[in] defines The available defines and their prefixes
+		/// @param[in,out] scanner The Scanner from to parse from
+		/// @param[out] shaderFilename The name of the generic shader program
+		/// @param[out] source The preprocessor source that will feed to the @ref ShaderProg::createSrcCodeToCache
+		/// @param[out] prefix The prefix of the custom shader program file that will feed to the
+		/// @ref ShaderProg::createSrcCodeToCache
+		/// @exception Exception
+		void parseCustomShader(const PreprocDefines defines[], Scanner& scanner,
+		                       std::string& shaderFilename, std::string& source, std::string& prefix);
 };
 
 

Разница между файлами не показана из-за своего большого размера
+ 1 - 2
unit-tests/build/Makefile


Некоторые файлы не были показаны из-за большого количества измененных файлов