aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/examples/11.PerPixelLighting')
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/Makefile38
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.cbp56
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.dev59
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.vcproj163
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj231
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj235
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj231
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj230
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/main.cpp487
-rw-r--r--src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/tutorial.html502
10 files changed, 2232 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/Makefile b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/Makefile
new file mode 100644
index 0000000..affdc02
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/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 = 11.PerPixelLighting
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/11.PerPixelLighting/PerPixelLighting.cbp b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.cbp
new file mode 100644
index 0000000..2cb49da
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.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 11 Per-Pixel Lighting" />
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\PerPixelLighting" 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\PerPixelLighting" prefix_auto="0" extension_auto="0" />
25 <Option type="1" />
26 <Option compiler="gcc" />
27 <Option projectResourceIncludeDirsRelation="1" />
28 <Compiler>
29 <Add option="-g" />
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/11.PerPixelLighting/PerPixelLighting.dev b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.dev
new file mode 100644
index 0000000..c83a502
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.dev
@@ -0,0 +1,59 @@
1[Project]
2FileName=example.dev
3Name=Irrlicht Example 11 Per-Pixel Lighting
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=11.PerPixelLighting.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/11.PerPixelLighting/PerPixelLighting.vcproj b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.vcproj
new file mode 100644
index 0000000..94d7e6a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.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="11.PerPixelLighting"
6 ProjectGUID="{EC388ECA-E430-477A-A969-66FE5F84508A}"
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/PerPixelLighting.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\11.PerPixelLighting.exe"
43 LinkIncremental="0"
44 SuppressStartupBanner="TRUE"
45 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
46 GenerateDebugInformation="TRUE"
47 ProgramDatabaseFile=".\Debug/PerPixelLighting.pdb"
48 SubSystem="1"
49 TargetMachine="1"/>
50 <Tool
51 Name="VCMIDLTool"
52 TypeLibraryName=".\Debug/PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.exe"
105 LinkIncremental="0"
106 SuppressStartupBanner="TRUE"
107 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
108 ProgramDatabaseFile=".\Release/PerPixelLighting.pdb"
109 SubSystem="1"
110 TargetMachine="1"/>
111 <Tool
112 Name="VCMIDLTool"
113 TypeLibraryName=".\Release/PerPixelLighting.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/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj
new file mode 100644
index 0000000..267ded9
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_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>11.PerPixelLighting</ProjectName>
23 <ProjectGuid>{C4B42409-542D-4EFC-9E6B-44713FD47A33}</ProjectGuid>
24 <RootNamespace>PerPixelLighting</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/PerPixelLighting.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\11.PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.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/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj
new file mode 100644
index 0000000..06fce8f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_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>11.PerPixelLighting</ProjectName>
23 <ProjectGuid>{C4B42409-542D-4EFC-9E6B-44713FD47A33}</ProjectGuid>
24 <RootNamespace>PerPixelLighting</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/PerPixelLighting.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\11.PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.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/11.PerPixelLighting/PerPixelLighting_vc8.vcproj b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj
new file mode 100644
index 0000000..b6830db
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_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="11.PerPixelLighting_vc8"
6 ProjectGUID="{C4B42409-542D-4EFC-9E6B-44713FD47A33}"
7 RootNamespace="PerPixelLighting_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/PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.exe"
75 LinkIncremental="0"
76 SuppressStartupBanner="true"
77 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
78 GenerateDebugInformation="true"
79 ProgramDatabaseFile=".\Debug/PerPixelLighting.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/PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.exe"
167 LinkIncremental="0"
168 SuppressStartupBanner="true"
169 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
170 ProgramDatabaseFile=".\Release/PerPixelLighting.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/11.PerPixelLighting/PerPixelLighting_vc9.vcproj b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj
new file mode 100644
index 0000000..c9ed033
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_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="11.PerPixelLighting_vc9"
6 ProjectGUID="{C4B42409-542D-4EFC-9E6B-44713FD47A33}"
7 RootNamespace="PerPixelLighting_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/PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.exe"
76 LinkIncremental="0"
77 SuppressStartupBanner="true"
78 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
79 GenerateDebugInformation="true"
80 ProgramDatabaseFile=".\Debug/PerPixelLighting.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/PerPixelLighting.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/PerPixelLighting.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\11.PerPixelLighting.exe"
167 LinkIncremental="0"
168 SuppressStartupBanner="true"
169 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
170 ProgramDatabaseFile=".\Release/PerPixelLighting.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/11.PerPixelLighting/main.cpp b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/main.cpp
new file mode 100644
index 0000000..227aa97
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/main.cpp
@@ -0,0 +1,487 @@
1/** Example 011 Per-Pixel Lighting
2
3This tutorial shows how to use one of the built in more complex materials in
4irrlicht: Per pixel lighted surfaces using normal maps and parallax mapping. It
5will also show how to use fog and moving particle systems. And don't panic: You
6do not need any experience with shaders to use these materials in Irrlicht.
7
8At first, we need to include all headers and do the stuff we always do, like in
9nearly all other tutorials.
10*/
11#include <irrlicht.h>
12#include "driverChoice.h"
13
14using namespace irr;
15
16#ifdef _MSC_VER
17#pragma comment(lib, "Irrlicht.lib")
18#endif
19
20/*
21For this example, we need an event receiver, to make it possible for the user
22to switch between the three available material types. In addition, the event
23receiver will create some small GUI window which displays what material is
24currently being used. There is nothing special done in this class, so maybe you
25want to skip reading it.
26*/
27class MyEventReceiver : public IEventReceiver
28{
29public:
30
31 MyEventReceiver(scene::ISceneNode* room,scene::ISceneNode* earth,
32 gui::IGUIEnvironment* env, video::IVideoDriver* driver)
33 {
34 // store pointer to room so we can change its drawing mode
35 Room = room;
36 Earth = earth;
37 Driver = driver;
38
39 // set a nicer font
40 gui::IGUISkin* skin = env->getSkin();
41 gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
42 if (font)
43 skin->setFont(font);
44
45 // add window and listbox
46 gui::IGUIWindow* window = env->addWindow(
47 core::rect<s32>(460,375,630,470), false, L"Use 'E' + 'R' to change");
48
49 ListBox = env->addListBox(
50 core::rect<s32>(2,22,165,88), window);
51
52 ListBox->addItem(L"Diffuse");
53 ListBox->addItem(L"Bump mapping");
54 ListBox->addItem(L"Parallax mapping");
55 ListBox->setSelected(1);
56
57 // create problem text
58 ProblemText = env->addStaticText(
59 L"Your hardware or this renderer is not able to use the "\
60 L"needed shaders for this material. Using fall back materials.",
61 core::rect<s32>(150,20,470,80));
62
63 ProblemText->setOverrideColor(video::SColor(100,255,255,255));
64
65 // set start material (prefer parallax mapping if available)
66 video::IMaterialRenderer* renderer =
67 Driver->getMaterialRenderer(video::EMT_PARALLAX_MAP_SOLID);
68 if (renderer && renderer->getRenderCapability() == 0)
69 ListBox->setSelected(2);
70
71 // set the material which is selected in the listbox
72 setMaterial();
73 }
74
75 bool OnEvent(const SEvent& event)
76 {
77 // check if user presses the key 'E' or 'R'
78 if (event.EventType == irr::EET_KEY_INPUT_EVENT &&
79 !event.KeyInput.PressedDown && Room && ListBox)
80 {
81 // change selected item in listbox
82
83 int sel = ListBox->getSelected();
84 if (event.KeyInput.Key == irr::KEY_KEY_R)
85 ++sel;
86 else
87 if (event.KeyInput.Key == irr::KEY_KEY_E)
88 --sel;
89 else
90 return false;
91
92 if (sel > 2) sel = 0;
93 if (sel < 0) sel = 2;
94 ListBox->setSelected(sel);
95
96 // set the material which is selected in the listbox
97 setMaterial();
98 }
99
100 return false;
101 }
102
103private:
104
105 // sets the material of the room mesh the the one set in the
106 // list box.
107 void setMaterial()
108 {
109 video::E_MATERIAL_TYPE type = video::EMT_SOLID;
110
111 // change material setting
112 switch(ListBox->getSelected())
113 {
114 case 0: type = video::EMT_SOLID;
115 break;
116 case 1: type = video::EMT_NORMAL_MAP_SOLID;
117 break;
118 case 2: type = video::EMT_PARALLAX_MAP_SOLID;
119 break;
120 }
121
122 Room->setMaterialType(type);
123
124 // change material setting
125 switch(ListBox->getSelected())
126 {
127 case 0: type = video::EMT_TRANSPARENT_VERTEX_ALPHA;
128 break;
129 case 1: type = video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA;
130 break;
131 case 2: type = video::EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA;
132 break;
133 }
134
135 Earth->setMaterialType(type);
136
137 /*
138 We need to add a warning if the materials will not be able to
139 be displayed 100% correctly. This is no problem, they will be
140 rendered using fall back materials, but at least the user
141 should know that it would look better on better hardware. We
142 simply check if the material renderer is able to draw at full
143 quality on the current hardware. The
144 IMaterialRenderer::getRenderCapability() returns 0 if this is
145 the case.
146 */
147 video::IMaterialRenderer* renderer = Driver->getMaterialRenderer(type);
148
149 // display some problem text when problem
150 if (!renderer || renderer->getRenderCapability() != 0)
151 ProblemText->setVisible(true);
152 else
153 ProblemText->setVisible(false);
154 }
155
156private:
157
158 gui::IGUIStaticText* ProblemText;
159 gui::IGUIListBox* ListBox;
160
161 scene::ISceneNode* Room;
162 scene::ISceneNode* Earth;
163 video::IVideoDriver* Driver;
164};
165
166
167/*
168Now for the real fun. We create an Irrlicht Device and start to setup the scene.
169*/
170int main()
171{
172 // ask user for driver
173 video::E_DRIVER_TYPE driverType=driverChoiceConsole();
174 if (driverType==video::EDT_COUNT)
175 return 1;
176
177 // create device
178
179 IrrlichtDevice* device = createDevice(driverType,
180 core::dimension2d<u32>(640, 480));
181
182 if (device == 0)
183 return 1; // could not create selected driver.
184
185 /*
186 Before we start with the interesting stuff, we do some simple things:
187 Store pointers to the most important parts of the engine (video driver,
188 scene manager, gui environment) to safe us from typing too much, add an
189 irrlicht engine logo to the window and a user controlled first person
190 shooter style camera. Also, we let the engine know that it should store
191 all textures in 32 bit. This necessary because for parallax mapping, we
192 need 32 bit textures.
193 */
194
195 video::IVideoDriver* driver = device->getVideoDriver();
196 scene::ISceneManager* smgr = device->getSceneManager();
197 gui::IGUIEnvironment* env = device->getGUIEnvironment();
198
199 driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
200
201 // add irrlicht logo
202 env->addImage(driver->getTexture("../../media/irrlichtlogo3.png"),
203 core::position2d<s32>(10,10));
204
205 // add camera
206 scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
207 camera->setPosition(core::vector3df(-200,200,-200));
208
209 // disable mouse cursor
210 device->getCursorControl()->setVisible(false);
211
212 /*
213 Because we want the whole scene to look a little bit scarier, we add
214 some fog to it. This is done by a call to IVideoDriver::setFog(). There
215 you can set various fog settings. In this example, we use pixel fog,
216 because it will work well with the materials we'll use in this example.
217 Please note that you will have to set the material flag EMF_FOG_ENABLE
218 to 'true' in every scene node which should be affected by this fog.
219 */
220 driver->setFog(video::SColor(0,138,125,81), video::EFT_FOG_LINEAR, 250, 1000, .003f, true, false);
221
222 /*
223 To be able to display something interesting, we load a mesh from a .3ds
224 file which is a room I modeled with anim8or. It is the same room as
225 from the specialFX example. Maybe you remember from that tutorial, I am
226 no good modeler at all and so I totally messed up the texture mapping
227 in this model, but we can simply repair it with the
228 IMeshManipulator::makePlanarTextureMapping() method.
229 */
230
231 scene::IAnimatedMesh* roomMesh = smgr->getMesh("../../media/room.3ds");
232 scene::ISceneNode* room = 0;
233 scene::ISceneNode* earth = 0;
234
235 if (roomMesh)
236 {
237 // The Room mesh doesn't have proper Texture Mapping on the
238 // floor, so we can recreate them on runtime
239 smgr->getMeshManipulator()->makePlanarTextureMapping(
240 roomMesh->getMesh(0), 0.003f);
241
242 /*
243 Now for the first exciting thing: If we successfully loaded the
244 mesh we need to apply textures to it. Because we want this room
245 to be displayed with a very cool material, we have to do a
246 little bit more than just set the textures. Instead of only
247 loading a color map as usual, we also load a height map which
248 is simply a grayscale texture. From this height map, we create
249 a normal map which we will set as second texture of the room.
250 If you already have a normal map, you could directly set it,
251 but I simply didn't find a nice normal map for this texture.
252 The normal map texture is being generated by the
253 makeNormalMapTexture method of the VideoDriver. The second
254 parameter specifies the height of the heightmap. If you set it
255 to a bigger value, the map will look more rocky.
256 */
257
258 video::ITexture* normalMap =
259 driver->getTexture("../../media/rockwall_height.bmp");
260
261 if (normalMap)
262 driver->makeNormalMapTexture(normalMap, 9.0f);
263/*
264 // The Normal Map and the displacement map/height map in the alpha channel
265 video::ITexture* normalMap =
266 driver->getTexture("../../media/rockwall_NRM.tga");
267*/
268 /*
269 But just setting color and normal map is not everything. The
270 material we want to use needs some additional informations per
271 vertex like tangents and binormals. Because we are too lazy to
272 calculate that information now, we let Irrlicht do this for us.
273 That's why we call IMeshManipulator::createMeshWithTangents().
274 It creates a mesh copy with tangents and binormals from another
275 mesh. After we've done that, we simply create a standard
276 mesh scene node with this mesh copy, set color and normal map
277 and adjust some other material settings. Note that we set
278 EMF_FOG_ENABLE to true to enable fog in the room.
279 */
280
281 scene::IMesh* tangentMesh = smgr->getMeshManipulator()->
282 createMeshWithTangents(roomMesh->getMesh(0));
283
284 room = smgr->addMeshSceneNode(tangentMesh);
285 room->setMaterialTexture(0,
286 driver->getTexture("../../media/rockwall.jpg"));
287 room->setMaterialTexture(1, normalMap);
288
289 // Stones don't glitter..
290 room->getMaterial(0).SpecularColor.set(0,0,0,0);
291 room->getMaterial(0).Shininess = 0.f;
292
293 room->setMaterialFlag(video::EMF_FOG_ENABLE, true);
294 room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
295 // adjust height for parallax effect
296 room->getMaterial(0).MaterialTypeParam = 1.f / 64.f;
297
298 // drop mesh because we created it with a create.. call.
299 tangentMesh->drop();
300 }
301
302 /*
303 After we've created a room shaded by per pixel lighting, we add a
304 sphere into it with the same material, but we'll make it transparent.
305 In addition, because the sphere looks somehow like a familiar planet,
306 we make it rotate. The procedure is similar as before. The difference
307 is that we are loading the mesh from an .x file which already contains
308 a color map so we do not need to load it manually. But the sphere is a
309 little bit too small for our needs, so we scale it by the factor 50.
310 */
311
312 // add earth sphere
313
314 scene::IAnimatedMesh* earthMesh = smgr->getMesh("../../media/earth.x");
315 if (earthMesh)
316 {
317 //perform various task with the mesh manipulator
318 scene::IMeshManipulator *manipulator = smgr->getMeshManipulator();
319
320 // create mesh copy with tangent informations from original earth.x mesh
321 scene::IMesh* tangentSphereMesh =
322 manipulator->createMeshWithTangents(earthMesh->getMesh(0));
323
324 // set the alpha value of all vertices to 200
325 manipulator->setVertexColorAlpha(tangentSphereMesh, 200);
326
327 // scale the mesh by factor 50
328 core::matrix4 m;
329 m.setScale ( core::vector3df(50,50,50) );
330 manipulator->transform( tangentSphereMesh, m );
331
332 earth = smgr->addMeshSceneNode(tangentSphereMesh);
333
334 earth->setPosition(core::vector3df(-70,130,45));
335
336 // load heightmap, create normal map from it and set it
337 video::ITexture* earthNormalMap = driver->getTexture("../../media/earthbump.jpg");
338 if (earthNormalMap)
339 {
340 driver->makeNormalMapTexture(earthNormalMap, 20.0f);
341 earth->setMaterialTexture(1, earthNormalMap);
342 earth->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA);
343 }
344
345 // adjust material settings
346 earth->setMaterialFlag(video::EMF_FOG_ENABLE, true);
347
348 // add rotation animator
349 scene::ISceneNodeAnimator* anim =
350 smgr->createRotationAnimator(core::vector3df(0,0.1f,0));
351 earth->addAnimator(anim);
352 anim->drop();
353
354 // drop mesh because we created it with a create.. call.
355 tangentSphereMesh->drop();
356 }
357
358 /*
359 Per pixel lighted materials only look cool when there are moving
360 lights. So we add some. And because moving lights alone are so boring,
361 we add billboards to them, and a whole particle system to one of them.
362 We start with the first light which is red and has only the billboard
363 attached.
364 */
365
366 // add light 1 (more green)
367 scene::ILightSceneNode* light1 =
368 smgr->addLightSceneNode(0, core::vector3df(0,0,0),
369 video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 800.0f);
370
371 light1->setDebugDataVisible ( scene::EDS_BBOX );
372
373
374 // add fly circle animator to light 1
375 scene::ISceneNodeAnimator* anim =
376 smgr->createFlyCircleAnimator (core::vector3df(50,300,0),190.0f, -0.003f);
377 light1->addAnimator(anim);
378 anim->drop();
379
380 // attach billboard to the light
381 scene::IBillboardSceneNode* bill =
382 smgr->addBillboardSceneNode(light1, core::dimension2d<f32>(60, 60));
383
384 bill->setMaterialFlag(video::EMF_LIGHTING, false);
385 bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
386 bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
387 bill->setMaterialTexture(0, driver->getTexture("../../media/particlegreen.jpg"));
388
389 /*
390 Now the same again, with the second light. The difference is that we
391 add a particle system to it too. And because the light moves, the
392 particles of the particlesystem will follow. If you want to know more
393 about how particle systems are created in Irrlicht, take a look at the
394 specialFx example. Maybe you will have noticed that we only add 2
395 lights, this has a simple reason: The low end version of this material
396 was written in ps1.1 and vs1.1, which doesn't allow more lights. You
397 could add a third light to the scene, but it won't be used to shade the
398 walls. But of course, this will change in future versions of Irrlicht
399 where higher versions of pixel/vertex shaders will be implemented too.
400 */
401
402 // add light 2 (red)
403 scene::ISceneNode* light2 =
404 smgr->addLightSceneNode(0, core::vector3df(0,0,0),
405 video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 800.0f);
406
407 // add fly circle animator to light 2
408 anim = smgr->createFlyCircleAnimator(core::vector3df(0,150,0), 200.0f,
409 0.001f, core::vector3df(0.2f, 0.9f, 0.f));
410 light2->addAnimator(anim);
411 anim->drop();
412
413 // attach billboard to light
414 bill = smgr->addBillboardSceneNode(light2, core::dimension2d<f32>(120, 120));
415 bill->setMaterialFlag(video::EMF_LIGHTING, false);
416 bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
417 bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
418 bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));
419
420 // add particle system
421 scene::IParticleSystemSceneNode* ps =
422 smgr->addParticleSystemSceneNode(false, light2);
423
424 // create and set emitter
425 scene::IParticleEmitter* em = ps->createBoxEmitter(
426 core::aabbox3d<f32>(-3,0,-3,3,1,3),
427 core::vector3df(0.0f,0.03f,0.0f),
428 80,100,
429 video::SColor(10,255,255,255), video::SColor(10,255,255,255),
430 400,1100);
431 em->setMinStartSize(core::dimension2d<f32>(30.0f, 40.0f));
432 em->setMaxStartSize(core::dimension2d<f32>(30.0f, 40.0f));
433
434 ps->setEmitter(em);
435 em->drop();
436
437 // create and set affector
438 scene::IParticleAffector* paf = ps->createFadeOutParticleAffector();
439 ps->addAffector(paf);
440 paf->drop();
441
442 // adjust some material settings
443 ps->setMaterialFlag(video::EMF_LIGHTING, false);
444 ps->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
445 ps->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp"));
446 ps->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
447
448 MyEventReceiver receiver(room, earth, env, driver);
449 device->setEventReceiver(&receiver);
450
451 /*
452 Finally, draw everything. That's it.
453 */
454
455 int lastFPS = -1;
456
457 while(device->run())
458 if (device->isWindowActive())
459 {
460 driver->beginScene(true, true, 0);
461
462 smgr->drawAll();
463 env->drawAll();
464
465 driver->endScene();
466
467 int fps = driver->getFPS();
468
469 if (lastFPS != fps)
470 {
471 core::stringw str = L"Per pixel lighting example - Irrlicht Engine [";
472 str += driver->getName();
473 str += "] FPS:";
474 str += fps;
475
476 device->setWindowCaption(str.c_str());
477 lastFPS = fps;
478 }
479 }
480
481 device->drop();
482
483 return 0;
484}
485
486/*
487**/
diff --git a/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/tutorial.html b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/tutorial.html
new file mode 100644
index 0000000..89e87bd
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/11.PerPixelLighting/tutorial.html
@@ -0,0 +1,502 @@
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 11. Per pixel lighting</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 one of the built in more complex materials
22 in irrlicht: Per pixel lighted surfaces using normal maps and parallax
23 mapping. It will also show how to use fog and moving particle systems.
24 And don't panic: You dont need any experience with shaders to use these
25 materials in Irrlicht.</p>
26 <p>The program which is described here will look like this:</p>
27 <p align="center"><img src="../../media/011shot.jpg" width="258" height="202"><br>
28 </p>
29 </div>
30 </td>
31 </tr>
32</table>
33<br>
34<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
35 <tr>
36 <td bgcolor="#666699"> <b><font color="#FFFFFF">Lets start!</font></b></td>
37 </tr>
38 <tr>
39 <td height="90" bgcolor="#eeeeff" valign="top"> <div align="left">
40 <div align="left">
41 <p>At first, we need to include all headers and do the stuff we always
42 do, like in nearly all other tutorials.</p>
43 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
44 <tr>
45 <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>
46 </tr>
47 </table>
48 <p>For this example, we need an event receiver, to make it possible
49 for the user to switch between the three available material types.
50 In addition, the event receiver will create some small GUI window
51 which displays what material is currently being used. There is nothing
52 special done in this class, so maybe you want to skip reading it.</p>
53 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
54 <tr>
55 <td><pre>class MyEventReceiver : public IEventReceiver
56{
57public:
58
59 MyEventReceiver(scene::ISceneNode* room,
60 gui::IGUIEnvironment* env, video::IVideoDriver* driver)
61 {
62 // store pointer to room so we can change its drawing mode
63 Room = room;
64 Driver = driver;
65
66 // set a nicer font
67 gui::IGUISkin* skin = env->getSkin();
68 gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
69 if (font)
70 skin->setFont(font);
71
72 // add window and listbox
73 gui::IGUIWindow* window = env->addWindow(
74 core::rect<s32>(490,390,630,470), false, L"Use 'E' + 'R' to change");
75
76 ListBox = env->addListBox(
77 core::rect<s32>(2,22,135,78), window);
78
79 ListBox->addItem(L"Diffuse");
80 ListBox->addItem(L"Bump mapping");
81 ListBox->addItem(L"Parallax mapping");
82 ListBox->setSelected(1);
83
84 // create problem text
85 ProblemText = env->addStaticText(
86 L"Your hardware or this renderer is not able to use the "\
87 L"needed shaders for this material. Using fall back materials.",
88 core::rect<s32>(150,20,470,60));
89
90 ProblemText->setOverrideColor(video::SColor(100,255,255,255));
91
92 // set start material (prefer parallax mapping if available)
93 video::IMaterialRenderer* renderer =
94 Driver->getMaterialRenderer(video::EMT_PARALLAX_MAP_SOLID);
95 if (renderer && renderer->getRenderCapability() == 0)
96 ListBox->setSelected(2);
97
98 // set the material which is selected in the listbox
99 setMaterial();
100 }
101
102 bool OnEvent(const SEvent& event)
103 {
104 // check if user presses the key 'E' or 'R'
105 if (event.EventType == irr::EET_KEY_INPUT_EVENT &&
106 !event.KeyInput.PressedDown && Room && ListBox)
107 {
108 // change selected item in listbox
109
110 int sel = ListBox->getSelected();
111 if (event.KeyInput.Key == irr::KEY_KEY_R)
112 ++sel;
113 else
114 if (event.KeyInput.Key == irr::KEY_KEY_E)
115 --sel;
116 else
117 return false;
118
119 if (sel > 2) sel = 0;
120 if (sel < 0) sel = 2;
121 ListBox->setSelected(sel);
122
123 // set the material which is selected in the listbox
124 setMaterial();
125 }
126
127 return false;
128 }
129
130private:
131
132 // sets the material of the room mesh the the one set in the
133 // list box.
134 void setMaterial()
135 {
136 video::E_MATERIAL_TYPE type = video::EMT_SOLID;
137
138 // change material setting
139 switch(ListBox->getSelected())
140 {
141 case 0: type = video::EMT_SOLID;
142 break;
143 case 1: type = video::EMT_NORMAL_MAP_SOLID;
144 break;
145 case 2: type = video::EMT_PARALLAX_MAP_SOLID;
146 break;
147 }
148
149 Room->setMaterialType(type);</pre>
150 </td>
151 </tr>
152 </table>
153 <p>We need to add a warning if the materials will not be able to be
154 displayed 100% correctly. This is no problem, they will be renderered
155 using fall back materials, but at least the user should know that
156 it would look better on better hardware. We simply check if the material
157 renderer is able to draw at full quality on the current hardware.
158 The IMaterialRenderer::getRenderCapability() returns 0 if this is
159 the case.<br>
160 </p>
161 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
162 <tr>
163 <td> <pre>video::IMaterialRenderer* renderer = Driver->getMaterialRenderer(type);
164
165 // display some problem text when problem
166 if (!renderer || renderer->getRenderCapability() != 0)
167 ProblemText->setVisible(true);
168 else
169 ProblemText->setVisible(false);
170 }
171
172private:
173
174 gui::IGUIStaticText* ProblemText;
175 gui::IGUIListBox* ListBox;
176
177 scene::ISceneNode* Room;
178 video::IVideoDriver* Driver;
179};</pre></td>
180 </tr>
181 </table>
182 <p><br>
183 Now for the real fun. We create an Irrlicht Device and start to setup
184 the scene.<br>
185 </p>
186 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
187 <tr>
188 <td> <pre>int main()
189{
190 // let user select driver type
191
192 video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
193<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>
194 char i;
195 std::cin >> i;
196
197 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 0;<br> }
198
199 // create device
200
201 IrrlichtDevice* device = createDevice(driverType, core::dimension2d<s32>(640, 480));
202
203 if (device == 0)
204 return 1; // could not create selected driver.
205</pre></td>
206 </tr>
207 </table>
208 <br>
209 Before we start with the interesting stuff, we do some simple things:
210 Store pointers to the most important parts of the engine (video driver,<br>
211 scene manager, gui environment) to safe us from typing too much, add
212 an irrlicht engine logo to the window and a user controlled first person
213 shooter style camera. Also, we let the engine now that it should store
214 all textures in 32 bit. This necessary because for parallax mapping,
215 we need 32 bit textures.<br>
216 <br>
217 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
218 <tr>
219 <td> <pre>
220 video::IVideoDriver* driver = device->getVideoDriver();
221 scene::ISceneManager* smgr = device->getSceneManager();
222 gui::IGUIEnvironment* env = device->getGUIEnvironment();
223
224 driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
225
226 // add irrlicht logo
227 env->addImage(driver->getTexture("../../media/irrlichtlogoalpha.tga"),
228 core::position2d<s32>(10,10));
229
230 // add camera
231 scene::ICameraSceneNode* camera =
232 smgr->addCameraSceneNodeFPS(0,100.0f,300.0f);
233 camera->setPosition(core::vector3df(-200,200,-200));
234
235 // disable mouse cursor
236 device->getCursorControl()->setVisible(false);</pre></td>
237 </tr>
238 </table>
239 <br>
240 Because we want the whole scene to look a little bit scarier, we add
241 some fog to it. This is done by a call to IVideoDriver::setFog(). There
242 you can set<br>
243 various fog settings. In this example, we use pixel fog, because it
244 will work well with the materials we'll use in this example. Please
245 note that you will have to set the material flag EMF_FOG_ENABLE to 'true'
246 in every scene node which should be affected by this fog.<br>
247 <br>
248 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
249 <tr>
250 <td> <pre>driver-&gt;setFog(video::SColor(0,138,125,81), true, 250, 1000, 0, true);<br></pre></td>
251 </tr>
252 </table>
253 <br>
254 To be able to display something interesting, we load a mesh from a .3ds
255 file which is a room I modeled with anim8or. It is the same room as
256 <br>
257 from the specialFX example. Maybe you remember from that tutorial, I
258 am no good modeler at all and so I totally messed up the texture mapping
259 in this model, but we can simply repair it with the IMeshManipulator::makePlanarTextureMapping()
260 method.<br>
261 <br>
262 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
263 <tr>
264 <td> <pre> scene::IAnimatedMesh* roomMesh = smgr->getMesh(
265 "../../media/room.3ds");
266 scene::ISceneNode* room = 0;
267
268 if (roomMesh)
269 {
270 smgr->getMeshManipulator()->makePlanarTextureMapping(
271 roomMesh->getMesh(0), 0.003f);</pre></td>
272 </tr>
273 </table>
274 <br>
275 Now for the first exciting thing: If we successfully loaded the mesh
276 we need to apply textures to it. Because we want this room to be displayed
277 with a very cool material, we have to do a little bit more than just
278 set the textures. Instead of only loading a color map as usual, we also
279 load a height map which is simply a grayscale texture. From this height
280 map, we create a normal map which we will set as second texture of the
281 room. If you already have a normal map, you could directly set it, but
282 I simply didn&acute;t find a nice normal map for this texture. The normal
283 map texture is being generated by the makeNormalMapTexture method<br>
284 of the VideoDriver. The second parameter specifies the height of the
285 heightmap. If you set it to a bigger value, the map will look more rocky.<br>
286 <br>
287 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
288 <tr>
289 <td> <pre> video::ITexture* colorMap = driver->getTexture("../../media/rockwall.bmp");
290 video::ITexture* normalMap = driver->getTexture("../../media/rockwall_height.bmp");
291
292 driver->makeNormalMapTexture(normalMap, 9.0f);</pre></td>
293 </tr>
294 </table>
295 <br>
296 But just setting color and normal map is not everything. The material
297 we want to use needs some additional informations per vertex like tangents
298 and binormals.<br>
299 Because we are too lazy to calculate that information now, we let Irrlicht
300 do this for us. That's why we call IMeshManipulator::createMeshWithTangents().
301 It<br>
302 creates a mesh copy with tangents and binormals from any other mesh.
303 After we've done that, we simply create a standard mesh scene node with
304 this<br>
305 mesh copy, set color and normal map and adjust some other material settings.
306 Note that we set EMF_FOG_ENABLE to true to enable fog in the room.<br>
307 <br>
308 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
309 <tr>
310 <td> <pre>scene::IMesh* tangentMesh = smgr-&gt;getMeshManipulator()-&gt;createMeshWithTangents(<br> roomMesh-&gt;getMesh(0));<br> <br> room = smgr-&gt;addMeshSceneNode(tangentMesh);<br> room-&gt;setMaterialTexture(0, colorMap);<br> room-&gt;setMaterialTexture(1, normalMap);<br> room-&gt;getMaterial(0).SpecularColor.set(0,0,0,0);<br> room-&gt;setMaterialFlag(video::EMF_FOG_ENABLE, true);<br> room-&gt;setMaterialType(video::EMT_PARALLAX_MAP_SOLID); <br> room-&gt;getMaterial(0).MaterialTypeParam = 0.02f; // adjust height for parallax effect<br> // drop mesh because we created it with a create.. call.<br> tangentMesh-&gt;drop();<br> }<br></pre></td>
311 </tr>
312 </table>
313 <br>
314 After we've created a room shaded by per pixel lighting, we add a sphere
315 into it with the same material, but we'll make it transparent. In addition,<br>
316 because the sphere looks somehow like a familiar planet, we make it
317 rotate. The procedure is similar as before. The difference is that we
318 are loading <br>
319 the mesh from an .x file which already contains a color map so we do
320 not need to load it manually. But the sphere is a little bit too small
321 for our needs, so we scale it by the factor 50.<br>
322 <br>
323 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
324 <tr>
325 <td> <pre>// add earth sphere
326
327 scene::IAnimatedMesh* earthMesh = smgr->getMesh("../../media/earth.x");
328 if (earthMesh)
329 {
330 // create mesh copy with tangent informations from original earth.x mesh
331 scene::IMesh* tangentSphereMesh =
332 smgr->getMeshManipulator()->createMeshWithTangents(earthMesh->getMesh(0));
333
334 // set the alpha value of all vertices to 200
335 smgr->getMeshManipulator()->setVertexColorAlpha(tangentSphereMesh, 200);
336
337 // scale the mesh by factor 50
338 smgr->getMeshManipulator()->scaleMesh(
339 tangentSphereMesh, core::vector3df(50,50,50));
340
341 // create mesh scene node
342 scene::ISceneNode* sphere = smgr->addMeshSceneNode(tangentSphereMesh);
343 sphere->setPosition(core::vector3df(-70,130,45));
344
345 // load heightmap, create normal map from it and set it
346 video::ITexture* earthNormalMap = driver->getTexture("../../media/earthbump.bmp");
347 driver->makeNormalMapTexture(earthNormalMap, 20.0f);
348 sphere->setMaterialTexture(1, earthNormalMap);
349
350 // adjust material settings
351 sphere->setMaterialFlag(video::EMF_FOG_ENABLE, true);
352 sphere->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA);
353
354 // add rotation animator
355 scene::ISceneNodeAnimator* anim =
356 smgr->createRotationAnimator(core::vector3df(0,0.1f,0));
357 sphere->addAnimator(anim);
358 anim->drop();
359
360 // drop mesh because we created it with a create.. call.
361 tangentSphereMesh->drop();
362 }</pre></td>
363 </tr>
364 </table>
365 <br>
366 Per pixel lighted materials only look cool when there are moving lights.
367 So we add some. And because moving lights alone are so boring, we add
368 billboards <br>
369 to them, and a whole particle system to one of them. We start with the
370 first light which is red and has only the billboard attached.<br>
371 <br>
372 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
373 <tr>
374 <td> <pre>// add light 1 (nearly red)
375 scene::ILightSceneNode* light1 =
376 smgr->addLightSceneNode(0, core::vector3df(0,0,0),
377 video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 200.0f);
378
379 // add fly circle animator to light 1
380 scene::ISceneNodeAnimator* anim =
381 smgr->createFlyCircleAnimator (core::vector3df(50,300,0),190.0f, -0.003f);
382 light1->addAnimator(anim);
383 anim->drop();
384
385 // attach billboard to the light
386 scene::ISceneNode* bill =
387 smgr->addBillboardSceneNode(light1, core::dimension2d<f32>(60, 60));
388
389 bill->setMaterialFlag(video::EMF_LIGHTING, false);
390 bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
391 bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));</pre></td>
392 </tr>
393 </table>
394 <br>
395 Now the same again, with the second light. The difference is that we
396 add a particle system to it too. And because the light moves, the particles
397 of the particlesystem will follow. If you want to know more about how
398 particle systems are created in Irrlicht, take a look at the specialFx
399 example.<br>
400 Maybe you will have noticed that we only add 2 lights, this has a simple
401 reason: The low end version of this material was written in ps1.1 and
402 vs1.1, which doesn't allow more lights. You could add a third light
403 to the scene, but it won't be used to shade the walls. But of course,
404 this will change in future versions of Irrlicht were higher versions
405 of pixel/vertex shaders will be implemented too.<br>
406 <br>
407 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
408 <tr>
409 <td> <pre>// add light 2 (gray)
410 scene::ISceneNode* light2 =
411 smgr->addLightSceneNode(0, core::vector3df(0,0,0),
412 video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 200.0f);
413
414 // add fly circle animator to light 2
415 anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),200.0f);
416 light2->addAnimator(anim);
417 anim->drop();
418
419 // attach billboard to light
420 bill = smgr->addBillboardSceneNode(light2, core::dimension2d<f32>(120, 120));
421 bill->setMaterialFlag(video::EMF_LIGHTING, false);
422 bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
423 bill->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp"));
424
425 // add particle system
426 scene::IParticleSystemSceneNode* ps =
427 smgr->addParticleSystemSceneNode(false, light2);
428
429 ps->setParticleSize(core::dimension2d<f32>(30.0f, 40.0f));
430
431 // create and set emitter
432 scene::IParticleEmitter* em = ps->createBoxEmitter(
433 core::aabbox3d<f32>(-3,0,-3,3,1,3),
434 core::vector3df(0.0f,0.03f,0.0f),
435 80,100,
436 video::SColor(0,255,255,255), video::SColor(0,255,255,255),
437 400,1100);
438 ps->setEmitter(em);
439 em->drop();
440
441 // create and set affector
442 scene::IParticleAffector* paf = ps->createFadeOutParticleAffector();
443 ps->addAffector(paf);
444 paf->drop();
445
446 // adjust some material settings
447 ps->setMaterialFlag(video::EMF_LIGHTING, false);
448 ps->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp"));
449 ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
450
451
452 MyEventReceiver receiver(room, env, driver);
453 device->setEventReceiver(&receiver);</pre></td>
454 </tr>
455 </table>
456 <br>
457 Finally, draw everything. That's it.<br>
458 <br>
459 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
460 <tr>
461 <td> <pre>int lastFPS = -1;
462
463 while(device->run())
464 if (device->isWindowActive())
465 {
466 driver->beginScene(true, true, 0);
467
468 smgr->drawAll();
469 env->drawAll();
470
471 driver->endScene();
472
473 int fps = driver->getFPS();
474
475 if (lastFPS != fps)
476 {
477 core::stringw str = L"Per pixel lighting example - Irrlicht Engine [";
478 str += driver->getName();
479 str += "] FPS:";
480 str += fps;
481
482 device->setWindowCaption(str.c_str());
483 lastFPS = fps;
484 }
485 }
486
487 device->drop();
488
489 return 0;
490}
491</pre></td>
492 </tr>
493 </table>
494 <br>
495 </div>
496 </div>
497 </td>
498 </tr>
499</table>
500<p>&nbsp;</p>
501 </body>
502</html>