aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/examples/10.Shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/examples/10.Shaders')
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/Makefile38
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp56
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.dev59
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.vcproj163
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc10.vcxproj231
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc11.vcxproj235
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc8.vcproj231
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc9.vcproj230
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/main.cpp443
-rw-r--r--src/others/irrlicht-1.8.1/examples/10.Shaders/tutorial.html566
10 files changed, 2252 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/Makefile b/src/others/irrlicht-1.8.1/examples/10.Shaders/Makefile
new file mode 100644
index 0000000..ff2df2a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/Makefile
@@ -0,0 +1,38 @@
1# Makefile for Irrlicht Examples
2# It's usually sufficient to change just the target name and source file list
3# and be sure that CXX is set to a valid compiler
4Target = 10.Shaders
5Sources = main.cpp
6
7# general compiler settings
8CPPFLAGS = -I../../include -I/usr/X11R6/include
9CXXFLAGS = -O3 -ffast-math
10#CXXFLAGS = -g -Wall
11
12#default target is Linux
13all: all_linux
14
15ifeq ($(HOSTTYPE), x86_64)
16LIBSELECT=64
17endif
18
19# target specific settings
20all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor
21all_linux clean_linux: SYSTEM=Linux
22all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
23all_win32 clean_win32: SYSTEM=Win32-gcc
24all_win32 clean_win32: SUF=.exe
25# name of the binary - only valid for targets which set SYSTEM
26DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
27
28all_linux all_win32:
29 $(warning Building...)
30 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
31
32clean: clean_linux clean_win32
33 $(warning Cleaning...)
34
35clean_linux clean_win32:
36 @$(RM) $(DESTPATH)
37
38.PHONY: all all_win32 clean clean_linux clean_win32
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp
new file mode 100644
index 0000000..ec37b22
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp
@@ -0,0 +1,56 @@
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2<CodeBlocks_project_file>
3 <FileVersion major="1" minor="6" />
4 <Project>
5 <Option title="Irrlicht Example 10 Shaders" />
6 <Option pch_mode="0" />
7 <Option compiler="gcc" />
8 <Build>
9 <Target title="Windows">
10 <Option platforms="Windows;" />
11 <Option output="..\..\bin\Win32-gcc\Shaders" prefix_auto="0" extension_auto="1" />
12 <Option type="1" />
13 <Option compiler="gcc" />
14 <Option projectResourceIncludeDirsRelation="1" />
15 <Compiler>
16 <Add option="-g" />
17 </Compiler>
18 <Linker>
19 <Add directory="..\..\lib\Win32-gcc" />
20 </Linker>
21 </Target>
22 <Target title="Linux">
23 <Option platforms="Unix;" />
24 <Option output="..\..\bin\Linux\Shaders" prefix_auto="0" extension_auto="0" />
25 <Option type="1" />
26 <Option compiler="gcc" />
27 <Compiler>
28 <Add option="-g" />
29 <Add option="-D_IRR_STATIC_LIB_" />
30 </Compiler>
31 <Linker>
32 <Add library="Xxf86vm" />
33 <Add library="Xcursor" />
34 <Add library="GL" />
35 <Add directory="..\..\lib\Linux" />
36 </Linker>
37 </Target>
38 </Build>
39 <VirtualTargets>
40 <Add alias="All" targets="Windows;Linux;" />
41 </VirtualTargets>
42 <Compiler>
43 <Add option="-g" />
44 <Add directory="..\..\include" />
45 </Compiler>
46 <Linker>
47 <Add library="Irrlicht" />
48 </Linker>
49 <Unit filename="main.cpp" />
50 <Extensions>
51 <code_completion />
52 <debugger />
53 <envvars />
54 </Extensions>
55 </Project>
56</CodeBlocks_project_file>
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.dev b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.dev
new file mode 100644
index 0000000..bcaa4f8
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.dev
@@ -0,0 +1,59 @@
1[Project]
2FileName=example.dev
3Name=Irrlicht Example 10 Shaders
4UnitCount=1
5Type=1
6Ver=1
7ObjFiles=
8Includes=..\..\include
9Libs=
10PrivateResource=
11ResourceIncludes=
12MakeIncludes=
13Compiler=
14CppCompiler=
15Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_
16IsCpp=1
17Icon=
18ExeOutput=../../bin/Win32-gcc
19ObjectOutput=obj
20OverrideOutput=1
21OverrideOutputName=10.Shaders.exe
22HostApplication=
23Folders=
24CommandLine=
25IncludeVersionInfo=0
26SupportXPThemes=0
27CompilerSet=0
28CompilerSettings=0000000000000000000000
29UseCustomMakefile=0
30CustomMakefile=
31
32[Unit1]
33FileName=main.cpp
34CompileCpp=1
35Folder=Projekt1
36Compile=1
37Link=1
38Priority=1000
39OverrideBuildCmd=0
40BuildCmd=
41
42[VersionInfo]
43Major=0
44Minor=1
45Release=1
46Build=1
47LanguageID=1033
48CharsetID=1252
49CompanyName=
50FileVersion=
51FileDescription=Irrlicht Engine example compiled using DevCpp and gcc
52InternalName=
53LegalCopyright=
54LegalTrademarks=
55OriginalFilename=
56ProductName=
57ProductVersion=
58AutoIncBuildNr=0
59
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.vcproj b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.vcproj
new file mode 100644
index 0000000..e730a2f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders.vcproj
@@ -0,0 +1,163 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="7.10"
5 Name="10.Shaders"
6 ProjectGUID="{A4F71E8D-4042-4909-9AB8-1BA4CF5B926D}"
7 SccProjectName=""
8 SccLocalPath="">
9 <Platforms>
10 <Platform
11 Name="Win32"/>
12 </Platforms>
13 <Configurations>
14 <Configuration
15 Name="Debug|Win32"
16 OutputDirectory=".\Debug"
17 IntermediateDirectory=".\Debug"
18 ConfigurationType="1"
19 UseOfMFC="0"
20 ATLMinimizesCRunTimeLibraryUsage="FALSE"
21 CharacterSet="2">
22 <Tool
23 Name="VCCLCompilerTool"
24 Optimization="0"
25 AdditionalIncludeDirectories="..\..\include"
26 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
27 BasicRuntimeChecks="3"
28 RuntimeLibrary="5"
29 UsePrecompiledHeader="2"
30 PrecompiledHeaderFile=".\Debug/Shaders.pch"
31 AssemblerListingLocation=".\Debug/"
32 ObjectFile=".\Debug/"
33 ProgramDataBaseFileName=".\Debug/"
34 WarningLevel="3"
35 SuppressStartupBanner="TRUE"
36 DebugInformationFormat="4"
37 CompileAs="0"/>
38 <Tool
39 Name="VCCustomBuildTool"/>
40 <Tool
41 Name="VCLinkerTool"
42 OutputFile="..\..\bin\Win32-VisualStudio\10.Shaders.exe"
43 LinkIncremental="0"
44 SuppressStartupBanner="TRUE"
45 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
46 GenerateDebugInformation="TRUE"
47 ProgramDatabaseFile=".\Debug/Shaders.pdb"
48 SubSystem="1"
49 TargetMachine="1"/>
50 <Tool
51 Name="VCMIDLTool"
52 TypeLibraryName=".\Debug/Shaders.tlb"
53 HeaderFileName=""/>
54 <Tool
55 Name="VCPostBuildEventTool"/>
56 <Tool
57 Name="VCPreBuildEventTool"/>
58 <Tool
59 Name="VCPreLinkEventTool"/>
60 <Tool
61 Name="VCResourceCompilerTool"
62 PreprocessorDefinitions="_DEBUG"
63 Culture="3079"/>
64 <Tool
65 Name="VCWebServiceProxyGeneratorTool"/>
66 <Tool
67 Name="VCXMLDataGeneratorTool"/>
68 <Tool
69 Name="VCWebDeploymentTool"/>
70 <Tool
71 Name="VCManagedWrapperGeneratorTool"/>
72 <Tool
73 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
74 </Configuration>
75 <Configuration
76 Name="Release|Win32"
77 OutputDirectory=".\Release"
78 IntermediateDirectory=".\Release"
79 ConfigurationType="1"
80 UseOfMFC="0"
81 ATLMinimizesCRunTimeLibraryUsage="FALSE"
82 CharacterSet="2">
83 <Tool
84 Name="VCCLCompilerTool"
85 Optimization="2"
86 InlineFunctionExpansion="1"
87 AdditionalIncludeDirectories="..\..\include"
88 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
89 StringPooling="TRUE"
90 RuntimeLibrary="4"
91 EnableFunctionLevelLinking="TRUE"
92 UsePrecompiledHeader="2"
93 PrecompiledHeaderFile=".\Release/Shaders.pch"
94 AssemblerListingLocation=".\Release/"
95 ObjectFile=".\Release/"
96 ProgramDataBaseFileName=".\Release/"
97 WarningLevel="3"
98 SuppressStartupBanner="TRUE"
99 CompileAs="0"/>
100 <Tool
101 Name="VCCustomBuildTool"/>
102 <Tool
103 Name="VCLinkerTool"
104 OutputFile="..\..\bin\Win32-VisualStudio\10.Shaders.exe"
105 LinkIncremental="0"
106 SuppressStartupBanner="TRUE"
107 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
108 ProgramDatabaseFile=".\Release/Shaders.pdb"
109 SubSystem="1"
110 TargetMachine="1"/>
111 <Tool
112 Name="VCMIDLTool"
113 TypeLibraryName=".\Release/Shaders.tlb"
114 HeaderFileName=""/>
115 <Tool
116 Name="VCPostBuildEventTool"/>
117 <Tool
118 Name="VCPreBuildEventTool"/>
119 <Tool
120 Name="VCPreLinkEventTool"/>
121 <Tool
122 Name="VCResourceCompilerTool"
123 PreprocessorDefinitions="NDEBUG"
124 Culture="3079"/>
125 <Tool
126 Name="VCWebServiceProxyGeneratorTool"/>
127 <Tool
128 Name="VCXMLDataGeneratorTool"/>
129 <Tool
130 Name="VCWebDeploymentTool"/>
131 <Tool
132 Name="VCManagedWrapperGeneratorTool"/>
133 <Tool
134 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
135 </Configuration>
136 </Configurations>
137 <References>
138 </References>
139 <Files>
140 <File
141 RelativePath="main.cpp">
142 <FileConfiguration
143 Name="Debug|Win32">
144 <Tool
145 Name="VCCLCompilerTool"
146 Optimization="0"
147 AdditionalIncludeDirectories=""
148 PreprocessorDefinitions=""
149 BasicRuntimeChecks="3"/>
150 </FileConfiguration>
151 <FileConfiguration
152 Name="Release|Win32">
153 <Tool
154 Name="VCCLCompilerTool"
155 Optimization="2"
156 AdditionalIncludeDirectories=""
157 PreprocessorDefinitions=""/>
158 </FileConfiguration>
159 </File>
160 </Files>
161 <Globals>
162 </Globals>
163</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc10.vcxproj b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc10.vcxproj
new file mode 100644
index 0000000..c2a526e
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc10.vcxproj
@@ -0,0 +1,231 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectName>10.Shaders</ProjectName>
23 <ProjectGuid>{27158C82-CD15-4A9B-9848-35E7065B209F}</ProjectGuid>
24 <RootNamespace>Shaders</RootNamespace>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
28 <ConfigurationType>Application</ConfigurationType>
29 <UseOfMfc>false</UseOfMfc>
30 <CharacterSet>MultiByte</CharacterSet>
31 </PropertyGroup>
32 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
33 <ConfigurationType>Application</ConfigurationType>
34 <UseOfMfc>false</UseOfMfc>
35 <CharacterSet>MultiByte</CharacterSet>
36 </PropertyGroup>
37 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
38 <ConfigurationType>Application</ConfigurationType>
39 <UseOfMfc>false</UseOfMfc>
40 <CharacterSet>MultiByte</CharacterSet>
41 </PropertyGroup>
42 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43 <ConfigurationType>Application</ConfigurationType>
44 <UseOfMfc>false</UseOfMfc>
45 <CharacterSet>MultiByte</CharacterSet>
46 </PropertyGroup>
47 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
48 <ImportGroup Label="ExtensionSettings">
49 </ImportGroup>
50 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
51 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
52 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
53 </ImportGroup>
54 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
55 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
57 </ImportGroup>
58 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
59 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
60 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
61 </ImportGroup>
62 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
63 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
65 </ImportGroup>
66 <PropertyGroup Label="UserMacros" />
67 <PropertyGroup>
68 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
69 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
70 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
71 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
73 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
74 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
75 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
76 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
77 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
78 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
79 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
80 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
81 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
82 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
83 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
84 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
85 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
86 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
87 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
88 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
89 </PropertyGroup>
90 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
91 <Midl>
92 <TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
93 <HeaderFileName>
94 </HeaderFileName>
95 </Midl>
96 <ClCompile>
97 <Optimization>Disabled</Optimization>
98 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
99 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
100 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
101 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
102 <PrecompiledHeader>
103 </PrecompiledHeader>
104 <WarningLevel>Level3</WarningLevel>
105 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
106 </ClCompile>
107 <ResourceCompile>
108 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
109 <Culture>0x0c07</Culture>
110 </ResourceCompile>
111 <Link>
112 <OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
113 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
114 <GenerateDebugInformation>true</GenerateDebugInformation>
115 <SubSystem>Console</SubSystem>
116 <DataExecutionPrevention>
117 </DataExecutionPrevention>
118 </Link>
119 </ItemDefinitionGroup>
120 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
121 <Midl>
122 <TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
123 <HeaderFileName>
124 </HeaderFileName>
125 </Midl>
126 <ClCompile>
127 <Optimization>Disabled</Optimization>
128 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
129 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
130 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
131 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
132 <PrecompiledHeader>
133 </PrecompiledHeader>
134 <WarningLevel>Level3</WarningLevel>
135 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
136 </ClCompile>
137 <ResourceCompile>
138 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
139 <Culture>0x0c07</Culture>
140 </ResourceCompile>
141 <Link>
142 <OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
143 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
144 <GenerateDebugInformation>true</GenerateDebugInformation>
145 <SubSystem>Console</SubSystem>
146 <DataExecutionPrevention>
147 </DataExecutionPrevention>
148 </Link>
149 </ItemDefinitionGroup>
150 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
151 <Midl>
152 <TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
153 <HeaderFileName>
154 </HeaderFileName>
155 </Midl>
156 <ClCompile>
157 <Optimization>MaxSpeed</Optimization>
158 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
159 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
160 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
161 <StringPooling>true</StringPooling>
162 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
163 <FunctionLevelLinking>true</FunctionLevelLinking>
164 <PrecompiledHeader>
165 </PrecompiledHeader>
166 <WarningLevel>Level3</WarningLevel>
167 </ClCompile>
168 <ResourceCompile>
169 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
170 <Culture>0x0c07</Culture>
171 </ResourceCompile>
172 <Link>
173 <OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
174 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
175 <SubSystem>Console</SubSystem>
176 <DataExecutionPrevention>
177 </DataExecutionPrevention>
178 </Link>
179 </ItemDefinitionGroup>
180 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
181 <Midl>
182 <TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
183 <HeaderFileName>
184 </HeaderFileName>
185 </Midl>
186 <ClCompile>
187 <Optimization>MaxSpeed</Optimization>
188 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
189 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
190 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
191 <StringPooling>true</StringPooling>
192 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
193 <FunctionLevelLinking>true</FunctionLevelLinking>
194 <PrecompiledHeader>
195 </PrecompiledHeader>
196 <WarningLevel>Level3</WarningLevel>
197 </ClCompile>
198 <ResourceCompile>
199 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
200 <Culture>0x0c07</Culture>
201 </ResourceCompile>
202 <Link>
203 <OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
204 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
205 <SubSystem>Console</SubSystem>
206 <DataExecutionPrevention>
207 </DataExecutionPrevention>
208 </Link>
209 </ItemDefinitionGroup>
210 <ItemGroup>
211 <ClCompile Include="main.cpp">
212 <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
213 <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
214 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
215 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
216 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
217 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
218 <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
219 <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
220 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
221 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
222 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
223 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
224 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
225 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
226 </ClCompile>
227 </ItemGroup>
228 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
229 <ImportGroup Label="ExtensionTargets">
230 </ImportGroup>
231</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc11.vcxproj b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc11.vcxproj
new file mode 100644
index 0000000..30ae642
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc11.vcxproj
@@ -0,0 +1,235 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectName>10.Shaders</ProjectName>
23 <ProjectGuid>{27158C82-CD15-4A9B-9848-35E7065B209F}</ProjectGuid>
24 <RootNamespace>Shaders</RootNamespace>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
28 <ConfigurationType>Application</ConfigurationType>
29 <UseOfMfc>false</UseOfMfc>
30 <CharacterSet>MultiByte</CharacterSet>
31 <PlatformToolset>v110</PlatformToolset>
32 </PropertyGroup>
33 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
34 <ConfigurationType>Application</ConfigurationType>
35 <UseOfMfc>false</UseOfMfc>
36 <CharacterSet>MultiByte</CharacterSet>
37 <PlatformToolset>v110</PlatformToolset>
38 </PropertyGroup>
39 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
40 <ConfigurationType>Application</ConfigurationType>
41 <UseOfMfc>false</UseOfMfc>
42 <CharacterSet>MultiByte</CharacterSet>
43 <PlatformToolset>v110</PlatformToolset>
44 </PropertyGroup>
45 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
46 <ConfigurationType>Application</ConfigurationType>
47 <UseOfMfc>false</UseOfMfc>
48 <CharacterSet>MultiByte</CharacterSet>
49 <PlatformToolset>v110</PlatformToolset>
50 </PropertyGroup>
51 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
52 <ImportGroup Label="ExtensionSettings">
53 </ImportGroup>
54 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
55 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
57 </ImportGroup>
58 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
59 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
60 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
61 </ImportGroup>
62 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
63 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
65 </ImportGroup>
66 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
67 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
69 </ImportGroup>
70 <PropertyGroup Label="UserMacros" />
71 <PropertyGroup>
72 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
73 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
74 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
75 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
76 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
77 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
78 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
79 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
80 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
81 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
82 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
83 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
84 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
85 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
86 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
87 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
88 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
89 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
90 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
91 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
92 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
93 </PropertyGroup>
94 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
95 <Midl>
96 <TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
97 <HeaderFileName>
98 </HeaderFileName>
99 </Midl>
100 <ClCompile>
101 <Optimization>Disabled</Optimization>
102 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
103 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
105 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
106 <PrecompiledHeader>
107 </PrecompiledHeader>
108 <WarningLevel>Level3</WarningLevel>
109 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
110 </ClCompile>
111 <ResourceCompile>
112 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
113 <Culture>0x0c07</Culture>
114 </ResourceCompile>
115 <Link>
116 <OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
117 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
118 <GenerateDebugInformation>true</GenerateDebugInformation>
119 <SubSystem>Console</SubSystem>
120 <DataExecutionPrevention>
121 </DataExecutionPrevention>
122 </Link>
123 </ItemDefinitionGroup>
124 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
125 <Midl>
126 <TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
127 <HeaderFileName>
128 </HeaderFileName>
129 </Midl>
130 <ClCompile>
131 <Optimization>Disabled</Optimization>
132 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
133 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
134 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
135 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
136 <PrecompiledHeader>
137 </PrecompiledHeader>
138 <WarningLevel>Level3</WarningLevel>
139 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
140 </ClCompile>
141 <ResourceCompile>
142 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
143 <Culture>0x0c07</Culture>
144 </ResourceCompile>
145 <Link>
146 <OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
147 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
148 <GenerateDebugInformation>true</GenerateDebugInformation>
149 <SubSystem>Console</SubSystem>
150 <DataExecutionPrevention>
151 </DataExecutionPrevention>
152 </Link>
153 </ItemDefinitionGroup>
154 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
155 <Midl>
156 <TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
157 <HeaderFileName>
158 </HeaderFileName>
159 </Midl>
160 <ClCompile>
161 <Optimization>MaxSpeed</Optimization>
162 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
163 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
164 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
165 <StringPooling>true</StringPooling>
166 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
167 <FunctionLevelLinking>true</FunctionLevelLinking>
168 <PrecompiledHeader>
169 </PrecompiledHeader>
170 <WarningLevel>Level3</WarningLevel>
171 </ClCompile>
172 <ResourceCompile>
173 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
174 <Culture>0x0c07</Culture>
175 </ResourceCompile>
176 <Link>
177 <OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
178 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
179 <SubSystem>Console</SubSystem>
180 <DataExecutionPrevention>
181 </DataExecutionPrevention>
182 </Link>
183 </ItemDefinitionGroup>
184 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
185 <Midl>
186 <TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
187 <HeaderFileName>
188 </HeaderFileName>
189 </Midl>
190 <ClCompile>
191 <Optimization>MaxSpeed</Optimization>
192 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
193 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
194 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
195 <StringPooling>true</StringPooling>
196 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
197 <FunctionLevelLinking>true</FunctionLevelLinking>
198 <PrecompiledHeader>
199 </PrecompiledHeader>
200 <WarningLevel>Level3</WarningLevel>
201 </ClCompile>
202 <ResourceCompile>
203 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
204 <Culture>0x0c07</Culture>
205 </ResourceCompile>
206 <Link>
207 <OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
208 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
209 <SubSystem>Console</SubSystem>
210 <DataExecutionPrevention>
211 </DataExecutionPrevention>
212 </Link>
213 </ItemDefinitionGroup>
214 <ItemGroup>
215 <ClCompile Include="main.cpp">
216 <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
217 <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
218 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
219 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
220 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
221 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
222 <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
223 <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
224 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
225 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
226 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
227 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
228 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
229 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
230 </ClCompile>
231 </ItemGroup>
232 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
233 <ImportGroup Label="ExtensionTargets">
234 </ImportGroup>
235</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc8.vcproj b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc8.vcproj
new file mode 100644
index 0000000..f107140
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc8.vcproj
@@ -0,0 +1,231 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="10.Shaders_vc8"
6 ProjectGUID="{27158C82-CD15-4A9B-9848-35E7065B209F}"
7 RootNamespace="Shaders_vc8"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory=".\Debug"
20 IntermediateDirectory=".\Debug"
21 ConfigurationType="1"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 UseOfMFC="0"
24 ATLMinimizesCRunTimeLibraryUsage="false"
25 CharacterSet="2"
26 >
27 <Tool
28 Name="VCPreBuildEventTool"
29 />
30 <Tool
31 Name="VCCustomBuildTool"
32 />
33 <Tool
34 Name="VCXMLDataGeneratorTool"
35 />
36 <Tool
37 Name="VCWebServiceProxyGeneratorTool"
38 />
39 <Tool
40 Name="VCMIDLTool"
41 TypeLibraryName=".\Debug/Shaders.tlb"
42 HeaderFileName=""
43 />
44 <Tool
45 Name="VCCLCompilerTool"
46 Optimization="0"
47 AdditionalIncludeDirectories="..\..\include"
48 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
49 BasicRuntimeChecks="3"
50 RuntimeLibrary="1"
51 UsePrecompiledHeader="0"
52 PrecompiledHeaderFile=".\Debug/Shaders.pch"
53 AssemblerListingLocation=".\Debug/"
54 ObjectFile=".\Debug/"
55 ProgramDataBaseFileName=".\Debug/"
56 WarningLevel="3"
57 SuppressStartupBanner="true"
58 DebugInformationFormat="4"
59 CompileAs="0"
60 />
61 <Tool
62 Name="VCManagedResourceCompilerTool"
63 />
64 <Tool
65 Name="VCResourceCompilerTool"
66 PreprocessorDefinitions="_DEBUG"
67 Culture="3079"
68 />
69 <Tool
70 Name="VCPreLinkEventTool"
71 />
72 <Tool
73 Name="VCLinkerTool"
74 OutputFile="..\..\bin\Win32-VisualStudio\10.Shaders.exe"
75 LinkIncremental="0"
76 SuppressStartupBanner="true"
77 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
78 GenerateDebugInformation="true"
79 ProgramDatabaseFile=".\Debug/Shaders.pdb"
80 SubSystem="1"
81 TargetMachine="1"
82 />
83 <Tool
84 Name="VCALinkTool"
85 />
86 <Tool
87 Name="VCManifestTool"
88 />
89 <Tool
90 Name="VCXDCMakeTool"
91 />
92 <Tool
93 Name="VCBscMakeTool"
94 />
95 <Tool
96 Name="VCFxCopTool"
97 />
98 <Tool
99 Name="VCAppVerifierTool"
100 />
101 <Tool
102 Name="VCWebDeploymentTool"
103 />
104 <Tool
105 Name="VCPostBuildEventTool"
106 />
107 </Configuration>
108 <Configuration
109 Name="Release|Win32"
110 OutputDirectory=".\Release"
111 IntermediateDirectory=".\Release"
112 ConfigurationType="1"
113 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
114 UseOfMFC="0"
115 ATLMinimizesCRunTimeLibraryUsage="false"
116 CharacterSet="2"
117 >
118 <Tool
119 Name="VCPreBuildEventTool"
120 />
121 <Tool
122 Name="VCCustomBuildTool"
123 />
124 <Tool
125 Name="VCXMLDataGeneratorTool"
126 />
127 <Tool
128 Name="VCWebServiceProxyGeneratorTool"
129 />
130 <Tool
131 Name="VCMIDLTool"
132 TypeLibraryName=".\Release/Shaders.tlb"
133 HeaderFileName=""
134 />
135 <Tool
136 Name="VCCLCompilerTool"
137 Optimization="2"
138 InlineFunctionExpansion="1"
139 AdditionalIncludeDirectories="..\..\include"
140 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
141 StringPooling="true"
142 RuntimeLibrary="0"
143 EnableFunctionLevelLinking="true"
144 UsePrecompiledHeader="0"
145 PrecompiledHeaderFile=".\Release/Shaders.pch"
146 AssemblerListingLocation=".\Release/"
147 ObjectFile=".\Release/"
148 ProgramDataBaseFileName=".\Release/"
149 WarningLevel="3"
150 SuppressStartupBanner="true"
151 CompileAs="0"
152 />
153 <Tool
154 Name="VCManagedResourceCompilerTool"
155 />
156 <Tool
157 Name="VCResourceCompilerTool"
158 PreprocessorDefinitions="NDEBUG"
159 Culture="3079"
160 />
161 <Tool
162 Name="VCPreLinkEventTool"
163 />
164 <Tool
165 Name="VCLinkerTool"
166 OutputFile="..\..\bin\Win32-VisualStudio\10.Shaders.exe"
167 LinkIncremental="0"
168 SuppressStartupBanner="true"
169 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
170 ProgramDatabaseFile=".\Release/Shaders.pdb"
171 SubSystem="1"
172 TargetMachine="1"
173 />
174 <Tool
175 Name="VCALinkTool"
176 />
177 <Tool
178 Name="VCManifestTool"
179 />
180 <Tool
181 Name="VCXDCMakeTool"
182 />
183 <Tool
184 Name="VCBscMakeTool"
185 />
186 <Tool
187 Name="VCFxCopTool"
188 />
189 <Tool
190 Name="VCAppVerifierTool"
191 />
192 <Tool
193 Name="VCWebDeploymentTool"
194 />
195 <Tool
196 Name="VCPostBuildEventTool"
197 />
198 </Configuration>
199 </Configurations>
200 <References>
201 </References>
202 <Files>
203 <File
204 RelativePath="main.cpp"
205 >
206 <FileConfiguration
207 Name="Debug|Win32"
208 >
209 <Tool
210 Name="VCCLCompilerTool"
211 Optimization="0"
212 AdditionalIncludeDirectories=""
213 PreprocessorDefinitions=""
214 BasicRuntimeChecks="3"
215 />
216 </FileConfiguration>
217 <FileConfiguration
218 Name="Release|Win32"
219 >
220 <Tool
221 Name="VCCLCompilerTool"
222 Optimization="2"
223 AdditionalIncludeDirectories=""
224 PreprocessorDefinitions=""
225 />
226 </FileConfiguration>
227 </File>
228 </Files>
229 <Globals>
230 </Globals>
231</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc9.vcproj b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc9.vcproj
new file mode 100644
index 0000000..d870b03
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc9.vcproj
@@ -0,0 +1,230 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9.00"
5 Name="10.Shaders_vc9"
6 ProjectGUID="{27158C82-CD15-4A9B-9848-35E7065B209F}"
7 RootNamespace="Shaders_vc9"
8 TargetFrameworkVersion="131072"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory=".\Debug"
21 IntermediateDirectory=".\Debug"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 UseOfMFC="0"
25 ATLMinimizesCRunTimeLibraryUsage="false"
26 CharacterSet="2"
27 >
28 <Tool
29 Name="VCPreBuildEventTool"
30 />
31 <Tool
32 Name="VCCustomBuildTool"
33 />
34 <Tool
35 Name="VCXMLDataGeneratorTool"
36 />
37 <Tool
38 Name="VCWebServiceProxyGeneratorTool"
39 />
40 <Tool
41 Name="VCMIDLTool"
42 TypeLibraryName=".\Debug/Shaders.tlb"
43 HeaderFileName=""
44 />
45 <Tool
46 Name="VCCLCompilerTool"
47 Optimization="0"
48 AdditionalIncludeDirectories="..\..\include"
49 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
50 BasicRuntimeChecks="3"
51 RuntimeLibrary="1"
52 UsePrecompiledHeader="0"
53 PrecompiledHeaderFile=".\Debug/Shaders.pch"
54 AssemblerListingLocation=".\Debug/"
55 ObjectFile=".\Debug/"
56 ProgramDataBaseFileName=".\Debug/"
57 WarningLevel="3"
58 SuppressStartupBanner="true"
59 DebugInformationFormat="4"
60 CompileAs="0"
61 />
62 <Tool
63 Name="VCManagedResourceCompilerTool"
64 />
65 <Tool
66 Name="VCResourceCompilerTool"
67 PreprocessorDefinitions="_DEBUG"
68 Culture="3079"
69 />
70 <Tool
71 Name="VCPreLinkEventTool"
72 />
73 <Tool
74 Name="VCLinkerTool"
75 OutputFile="..\..\bin\Win32-VisualStudio\10.Shaders.exe"
76 LinkIncremental="0"
77 SuppressStartupBanner="true"
78 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
79 GenerateDebugInformation="true"
80 ProgramDatabaseFile=".\Debug/Shaders.pdb"
81 SubSystem="1"
82 RandomizedBaseAddress="1"
83 DataExecutionPrevention="0"
84 TargetMachine="1"
85 />
86 <Tool
87 Name="VCALinkTool"
88 />
89 <Tool
90 Name="VCManifestTool"
91 />
92 <Tool
93 Name="VCXDCMakeTool"
94 />
95 <Tool
96 Name="VCBscMakeTool"
97 />
98 <Tool
99 Name="VCFxCopTool"
100 />
101 <Tool
102 Name="VCAppVerifierTool"
103 />
104 <Tool
105 Name="VCPostBuildEventTool"
106 />
107 </Configuration>
108 <Configuration
109 Name="Release|Win32"
110 OutputDirectory=".\Release"
111 IntermediateDirectory=".\Release"
112 ConfigurationType="1"
113 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
114 UseOfMFC="0"
115 ATLMinimizesCRunTimeLibraryUsage="false"
116 CharacterSet="2"
117 >
118 <Tool
119 Name="VCPreBuildEventTool"
120 />
121 <Tool
122 Name="VCCustomBuildTool"
123 />
124 <Tool
125 Name="VCXMLDataGeneratorTool"
126 />
127 <Tool
128 Name="VCWebServiceProxyGeneratorTool"
129 />
130 <Tool
131 Name="VCMIDLTool"
132 TypeLibraryName=".\Release/Shaders.tlb"
133 HeaderFileName=""
134 />
135 <Tool
136 Name="VCCLCompilerTool"
137 Optimization="2"
138 InlineFunctionExpansion="1"
139 AdditionalIncludeDirectories="..\..\include"
140 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
141 StringPooling="true"
142 RuntimeLibrary="0"
143 EnableFunctionLevelLinking="true"
144 UsePrecompiledHeader="0"
145 PrecompiledHeaderFile=".\Release/Shaders.pch"
146 AssemblerListingLocation=".\Release/"
147 ObjectFile=".\Release/"
148 ProgramDataBaseFileName=".\Release/"
149 WarningLevel="3"
150 SuppressStartupBanner="true"
151 CompileAs="0"
152 />
153 <Tool
154 Name="VCManagedResourceCompilerTool"
155 />
156 <Tool
157 Name="VCResourceCompilerTool"
158 PreprocessorDefinitions="NDEBUG"
159 Culture="3079"
160 />
161 <Tool
162 Name="VCPreLinkEventTool"
163 />
164 <Tool
165 Name="VCLinkerTool"
166 OutputFile="..\..\bin\Win32-VisualStudio\10.Shaders.exe"
167 LinkIncremental="0"
168 SuppressStartupBanner="true"
169 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
170 ProgramDatabaseFile=".\Release/Shaders.pdb"
171 SubSystem="1"
172 RandomizedBaseAddress="1"
173 DataExecutionPrevention="0"
174 TargetMachine="1"
175 />
176 <Tool
177 Name="VCALinkTool"
178 />
179 <Tool
180 Name="VCManifestTool"
181 />
182 <Tool
183 Name="VCXDCMakeTool"
184 />
185 <Tool
186 Name="VCBscMakeTool"
187 />
188 <Tool
189 Name="VCFxCopTool"
190 />
191 <Tool
192 Name="VCAppVerifierTool"
193 />
194 <Tool
195 Name="VCPostBuildEventTool"
196 />
197 </Configuration>
198 </Configurations>
199 <References>
200 </References>
201 <Files>
202 <File
203 RelativePath="main.cpp"
204 >
205 <FileConfiguration
206 Name="Debug|Win32"
207 >
208 <Tool
209 Name="VCCLCompilerTool"
210 Optimization="0"
211 AdditionalIncludeDirectories=""
212 PreprocessorDefinitions=""
213 BasicRuntimeChecks="3"
214 />
215 </FileConfiguration>
216 <FileConfiguration
217 Name="Release|Win32"
218 >
219 <Tool
220 Name="VCCLCompilerTool"
221 Optimization="2"
222 AdditionalIncludeDirectories=""
223 PreprocessorDefinitions=""
224 />
225 </FileConfiguration>
226 </File>
227 </Files>
228 <Globals>
229 </Globals>
230</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/main.cpp b/src/others/irrlicht-1.8.1/examples/10.Shaders/main.cpp
new file mode 100644
index 0000000..269c47f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/main.cpp
@@ -0,0 +1,443 @@
1/** Example 010 Shaders
2
3This tutorial shows how to use shaders for D3D8, D3D9, OpenGL, and Cg with the
4engine and how to create new material types with them. It also shows how to
5disable the generation of mipmaps at texture loading, and how to use text scene
6nodes.
7
8This tutorial does not explain how shaders work. I would recommend to read the
9D3D, OpenGL, or Cg documentation, to search a tutorial, or to read a book about
10this.
11
12At first, we need to include all headers and do the stuff we always do, like in
13nearly all other tutorials:
14*/
15#include <irrlicht.h>
16#include <iostream>
17#include "driverChoice.h"
18
19using namespace irr;
20
21#ifdef _MSC_VER
22#pragma comment(lib, "Irrlicht.lib")
23#endif
24
25/*
26Because we want to use some interesting shaders in this tutorials, we need to
27set some data for them to make them able to compute nice colors. In this
28example, we'll use a simple vertex shader which will calculate the color of the
29vertex based on the position of the camera.
30For this, the shader needs the following data: The inverted world matrix for
31transforming the normal, the clip matrix for transforming the position, the
32camera position and the world position of the object for the calculation of the
33angle of light, and the color of the light. To be able to tell the shader all
34this data every frame, we have to derive a class from the
35IShaderConstantSetCallBack interface and override its only method, namely
36OnSetConstants(). This method will be called every time the material is set.
37The method setVertexShaderConstant() of the IMaterialRendererServices interface
38is used to set the data the shader needs. If the user chose to use a High Level
39shader language like HLSL instead of Assembler in this example, you have to set
40the variable name as parameter instead of the register index.
41*/
42
43IrrlichtDevice* device = 0;
44bool UseHighLevelShaders = false;
45bool UseCgShaders = false;
46
47class MyShaderCallBack : public video::IShaderConstantSetCallBack
48{
49public:
50
51 virtual void OnSetConstants(video::IMaterialRendererServices* services,
52 s32 userData)
53 {
54 video::IVideoDriver* driver = services->getVideoDriver();
55
56 // set inverted world matrix
57 // if we are using highlevel shaders (the user can select this when
58 // starting the program), we must set the constants by name.
59
60 core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD);
61 invWorld.makeInverse();
62
63 if (UseHighLevelShaders)
64 services->setVertexShaderConstant("mInvWorld", invWorld.pointer(), 16);
65 else
66 services->setVertexShaderConstant(invWorld.pointer(), 0, 4);
67
68 // set clip matrix
69
70 core::matrix4 worldViewProj;
71 worldViewProj = driver->getTransform(video::ETS_PROJECTION);
72 worldViewProj *= driver->getTransform(video::ETS_VIEW);
73 worldViewProj *= driver->getTransform(video::ETS_WORLD);
74
75 if (UseHighLevelShaders)
76 services->setVertexShaderConstant("mWorldViewProj", worldViewProj.pointer(), 16);
77 else
78 services->setVertexShaderConstant(worldViewProj.pointer(), 4, 4);
79
80 // set camera position
81
82 core::vector3df pos = device->getSceneManager()->
83 getActiveCamera()->getAbsolutePosition();
84
85 if (UseHighLevelShaders)
86 services->setVertexShaderConstant("mLightPos", reinterpret_cast<f32*>(&pos), 3);
87 else
88 services->setVertexShaderConstant(reinterpret_cast<f32*>(&pos), 8, 1);
89
90 // set light color
91
92 video::SColorf col(0.0f,1.0f,1.0f,0.0f);
93
94 if (UseHighLevelShaders)
95 services->setVertexShaderConstant("mLightColor",
96 reinterpret_cast<f32*>(&col), 4);
97 else
98 services->setVertexShaderConstant(reinterpret_cast<f32*>(&col), 9, 1);
99
100 // set transposed world matrix
101
102 core::matrix4 world = driver->getTransform(video::ETS_WORLD);
103 world = world.getTransposed();
104
105 if (UseHighLevelShaders)
106 {
107 services->setVertexShaderConstant("mTransWorld", world.pointer(), 16);
108
109 // set texture, for textures you can use both an int and a float setPixelShaderConstant interfaces (You need it only for an OpenGL driver).
110 s32 TextureLayerID = 0;
111 if (UseHighLevelShaders)
112 services->setPixelShaderConstant("myTexture", &TextureLayerID, 1);
113 }
114 else
115 services->setVertexShaderConstant(world.pointer(), 10, 4);
116 }
117};
118
119/*
120The next few lines start up the engine just like in most other tutorials
121before. But in addition, we ask the user if he wants to use high level shaders
122in this example, if he selected a driver which is capable of doing so.
123*/
124int main()
125{
126 // ask user for driver
127 video::E_DRIVER_TYPE driverType=driverChoiceConsole();
128 if (driverType==video::EDT_COUNT)
129 return 1;
130
131 // ask the user if we should use high level shaders for this example
132 if (driverType == video::EDT_DIRECT3D9 ||
133 driverType == video::EDT_OPENGL)
134 {
135 char i;
136 printf("Please press 'y' if you want to use high level shaders.\n");
137 std::cin >> i;
138 if (i == 'y')
139 {
140 UseHighLevelShaders = true;
141 printf("Please press 'y' if you want to use Cg shaders.\n");
142 std::cin >> i;
143 if (i == 'y')
144 UseCgShaders = true;
145 }
146 }
147
148 // create device
149 device = createDevice(driverType, core::dimension2d<u32>(640, 480));
150
151 if (device == 0)
152 return 1; // could not create selected driver.
153
154 video::IVideoDriver* driver = device->getVideoDriver();
155 scene::ISceneManager* smgr = device->getSceneManager();
156 gui::IGUIEnvironment* gui = device->getGUIEnvironment();
157
158 // Make sure we don't try Cg without support for it
159 if (UseCgShaders && !driver->queryFeature(video::EVDF_CG))
160 {
161 printf("Warning: No Cg support, disabling.\n");
162 UseCgShaders=false;
163 }
164
165 /*
166 Now for the more interesting parts. If we are using Direct3D, we want
167 to load vertex and pixel shader programs, if we have OpenGL, we want to
168 use ARB fragment and vertex programs. I wrote the corresponding
169 programs down into the files d3d8.ps, d3d8.vs, d3d9.ps, d3d9.vs,
170 opengl.ps and opengl.vs. We only need the right filenames now. This is
171 done in the following switch. Note, that it is not necessary to write
172 the shaders into text files, like in this example. You can even write
173 the shaders directly as strings into the cpp source file, and use later
174 addShaderMaterial() instead of addShaderMaterialFromFiles().
175 */
176
177 io::path vsFileName; // filename for the vertex shader
178 io::path psFileName; // filename for the pixel shader
179
180 switch(driverType)
181 {
182 case video::EDT_DIRECT3D8:
183 psFileName = "../../media/d3d8.psh";
184 vsFileName = "../../media/d3d8.vsh";
185 break;
186 case video::EDT_DIRECT3D9:
187 if (UseHighLevelShaders)
188 {
189 // Cg can also handle this syntax
190 psFileName = "../../media/d3d9.hlsl";
191 vsFileName = psFileName; // both shaders are in the same file
192 }
193 else
194 {
195 psFileName = "../../media/d3d9.psh";
196 vsFileName = "../../media/d3d9.vsh";
197 }
198 break;
199
200 case video::EDT_OPENGL:
201 if (UseHighLevelShaders)
202 {
203 if (!UseCgShaders)
204 {
205 psFileName = "../../media/opengl.frag";
206 vsFileName = "../../media/opengl.vert";
207 }
208 else
209 {
210 // Use HLSL syntax for Cg
211 psFileName = "../../media/d3d9.hlsl";
212 vsFileName = psFileName; // both shaders are in the same file
213 }
214 }
215 else
216 {
217 psFileName = "../../media/opengl.psh";
218 vsFileName = "../../media/opengl.vsh";
219 }
220 break;
221 }
222
223 /*
224 In addition, we check if the hardware and the selected renderer is
225 capable of executing the shaders we want. If not, we simply set the
226 filename string to 0. This is not necessary, but useful in this
227 example: For example, if the hardware is able to execute vertex shaders
228 but not pixel shaders, we create a new material which only uses the
229 vertex shader, and no pixel shader. Otherwise, if we would tell the
230 engine to create this material and the engine sees that the hardware
231 wouldn't be able to fulfill the request completely, it would not
232 create any new material at all. So in this example you would see at
233 least the vertex shader in action, without the pixel shader.
234 */
235
236 if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) &&
237 !driver->queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1))
238 {
239 device->getLogger()->log("WARNING: Pixel shaders disabled "\
240 "because of missing driver/hardware support.");
241 psFileName = "";
242 }
243
244 if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) &&
245 !driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1))
246 {
247 device->getLogger()->log("WARNING: Vertex shaders disabled "\
248 "because of missing driver/hardware support.");
249 vsFileName = "";
250 }
251
252 /*
253 Now lets create the new materials. As you maybe know from previous
254 examples, a material type in the Irrlicht engine is set by simply
255 changing the MaterialType value in the SMaterial struct. And this value
256 is just a simple 32 bit value, like video::EMT_SOLID. So we only need
257 the engine to create a new value for us which we can set there. To do
258 this, we get a pointer to the IGPUProgrammingServices and call
259 addShaderMaterialFromFiles(), which returns such a new 32 bit value.
260 That's all.
261
262 The parameters to this method are the following: First, the names of
263 the files containing the code of the vertex and the pixel shader. If
264 you would use addShaderMaterial() instead, you would not need file
265 names, then you could write the code of the shader directly as string.
266 The following parameter is a pointer to the IShaderConstantSetCallBack
267 class we wrote at the beginning of this tutorial. If you don't want to
268 set constants, set this to 0. The last parameter tells the engine which
269 material it should use as base material.
270
271 To demonstrate this, we create two materials with a different base
272 material, one with EMT_SOLID and one with EMT_TRANSPARENT_ADD_COLOR.
273 */
274
275 // create materials
276
277 video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices();
278 s32 newMaterialType1 = 0;
279 s32 newMaterialType2 = 0;
280
281 if (gpu)
282 {
283 MyShaderCallBack* mc = new MyShaderCallBack();
284
285 // create the shaders depending on if the user wanted high level
286 // or low level shaders:
287
288 if (UseHighLevelShaders)
289 {
290 // Choose the desired shader type. Default is the native
291 // shader type for the driver, for Cg pass the special
292 // enum value EGSL_CG
293 const video::E_GPU_SHADING_LANGUAGE shadingLanguage =
294 UseCgShaders ? video::EGSL_CG:video::EGSL_DEFAULT;
295
296 // create material from high level shaders (hlsl, glsl or cg)
297
298 newMaterialType1 = gpu->addHighLevelShaderMaterialFromFiles(
299 vsFileName, "vertexMain", video::EVST_VS_1_1,
300 psFileName, "pixelMain", video::EPST_PS_1_1,
301 mc, video::EMT_SOLID, 0, shadingLanguage);
302
303 newMaterialType2 = gpu->addHighLevelShaderMaterialFromFiles(
304 vsFileName, "vertexMain", video::EVST_VS_1_1,
305 psFileName, "pixelMain", video::EPST_PS_1_1,
306 mc, video::EMT_TRANSPARENT_ADD_COLOR, 0 , shadingLanguage);
307 }
308 else
309 {
310 // create material from low level shaders (asm or arb_asm)
311
312 newMaterialType1 = gpu->addShaderMaterialFromFiles(vsFileName,
313 psFileName, mc, video::EMT_SOLID);
314
315 newMaterialType2 = gpu->addShaderMaterialFromFiles(vsFileName,
316 psFileName, mc, video::EMT_TRANSPARENT_ADD_COLOR);
317 }
318
319 mc->drop();
320 }
321
322 /*
323 Now it's time for testing the materials. We create a test cube and set
324 the material we created. In addition, we add a text scene node to the
325 cube and a rotation animator to make it look more interesting and
326 important.
327 */
328
329 // create test scene node 1, with the new created material type 1
330
331 scene::ISceneNode* node = smgr->addCubeSceneNode(50);
332 node->setPosition(core::vector3df(0,0,0));
333 node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
334 node->setMaterialFlag(video::EMF_LIGHTING, false);
335 node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1);
336
337 smgr->addTextSceneNode(gui->getBuiltInFont(),
338 L"PS & VS & EMT_SOLID",
339 video::SColor(255,255,255,255), node);
340
341 scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator(
342 core::vector3df(0,0.3f,0));
343 node->addAnimator(anim);
344 anim->drop();
345
346 /*
347 Same for the second cube, but with the second material we created.
348 */
349
350 // create test scene node 2, with the new created material type 2
351
352 node = smgr->addCubeSceneNode(50);
353 node->setPosition(core::vector3df(0,-10,50));
354 node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
355 node->setMaterialFlag(video::EMF_LIGHTING, false);
356 node->setMaterialFlag(video::EMF_BLEND_OPERATION, true);
357 node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2);
358
359 smgr->addTextSceneNode(gui->getBuiltInFont(),
360 L"PS & VS & EMT_TRANSPARENT",
361 video::SColor(255,255,255,255), node);
362
363 anim = smgr->createRotationAnimator(core::vector3df(0,0.3f,0));
364 node->addAnimator(anim);
365 anim->drop();
366
367 /*
368 Then we add a third cube without a shader on it, to be able to compare
369 the cubes.
370 */
371
372 // add a scene node with no shader
373
374 node = smgr->addCubeSceneNode(50);
375 node->setPosition(core::vector3df(0,50,25));
376 node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
377 node->setMaterialFlag(video::EMF_LIGHTING, false);
378 smgr->addTextSceneNode(gui->getBuiltInFont(), L"NO SHADER",
379 video::SColor(255,255,255,255), node);
380
381 /*
382 And last, we add a skybox and a user controlled camera to the scene.
383 For the skybox textures, we disable mipmap generation, because we don't
384 need mipmaps on it.
385 */
386
387 // add a nice skybox
388
389 driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
390
391 smgr->addSkyBoxSceneNode(
392 driver->getTexture("../../media/irrlicht2_up.jpg"),
393 driver->getTexture("../../media/irrlicht2_dn.jpg"),
394 driver->getTexture("../../media/irrlicht2_lf.jpg"),
395 driver->getTexture("../../media/irrlicht2_rt.jpg"),
396 driver->getTexture("../../media/irrlicht2_ft.jpg"),
397 driver->getTexture("../../media/irrlicht2_bk.jpg"));
398
399 driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
400
401 // add a camera and disable the mouse cursor
402
403 scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS();
404 cam->setPosition(core::vector3df(-100,50,100));
405 cam->setTarget(core::vector3df(0,0,0));
406 device->getCursorControl()->setVisible(false);
407
408 /*
409 Now draw everything. That's all.
410 */
411
412 int lastFPS = -1;
413
414 while(device->run())
415 if (device->isWindowActive())
416 {
417 driver->beginScene(true, true, video::SColor(255,0,0,0));
418 smgr->drawAll();
419 driver->endScene();
420
421 int fps = driver->getFPS();
422
423 if (lastFPS != fps)
424 {
425 core::stringw str = L"Irrlicht Engine - Vertex and pixel shader example [";
426 str += driver->getName();
427 str += "] FPS:";
428 str += fps;
429
430 device->setWindowCaption(str.c_str());
431 lastFPS = fps;
432 }
433 }
434
435 device->drop();
436
437 return 0;
438}
439
440/*
441Compile and run this, and I hope you have fun with your new little shader
442writing tool :).
443**/
diff --git a/src/others/irrlicht-1.8.1/examples/10.Shaders/tutorial.html b/src/others/irrlicht-1.8.1/examples/10.Shaders/tutorial.html
new file mode 100644
index 0000000..05c4f08
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/10.Shaders/tutorial.html
@@ -0,0 +1,566 @@
1<html>
2<head>
3<title>Irrlicht Engine Tutorial</title>
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5</head>
6
7<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
8<br>
9<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
10 <tr>
11 <td bgcolor="#666699" width="10"><b><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="../../media/irrlichtlogo.jpg" width="88" height="31" border="0"></a></b></td>
12 <td bgcolor="#666699" width="100%">
13<div align="center">
14 <div align="left"><b><font color="#FFFFFF">Tutorial 10. Shaders</font></b></div>
15 </div>
16 </td>
17 </tr>
18 <tr bgcolor="#eeeeff">
19 <td height="90" colspan="2">
20 <div align="left">
21 <p> This tutorial shows how to use shaders for D3D8, D3D9 and OpenGL with
22 the engine and how to create new material types with them. It also shows
23 how to disable the generation of mipmaps at texture loading, and how
24 to use text scene nodes.</p>
25 <p>This tutorial does not explain how shaders work. I would recommend
26 to read the D3D or OpenGL documentation, to search a tutorial, or to
27 read a book about this.</p>
28 <p>The program which is described here will look like this:</p>
29 <p align="center"><img src="../../media/010shot.jpg" width="260" height="203"><br>
30 </p>
31 </div>
32 </td>
33 </tr>
34</table>
35<br>
36<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
37 <tr>
38 <td bgcolor="#666699"> <b><font color="#FFFFFF">Lets start!</font></b></td>
39 </tr>
40 <tr>
41 <td height="90" bgcolor="#eeeeff" valign="top"> <div align="left">
42 <div align="left">
43 <p>At first, we need to include all headers and do the stuff we always
44 do, like in nearly all other tutorials:</p>
45 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
46 <tr>
47 <td> <pre>#include &lt;irrlicht.h&gt;<br>#include &lt;iostream&gt;<br><br>using namespace irr;<br><br>#pragma comment(lib, &quot;Irrlicht.lib&quot;)<br></pre></td>
48 </tr>
49 </table>
50 <p>Because we want to use some interesting shaders in this tutorials,
51 we need to set some data for them to make them able to compute nice
52 colors. In this example, we'll use a simple vertex shader which will
53 calculate the color of the vertex based on the position of the camera.
54 For this, the shader needs the following data: The inverted world
55 matrix for transforming the normal, the clip matrix for transforming
56 the position, the camera position and the world position of the object
57 for the calculation of the angle of light, and the color of the light.
58 To be able to tell the shader all this data every frame, we have to
59 derive a class from the IShaderConstantSetCallBack interface and override
60 its only method, namely OnSetConstants(). This method will be called
61 every time the material is set. <br>
62 The method setVertexShaderConstant() of the IMaterialRendererServices
63 interface is used to set the data the shader needs. If the user chose
64 to use a High Level shader language like HLSL instead of Assembler
65 in this example, you have to set the variable name as parameter instead
66 of the register index.</p>
67 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
68 <tr>
69 <td> <pre>IrrlichtDevice* device = 0;<br>bool UseHighLevelShaders = false;<br><br>class MyShaderCallBack : public video::IShaderConstantSetCallBack<br>{<br>public:
70<br> virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)<br> {<br> video::IVideoDriver* driver = services-&gt;getVideoDriver();<br><br> <font color="#006600">// set inverted world matrix<br> // if we are using highlevel shaders (the user can select this when<br> // starting the program), we must set the constants by name.</font><br> core::matrix4 invWorld = driver-&gt;getTransform(video::ETS_WORLD);<br> invWorld.makeInverse();<br><br> if (UseHighLevelShaders)<br> services-&gt;setVertexShaderConstant(&quot;mInvWorld&quot;, &amp;invWorld.M[0], 16);<br> else<br> services-&gt;setVertexShaderConstant(&amp;invWorld.M[0], 0, 4);<br><font color="#006600"><br> // set clip matrix<br></font> core::matrix4 worldViewProj;<br> worldViewProj = driver-&gt;getTransform(video::ETS_PROJECTION); <br> worldViewProj *= driver-&gt;getTransform(video::ETS_VIEW);<br> worldViewProj *= driver-&gt;getTransform(video::ETS_WORLD);<br><br> if (UseHighLevelShaders)<br> services-&gt;setVertexShaderConstant(&quot;mWorldViewProj&quot;, &amp;worldViewProj.M[0], 16);<br> else<br> services-&gt;setVertexShaderConstant(&amp;worldViewProj.M[0], 4, 4);<br> <br><font color="#006600"> </font><font color="#006600">// set camera position<br></font> core::vector3df pos = device-&gt;getSceneManager()-&gt;<br> getActiveCamera()-&gt;getAbsolutePosition();<br><br> if (UseHighLevelShaders)<br> services-&gt;setVertexShaderConstant(&quot;mLightPos&quot;, reinterpret_cast&lt;f32*&gt;(&amp;pos), 3);<br> else<br> services-&gt;setVertexShaderConstant(reinterpret_cast&lt;f32*&gt;(&amp;pos), 8, 1);<br><br><font color="#006600"> </font><font color="#006600">// set light color <br></font> video::SColorf col(0.0f,1.0f,1.0f,0.0f);<br><br> if (UseHighLevelShaders)<br> services-&gt;setVertexShaderConstant(&quot;mLightColor&quot;, reinterpret_cast&lt;f32*&gt;(&amp;col), 4);<br> else<br> services-&gt;setVertexShaderConstant(reinterpret_cast&lt;f32*&gt;(&amp;col), 9, 1);<br><br><font color="#006600"> </font><font color="#006600">// set transposed world matrix<br></font> core::matrix4 world = driver-&gt;getTransform(video::ETS_WORLD);<br> world = world.getTransposed();<br><br> if (UseHighLevelShaders)<br> services-&gt;setVertexShaderConstant(&quot;mTransWorld&quot;, &amp;world.M[0], 16);<br> else<br> services-&gt;setVertexShaderConstant(&amp;world.M[0], 10, 4);<br> }<br>};</pre></td>
71 </tr>
72 </table>
73 <p> The next few lines start up the engine. Just like in most other
74 tutorials before. But in addition, we ask the user if he wants this
75 example to use high level shaders if he selected a driver which is
76 capable of doing so.</p>
77 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
78 <tr>
79 <td> <pre>int main()<br>{<br><font color="#006600"> // let user select driver type</font><br><br> video::E_DRIVER_TYPE driverType = video::EDT_DIRECTX9;<br><br> printf(&quot;Please select the driver you want for this example:\n&quot;\<br> &quot; (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n&quot;\<br> &quot; (d) Software Renderer\n (e) Apfelbaum Software Renderer\n&quot;\<br> &quot; (f) NullDevice\n (otherKey) exit\n\n&quot;);<br><br> char i;<br> std::cin &gt;&gt; i;<br><br> switch(i)<br> {<br> case 'a': driverType = video::EDT_DIRECT3D9;break;<br> case 'b': driverType = video::EDT_DIRECT3D8;break;<br> case 'c': driverType = video::EDT_OPENGL; break;<br> case 'd': driverType = video::EDT_SOFTWARE; break;<br> case 'e': driverType = video::EDT_BURNINGSVIDEO;break;<br> case 'f': driverType = video::EDT_NULL; break;<br> default: return 1;<br> } <br><br><font color="#006600"> </font> <font color="#006600">// ask the user if we should use high level shaders for this example<br> </font> if (driverType == video::EDT_DIRECT3D9 ||<br> driverType == video::EDT_OPENGL)
80 {<br> printf(&quot;<font color="#CC0000">Please press 'y' if you want to use high level shaders.\n</font>&quot;);<br> std::cin &gt;&gt; i;<br> if (i == 'y')<br> UseHighLevelShaders = true;<br> }<br><br><font color="#006600"> // create devic</font>e<br><br> device = createDevice(driverType, core::dimension2d&lt;s32&gt;(640, 480));<br><br> if (device == 0)<br> {<br> printf(<font color="#CC0000">&quot;\nWas not able to create driver.\n&quot;\<br> &quot;Please restart and select another driver.\n&quot;</font>);<br> getch();<br> return 1;<br> } <br><br> video::IVideoDriver* driver = device-&gt;getVideoDriver();<br> scene::ISceneManager* smgr = device-&gt;getSceneManager();<br> gui::IGUIEnvironment* gui = device-&gt;getGUIEnvironment();</pre></td>
81 </tr>
82 </table>
83 <p> Now for the more interesting parts. If we are using Direct3D, we
84 want to load vertex and pixel shader programs, if we have<br>
85 OpenGL, we want to use ARB fragment and vertex programs. I wrote the
86 corresponding programs down into the files d3d8.ps, d3d8.vs, d3d9.ps,
87 d3d9.vs, opengl.ps and opengl.vs. We only need the right filenames
88 now. This is done in the following switch. Note, that it is not necessary
89 to write the shaders into text files, like in this example. You can
90 even write the shaders directly as strings into the cpp source file,
91 and use later addShaderMaterial() instead of addShaderMaterialFromFiles().</p>
92 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
93 <tr>
94 <td> <pre> c8* vsFileName = 0<font color="#006600">; // filename for the vertex shader</font><br> c8* psFileName = 0<font color="#006600">; // filename for the pixel shader</font><br><br> switch(driverType)<br> {<br> case video::EDT_DIRECT3D8:<br> psFileName = &quot;../../media/d3d8.psh&quot;;<br> vsFileName = &quot;../../media/d3d8.vsh&quot;;<br> break;<br> case video::EDT_DIRECT3D9:<br> if (UseHighLevelShaders)<br> {<br> psFileName = &quot;../../media/d3d9.hlsl&quot;;<br> vsFileName = psFileName; <font color="#006600">// both shaders are in the same file</font><br> }<br> else<br> {<br> psFileName = &quot;../../media/d3d9.psh&quot;;<br> vsFileName = &quot;../../media/d3d9.vsh&quot;;<br> }<br> break;<br> case video::EDT_OPENGL:<br> if (UseHighLevelShaders)<br> {<br> psFileName = &quot;../../media/opengl.frag&quot;;<br> vsFileName = &quot;../../media/opengl.vert&quot;;<br> }<br> else<br> {<br> psFileName = &quot;../../media/opengl.psh&quot;;<br> vsFileName = &quot;../../media/opengl.vsh&quot;;<br> }<br> break;<br> }<br></pre>
95 </td>
96 </tr>
97 </table>
98 <p> In addition, we check if the hardware and the selected renderer
99 is capable of executing the shaders we want. If not, we simply set
100 the filename string to 0. This is not necessary, but useful in this
101 example: For example, if the hardware is able to execute vertex shaders
102 but not pixel shaders, we create a new material which only uses the
103 vertex shader, and no pixel shader. Otherwise, if we would tell the
104 engine to create this material and the engine sees that the hardware
105 wouldn't be able to fullfill the request completely,<br>
106 it would not create any new material at all. So in this example you
107 would see at least the vertex shader in action, without the pixel
108 shader.</p>
109 </div>
110 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
111 <tr>
112 <td> <pre> if (!driver-&gt;queryFeature(video::EVDF_PIXEL_SHADER_1_1) &amp;&amp;<br> !driver-&gt;queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1))<br> {<br> device-&gt;getLogger()-&gt;log(&quot;WARNING: Pixel shaders disabled &quot;\<br> &quot;because of missing driver/hardware support.&quot;);<br> psFileName = 0;<br> }<br> <br> if (!driver-&gt;queryFeature(video::EVDF_VERTEX_SHADER_1_1) &amp;&amp;<br> !driver-&gt;queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1))<br> {<br> device-&gt;getLogger()-&gt;log(&quot;WARNING: Vertex shaders disabled &quot;\<br> &quot;because of missing driver/hardware support.&quot;);<br> vsFileName = 0;<br> }</pre></td>
113 </tr>
114 </table>
115 <p> Now lets create the new materials.<br>
116 As you maybe know from previous examples, a material type in the Irrlicht
117 engine is set by simply changing the MaterialType value in the SMaterial
118 struct. And this value is just a simple 32 bit value, like video::EMT_SOLID.
119 So we only need the engine to create a new value for us which we can
120 set there. To do this, we get a pointer to the IGPUProgrammingServices
121 and call addShaderMaterialFromFiles(), which returns such a new 32 bit
122 value. That's all.<br>
123 The parameters to this method are the following: First, the names of
124 the files containing the code of the vertex and the pixel shader.<br>
125 If you would use addShaderMaterial() instead, you would not need file
126 names, then you could write the code of the shader directly as string.
127 The following parameter is a pointer to the IShaderConstantSetCallBack
128 class we wrote at the beginning of this tutorial. If you don't want
129 to set constants, set this to 0. The last paramter tells the engine
130 which material it should use as base material. <br>
131 To demonstrate this, we create two materials with a different base material,
132 one with EMT_SOLID and one with EMT_TRANSPARENT_ADD_COLOR.</p>
133 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
134 <tr>
135 <td><pre> <font color="#006600">// create materials</font><br><br> video::IGPUProgrammingServices* gpu = driver-&gt;getGPUProgrammingServices();<br><br> s32 newMaterialType1 = 0;<br> s32 newMaterialType2 = 0;<br><br> if (gpu)<br> {<br> MyShaderCallBack* mc = new MyShaderCallBack();<br> <font color="#006600">
136 // create the shaders depending on if the user wanted high level<br> // or low level shaders:</font><br><br> if (UseHighLevelShaders)<br> {<br><font color="#006600"> // create material from high level shaders (hlsl or glsl)<br><br></font> newMaterialType1 = gpu-&gt;addHighLevelShaderMaterialFromFiles(<br> vsFileName, &quot;vertexMain&quot;, video::EVST_VS_1_1,<br> psFileName, &quot;pixelMain&quot;, video::EPST_PS_1_1,<br> mc, video::EMT_SOLID);<br><br> newMaterialType2 = gpu-&gt;addHighLevelShaderMaterialFromFiles(<br> vsFileName, &quot;vertexMain&quot;, video::EVST_VS_1_1,<br> psFileName, &quot;pixelMain&quot;, video::EPST_PS_1_1,<br> mc, video::EMT_TRANSPARENT_ADD_COLOR);<br> }<br> else<br> {<br><font color="#009900"> // create material from low level shaders (asm or arb_asm)<br></font><br> newMaterialType1 = gpu-&gt;addShaderMaterialFromFiles(vsFileName,<br> psFileName, mc, video::EMT_SOLID);<br><br> newMaterialType2 = gpu-&gt;addShaderMaterialFromFiles(vsFileName,<br> psFileName, mc, video::EMT_TRANSPARENT_ADD_COLOR);<br> }<br><br> mc-&gt;drop();<br> }<br></pre></td>
137 </tr>
138 </table>
139 <p> Now its time for testing out the materials. We create a test cube
140 and set the material we created. In addition, we add a text scene node
141 to the cube and a rotatation animator, to make it look more interesting
142 and important. </p>
143 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
144 <tr>
145 <td><pre><font color="#006600">
146 // create test scene node 1, with the new created material type 1</font>
147
148 scene::ISceneNode* node = smgr-&gt;addCubeSceneNode(50);
149 node-&gt;setPosition(core::vector3df(0,0,0));
150 node-&gt;setMaterialTexture(0, driver-&gt;getTexture(&quot;../../media/wall.bmp&quot;));
151 node-&gt;setMaterialFlag(video::EMF_LIGHTING, false);
152 node-&gt;setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1);
153
154 smgr-&gt;addTextSceneNode(gui-&gt;getBuiltInFont(),
155 L&quot;PS &amp; VS &amp; EMT_SOLID&quot;,
156 video::SColor(255,255,255,255), node);
157
158 scene::ISceneNodeAnimator* anim = smgr-&gt;createRotationAnimator(
159 core::vector3df(0,0.3f,0));
160 node-&gt;addAnimator(anim);
161 anim-&gt;drop();</pre></td>
162 </tr>
163 </table>
164 <p> Same for the second cube, but with the second material we created.</p>
165 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
166 <tr>
167 <td><pre> <font color="#006600">// create test scene node 2, with the new created material type 2</font>
168
169 node = smgr-&gt;addCubeSceneNode(50);
170 node-&gt;setPosition(core::vector3df(0,-10,50));
171 node-&gt;setMaterialTexture(0, driver-&gt;getTexture(&quot;../../media/wall.bmp&quot;));
172 node-&gt;setMaterialFlag(video::EMF_LIGHTING, false);
173 node-&gt;setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2);
174
175 smgr-&gt;addTextSceneNode(gui-&gt;getBuiltInFont(),
176 L&quot;PS &amp; VS &amp; EMT_TRANSPARENT&quot;,
177 video::SColor(255,255,255,255), node);
178
179 anim = smgr-&gt;createRotationAnimator(core::vector3df(0,0.3f,0));
180 node-&gt;addAnimator(anim);
181 anim-&gt;drop();</pre></td>
182 </tr>
183 </table>
184 <br>
185 Then we add a third cube without a shader on it, to be able to compare
186 the cubes.<br>
187 <br>
188 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
189 <tr>
190 <td><pre> <font color="#006600">// add a scene node with no shader </font>
191
192 node = smgr-&gt;addCubeSceneNode(50);
193 node-&gt;setPosition(core::vector3df(0,50,25));
194 node-&gt;setMaterialTexture(0, driver-&gt;getTexture(&quot;../../media/wall.bmp&quot;));
195 node-&gt;setMaterialFlag(video::EMF_LIGHTING, false);
196 smgr-&gt;addTextSceneNode(gui-&gt;getBuiltInFont(), L&quot;NO SHADER&quot;,
197 video::SColor(255,255,255,255), node);
198 </pre></td>
199 </tr>
200 </table>
201 <br>
202 And last, we add a skybox and a user controlled camera to the scene. For
203 the skybox textures, we disable mipmap generation, because we don't need
204 mipmaps on it.<br>
205 <br>
206 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
207 <tr>
208 <td><pre> <font color="#006600">// add a nice skybox</font><br><br> driver-&gt;setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);<br><br> smgr-&gt;addSkyBoxSceneNode(<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_up.jpg&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_dn.jpg&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_lf.jpg&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_rt.jpg&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_ft.jpg&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_bk.jpg&quot;));<br><br> driver-&gt;setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);<br><br><font color="#006600"> // add a camera and disable the mouse curso</font>r<br><br> scene::ICameraSceneNode* cam = smgr-&gt;addCameraSceneNodeFPS(0, 100.0f, 100.0f);<br> cam-&gt;setPosition(core::vector3df(-100,50,100));<br> cam-&gt;setTarget(core::vector3df(0,0,0));<br> device-&gt;getCursorControl()-&gt;setVisible(false);</pre></td>
209 </tr>
210 </table>
211 <br>
212 Now draw everything. That's all.<br>
213 <br>
214 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
215 <tr>
216 <td><pre> int lastFPS = -1;<br><br> while(device-&gt;run())<br> if (device-&gt;isWindowActive())<br> {<br> driver-&gt;beginScene(true, true, video::SColor(255,0,0,0));<br> smgr-&gt;drawAll();<br> driver-&gt;endScene();<br><br> int fps = driver-&gt;getFPS();<br><br> if (lastFPS != fps)<br> {<br> core::stringw str = L&quot;Irrlicht Engine - Vertex and pixel shader example [&quot;;<br> str += driver-&gt;getName();<br> str += &quot;] FPS:&quot;;<br> str += fps;<br> device-&gt;setWindowCaption(str.c_str());<br> lastFPS = fps;<br> }<br> }<br><br> device-&gt;drop();<br> <br> return 0;<br></pre></td>
217 </tr>
218 </table>
219 <br>
220 Compile and run this, and I hope you have fun with your new little shader
221 writing tool :).<br>
222 </div>
223 </td>
224 </tr>
225</table>
226<br>
227<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
228 <tr>
229 <td bgcolor="#666699"> <b><font color="#FFFFFF">Shader files</font></b></td>
230 </tr>
231 <tr>
232 <td height="90" bgcolor="#eeeeff" valign="top"> <div align="left">
233 <div align="left">
234 <p>The files containing the shaders can be found in the media directory
235 of the SDK. However, they look like this:</p>
236 <table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
237 <tr>
238 <td><strong>D3D9.HLSL</strong></td>
239 </tr>
240 <tr>
241 <td>
242<pre>
243// part of the Irrlicht Engine Shader example.
244// These simple Direct3D9 pixel and vertex shaders will be loaded by the shaders
245// example. Please note that these example shaders don't do anything really useful.
246// They only demonstrate that shaders can be used in Irrlicht.
247
248//-----------------------------------------------------------------------------
249// Global variables
250//-----------------------------------------------------------------------------
251float4x4 mWorldViewProj; // World * View * Projection transformation
252float4x4 mInvWorld; // Inverted world matrix
253float4x4 mTransWorld; // Transposed world matrix
254float3 mLightPos; // Light position
255float4 mLightColor; // Light color
256
257
258// Vertex shader output structure
259struct VS_OUTPUT
260{
261 float4 Position : POSITION; // vertex position
262 float4 Diffuse : COLOR0; // vertex diffuse color
263 float2 TexCoord : TEXCOORD0; // tex coords
264};
265
266
267VS_OUTPUT vertexMain( in float4 vPosition : POSITION,
268 in float3 vNormal : NORMAL,
269 float2 texCoord : TEXCOORD0 )
270{
271 VS_OUTPUT Output;
272
273 // transform position to clip space
274 Output.Position = mul(vPosition, mWorldViewProj);
275
276 // transform normal
277 float3 normal = mul(vNormal, mInvWorld);
278
279 // renormalize normal
280 normal = normalize(normal);
281
282 // position in world coodinates
283 float3 worldpos = mul(mTransWorld, vPosition);
284
285 // calculate light vector, vtxpos - lightpos
286 float3 lightVector = worldpos - mLightPos;
287
288 // normalize light vector
289 lightVector = normalize(lightVector);
290
291 // calculate light color
292 float3 tmp = dot(-lightVector, normal);
293 tmp = lit(tmp.x, tmp.y, 1.0);
294
295 tmp = mLightColor * tmp.y;
296 Output.Diffuse = float4(tmp.x, tmp.y, tmp.z, 0);
297 Output.TexCoord = texCoord;
298
299 return Output;
300}
301
302
303
304// Pixel shader output structure
305struct PS_OUTPUT
306{
307 float4 RGBColor : COLOR0; // Pixel color
308};
309
310
311sampler2D tex0;
312
313PS_OUTPUT pixelMain( float2 TexCoord : TEXCOORD0,
314 float4 Position : POSITION,
315 float4 Diffuse : COLOR0 )
316{
317 PS_OUTPUT Output;
318
319 float4 col = tex2D( tex0, TexCoord ); // sample color map
320
321 // multiply with diffuse and do other senseless operations
322 Output.RGBColor = Diffuse * col;
323 Output.RGBColor *= 4.0;
324
325 return Output;
326}</pre></td>
327 </tr>
328 </table>
329 <br>
330 <table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
331 <tr>
332 <td><strong>D3D9.VSH</strong></td>
333 </tr>
334 <tr>
335 <td> <pre>
336; part of the Irrlicht Engine Shader example.
337; This Direct3D9 vertex shader will be loaded by the engine.
338; Please note that these example shaders don't do anything really useful.
339; They only demonstrate that shaders can be used in Irrlicht.<br>
340vs.1.1
341
342dcl_position v0; ; declare position
343dcl_normal v1; ; declare normal
344dcl_color v2; ; declare color
345dcl_texcoord0 v3; ; declare texture coordinate<br>
346; transpose and transform position to clip space
347mul r0, v0.x, c4
348mad r0, v0.y, c5, r0
349mad r0, v0.z, c6, r0
350add oPos, c7, r0
351
352; transform normal
353dp3 r1.x, v1, c0
354dp3 r1.y, v1, c1
355dp3 r1.z, v1, c2
356
357; renormalize normal
358dp3 r1.w, r1, r1
359rsq r1.w, r1.w
360mul r1, r1, r1.w
361
362; calculate light vector
363m4x4 r6, v0, c10 ; vertex into world position
364add r2, c8, -r6 ; vtxpos - lightpos
365
366; normalize light vector
367dp3 r2.w, r2, r2
368rsq r2.w, r2.w
369mul r2, r2, r2.w
370
371; calculate light color
372dp3 r3, r1, r2 ; dp3 with negative light vector
373lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
374mul oD0, r5.y, c9 ; ouput diffuse color
375mov oT0, v3 ; store texture coordinates </pre> </td>
376 </tr>
377 </table>
378 <br>
379 <table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
380 <tr>
381 <td><strong>D3D9.PSH</strong></td>
382 </tr>
383 <tr>
384 <td> <pre>
385; part of the Irrlicht Engine Shader example.
386; This simple Direct3D9 pixel shader will be loaded by the engine.
387; Please note that these example shaders don't do anything really useful.
388; They only demonstrate that shaders can be used in Irrlicht.<br>
389ps.1.1
390
391tex t0 ; sample color map
392add r0, v0, v0 ; mulitply with color
393mul t0, t0, r0 ; mulitply with color
394add r0, t0, t0 ; make it brighter and store result
395 </pre> </td>
396 </tr>
397 </table>
398 <br>
399 <table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
400 <tr>
401 <td><strong>D3D8.VSH</strong></td>
402 </tr>
403 <tr>
404 <td> <pre>
405; part of the Irrlicht Engine Shader example.
406; This Direct3D9 vertex shader will be loaded by the engine.
407; Please note that these example shaders don't do anything really useful.
408; They only demonstrate that shaders can be used in Irrlicht.<br>
409vs.1.1
410
411; transpose and transform position to clip space
412mul r0, v0.x, c4
413mad r0, v0.y, c5, r0
414mad r0, v0.z, c6, r0
415add oPos, c7, r0
416
417; transform normal
418dp3 r1.x, v1, c0
419dp3 r1.y, v1, c1
420dp3 r1.z, v1, c2
421
422; renormalize normal
423dp3 r1.w, r1, r1
424rsq r1.w, r1.w
425mul r1, r1, r1.w
426
427; calculate light vector
428m4x4 r6, v0, c10 ; vertex into world position
429add r2, c8, -r6 ; vtxpos - lightpos
430
431; normalize light vector
432dp3 r2.w, r2, r2
433rsq r2.w, r2.w
434mul r2, r2, r2.w
435
436; calculate light color
437dp3 r3, r1, r2 ; dp3 with negative light vector
438lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
439mul oD0, r5.y, c9 ; ouput diffuse color
440mov oT0, v3 ; store texture coordinates </pre> </td>
441 </tr>
442 </table>
443 <br>
444 <table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
445 <tr>
446 <td><strong>D3D8.PSH</strong></td>
447 </tr>
448 <tr>
449 <td> <pre>
450; part of the Irrlicht Engine Shader example.
451; This simple Direct3D9 pixel shader will be loaded by the engine.
452; Please note that these example shaders don't do anything really useful.
453; They only demonstrate that shaders can be used in Irrlicht.<br>
454ps.1.1
455
456tex t0 ; sample color map
457mul_x2 t0, t0, v0 ; mulitply with color
458add r0, t0, t0 ; make it brighter and store result </pre> </td>
459 </tr>
460 </table>
461 <br>
462 <table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
463 <tr>
464 <td><strong>OPENGL.VSH</strong></td>
465 </tr>
466 <tr>
467 <td> <pre>
468!!ARBvp1.0
469# part of the Irrlicht Engine Shader example.
470# Please note that these example shaders don't do anything really useful.
471# They only demonstrate that shaders can be used in Irrlicht.<br>
472#input
473ATTRIB InPos = vertex.position;
474ATTRIB InColor = vertex.color;
475ATTRIB InNormal = vertex.normal;
476ATTRIB InTexCoord = vertex.texcoord;
477
478#output
479OUTPUT OutPos = result.position;
480OUTPUT OutColor = result.color;
481OUTPUT OutTexCoord = result.texcoord;
482
483PARAM MVP[4] = { state.matrix.mvp }; # modelViewProjection matrix.
484TEMP Temp;
485TEMP TempColor;
486TEMP TempNormal;
487TEMP TempPos;
488
489#transform position to clip space
490DP4 Temp.x, MVP[0], InPos;
491DP4 Temp.y, MVP[1], InPos;
492DP4 Temp.z, MVP[2], InPos;
493DP4 Temp.w, MVP[3], InPos;
494
495#transform normal
496DP3 TempNormal.x, InNormal.x, program.local[0];
497DP3 TempNormal.y, InNormal.y, program.local[1];
498DP3 TempNormal.z, InNormal.z, program.local[2];
499
500#renormalize normal
501DP3 TempNormal.w, TempNormal, TempNormal;
502RSQ TempNormal.w, TempNormal.w;
503MUL TempNormal, TempNormal, TempNormal.w;
504
505# calculate light vector
506DP4 TempPos.x, InPos, program.local[10]; # vertex into world position
507DP4 TempPos.y, InPos, program.local[11];
508DP4 TempPos.z, InPos, program.local[12];
509DP4 TempPos.w, InPos, program.local[13];
510
511ADD TempPos, program.local[8], -TempPos; # vtxpos - lightpos
512
513# normalize light vector
514DP3 TempPos.w, TempPos, TempPos;
515RSQ TempPos.w, TempPos.w;
516MUL TempPos, TempPos, TempPos.w;
517
518# calculate light color
519DP3 TempColor, TempNormal, TempPos; # dp3 with negative light vector
520LIT OutColor, TempColor; # clamp to zero if r3 < 0, r5 has diffuce component in r5.y
521MUL OutColor, TempColor.y, program.local[9]; # ouput diffuse color
522MOV OutColor.w, 1.0; # we want alpha to be always 1
523MOV OutTexCoord, InTexCoord; # store texture coordinate
524MOV OutPos, Temp;
525
526END</pre> </td>
527 </tr>
528 </table>
529 <br>
530 <table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
531 <tr>
532 <td><strong>OPENGL.PSH</strong></td>
533 </tr>
534 <tr>
535 <td> <pre>
536!!ARBfp1.0
537# part of the Irrlicht Engine Shader example.
538# Please note that these example shaders don't do anything really useful.
539# They only demonstrate that shaders can be used in Irrlicht.<br>
540#Input
541ATTRIB inTexCoord = fragment.texcoord; # texture coordinates
542ATTRIB inColor = fragment.color.primary; # interpolated diffuse color
543
544#Output
545OUTPUT outColor = result.color;
546
547TEMP texelColor;
548TEMP tmp;
549TXP texelColor, inTexCoord, texture, 2D;
550
551ADD tmp, inColor, inColor; # mulitply with color
552MUL texelColor, texelColor, tmp; # mulitply with color
553ADD outColor, texelColor, texelColor; # make it brighter and store result
554
555END </pre> </td>
556 </tr>
557 </table>
558 <p>&nbsp; </p>
559 </div>
560 </div></td>
561 </tr>
562</table>
563<p>&nbsp;</p>
564<p>&nbsp;</p>
565 </body>
566</html>