提交 8cac7672 编写于 作者: GamebabyRockSun_QQ's avatar GamebabyRockSun_QQ

添加了24号示例,详情请看ReadMe.md文档中的描述

上级 e50ea21e
此差异已折叠。
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{c69d3e81-faf3-4c6b-828d-6366e1685c09}</ProjectGuid>
<RootNamespace>My24CubeMapWithoutDDS</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="24-CubeMapWithoutDDS.cpp" />
</ItemGroup>
<ItemGroup>
<FxCompile Include="Shader\GRS_SkyBox.hlsl">
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">SkyboxVS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">SkyboxVS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">SkyboxVS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">SkyboxVS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
</FxCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Shader">
<UniqueIdentifier>{7a0e16f7-d4b1-404d-9b4c-96f966d2da6f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="24-CubeMapWithoutDDS.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<FxCompile Include="Shader\GRS_SkyBox.hlsl">
<Filter>Shader</Filter>
</FxCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
cbuffer CB_GRS_SCENE_MATRIX : register(b0)
{
row_major matrix g_mxInvWVP;
}
TextureCube g_txCubeMap : register(t0);
SamplerState g_smpLinear : register(s0);
struct ST_GRS_HLSL_VS_IN
{
float4 m_v4LPos : POSITION;
};
struct ST_GRS_HLSL_PS_IN
{
float4 m_v4WPos : SV_POSITION;
float3 m_v3Tex : TEXCOORD0;
};
ST_GRS_HLSL_PS_IN SkyboxVS(ST_GRS_HLSL_VS_IN stVSInput)
{
ST_GRS_HLSL_PS_IN stVSOutput;
stVSOutput.m_v4WPos = stVSInput.m_v4LPos;
stVSOutput.m_v3Tex = normalize(mul(stVSInput.m_v4LPos, g_mxInvWVP).xyz);
return stVSOutput;
}
float4 SkyboxPS(ST_GRS_HLSL_PS_IN stPSInput) : SV_TARGET
{
return g_txCubeMap.Sample(g_smpLinear, stPSInput.m_v3Tex);
}
Author
======
This is the work of Emil Persson, aka Humus.
http://www.humus.name
License
=======
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
http://creativecommons.org/licenses/by/3.0/
Author
======
This is the work of Emil Persson, aka Humus.
http://www.humus.name
License
=======
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
http://creativecommons.org/licenses/by/3.0/
......@@ -49,6 +49,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22-MultiInstance-PBR-Sphere
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23-Structured_Empty", "23-Structured_Empty\23-Structured_Empty.vcxproj", "{A2CBF947-07A7-42D9-A268-3CDDD9BCF2AE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24-CubeMapWithoutDDS", "24-CubeMapWithoutDDS\24-CubeMapWithoutDDS.vcxproj", "{C69D3E81-FAF3-4C6B-828D-6366E1685C09}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
......@@ -335,6 +337,18 @@ Global
{A2CBF947-07A7-42D9-A268-3CDDD9BCF2AE}.Release|x64.Build.0 = Release|x64
{A2CBF947-07A7-42D9-A268-3CDDD9BCF2AE}.Release|x86.ActiveCfg = Release|Win32
{A2CBF947-07A7-42D9-A268-3CDDD9BCF2AE}.Release|x86.Build.0 = Release|Win32
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Debug|x64.ActiveCfg = Debug|x64
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Debug|x64.Build.0 = Debug|x64
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Debug|x86.ActiveCfg = Debug|Win32
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Debug|x86.Build.0 = Debug|Win32
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Profile|x64.ActiveCfg = Debug|x64
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Profile|x64.Build.0 = Debug|x64
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Profile|x86.ActiveCfg = Debug|Win32
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Profile|x86.Build.0 = Debug|Win32
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Release|x64.ActiveCfg = Release|x64
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Release|x64.Build.0 = Release|x64
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Release|x86.ActiveCfg = Release|Win32
{C69D3E81-FAF3-4C6B-828D-6366E1685C09}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -122,3 +122,12 @@
![image-20210911203050730](ScreenShot/22.jpg)
# 23-Structured_Empty
&emsp;&emsp;这个示例是将之前示例中过多的变量进行了分类整理,比做了初步结构化封装,注意这不是教大家如何封装,而是为了后续的例子编写和学习的方便性,不再用去过多的记忆太多的变量及用途,而是分门别类放在结构体里,方便大家理解和学习。需要注意的是,这并不是估计大家封装的做法,因为这里用结构体封装了对象,这是一般封装思路中的大忌,所以在真实的项目代码中,大家一定要使用类来封装成员对象,结构体就是结构体,不要有函数,一般也不要有对象成员,否则后续代码会变得很诡异,而且理解和修改也是极其麻烦的。我将这个原则叫做 C/C++ style 分离(代码风格分离,不要用C写类似C++风格的代码,更不要用C++写类似C风格的代码)。
# 24-CubeMapWithoutDDS
&emsp;&emsp;这个示例是个过渡示例,重点是让大家理解 Cube Map 或者说 Skybox(天空盒)纹理的构造,及单独每个面图片的创建和加载方法,也是为了让大家未来彻底丢掉DDS纹理做铺垫,因为DDS的来源较少,并且修改和使用也不直观,作为学习来说 DDS 格式本身就已经“过渡封装”了,非常不利于大家理解和掌握纹理操作的本质。另外这个示例也是为之后的 IBL 渲染做好铺垫,因为IBL渲染中有大量的Texture操作,尤其是有大量的 Cube Map 操作,如果不能很好的理解 Cube Texture 的构造及创建等相关操作方法的话,就几乎无法理解 IBL 的根本原理。
![image-20220829121837669](ScreenShot/24.png)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册