HDR Defered Shading (using MRT)
http://http.download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/Direct3D9/DeferredShading.zip
HDR Deferred Shading
This sample shows high dynamic range (HDR) lighting combined with deferred shading. Deferred shading is a technique where the components of the lighting equation (surface attributes like the normal, position, albedo, etc.) are rendered into multiple screensized render targets (MRTs). Lighting is then done using geometrically simple passes over these MRT buffers, fetching the components of the lighting equation and outputting lighting results. This results in less shaded depth complexity, less geometry processing, better batching, and a cleaner rendering pipeline. The high dynamic range comes from the lighting passes being accumulated using fp16 blending into a floating point render target, after which tone mapping and a bloom effect are done using fp16 filtering to get the HDR results into the displayable 0..1 range. |
![]() |
![]() |
|
|
|
MRT0: Diffuse
MRT1: Normals
MRT2: Depth
Final scene
If use vs2008 to compile, there is a compilation error as below:
fatal error C1083: :“dxerr9.h”: No such file or directory
这个问题主要是头文件中“dxerr9.h”是D3DX9的版本,而你有可能用了比它更新的版本,比如D10或者D11。因为在后续版本汇总把err头文件改成了“DxErr.h”这个可以到DirectX的安装目录/Include下去确认。所以需要改的是将相应的头文件和附加项改掉。
1、将头文件include<dxerr9.h>改成include<DxErr.h> 无关大小写;
2、将附加项中的DxErr9.lib改成DxErr.lib:如果你用的VS2008或者VS2010 Project/Properties/Linker/Input/Additional Dependencies , 然后打开改动。
这样就可以运行了。
Next error is about DirectSound8:
这个是因为win7和directx10及directx11不支持IDirectSound8,将IDirectSound8改为IDirectSound,LPDIRECTSOUND8改为LPDIRECTSOUND,反正碰到与sound相关的,将后面的8去掉,编译通过没问题
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(36) : error C2143: 语法错误 : 缺少“;”(在“*”的前面)
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(36) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(36) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(43) : error C2146: 语法错误 : 缺少“;”(在标识符“GetDirectSound”的前面)
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(43) : error C2433: “CSoundManager::LPDIRECTSOUND8”: 不允许在数据声明中使用“inline”
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(43) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(43) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(43) : warning C4183: “GetDirectSound”: 缺少返回类型;假定为返回“int”的成员函数
1>d:\\deferredshading\libs\inc\dxut\dxutsound.h(43) : error C2065: “m_pDS”: 未声明的标识符
1>d:\program files\microsoft visual studio 9.0\vc\include\tchar.h(26) : fatal error C1189: #error : Need to include strsafe.h after tchar.h
Next error :
=========
d:\program files\microsoft visual studio 9.0\vc\include\tchar.h(26) : fatal error C1189: #error : Need to include strsafe.h after tchar.h
solution: d:\deferredshading\demos\direct3d9\inc\shared\dxstdafx.h, add the two line below before #include <d3d9.h>
#include <windows.h>
#include <tchar.h>
Now, compilation pass, but there is link error
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "long __cdecl DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YAJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z),该符号在函数 _WinMain@16 中被引用
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "public: long __thiscall CDXUTDialog::AddStatic(int,wchar_t const *,int,int,int,int,bool,class CDXUTStatic * *)" (?AddStatic@CDXUTDialog@@QAEJHPB_WHHHH_NPAPAVCDXUTStatic@@@Z),该符号在函数 "void __cdecl InitApp(void)" (?InitApp@@YAXXZ) 中被引用
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "public: long __thiscall CDXUTListBox::AddItem(wchar_t const *,void *)" (?AddItem@CDXUTListBox@@QAEJPB_WPAX@Z),该符号在函数 "void __cdecl InitApp(void)" (?InitApp@@YAXXZ) 中被引用
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "public: long __thiscall CDXUTDialog::AddButton(int,wchar_t const *,int,int,int,int,unsigned int,bool,class CDXUTButton * *)" (?AddButton@CDXUTDialog@@QAEJHPB_WHHHHI_NPAPAVCDXUTButton@@@Z),该符号在函数 "void __cdecl InitApp(void)" (?InitApp@@YAXXZ) 中被引用
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "long __stdcall DXUTTrace(char const *,unsigned long,long,wchar_t const *,bool)" (?DXUTTrace@@YGJPBDKJPB_W_N@Z),该符号在函数 "long __stdcall OnCreateDevice(struct IDirect3DDevice9 *,struct _D3DSURFACE_DESC const *,void *)" (?OnCreateDevice@@YGJPAUIDirect3DDevice9@@PBU_D3DSURFACE_DESC@@PAX@Z) 中被引用
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "wchar_t const * __cdecl DXUTGetDeviceStats(void)" (?DXUTGetDeviceStats@@YAPB_WXZ),该符号在函数 "void __cdecl RenderText(void)" (?RenderText@@YAXXZ) 中被引用
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "public: long __thiscall CDXUTTextHelper::DrawTextLine(wchar_t const *)" (?DrawTextLine@CDXUTTextHelper@@QAEJPB_W@Z),该符号在函数 "void __cdecl RenderText(void)" (?RenderText@@YAXXZ) 中被引用
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "wchar_t const * __cdecl DXUTGetFrameStats(void)" (?DXUTGetFrameStats@@YAPB_WXZ),该符号在函数 "void __cdecl RenderText(void)" (?RenderText@@YAXXZ) 中被引用
1>DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号 "public: long __thiscall CDXUTStatic::SetText(wchar_t const *)" (?SetText@CDXUTStatic@@QAEJPB_W@Z),该符号在函数 "void __stdcall OnGUIEvent(unsigned int,int,class CDXUTControl *,void *)" (?OnGUIEvent@@YGXIHPAVCDXUTControl@@PAX@Z) 中被引用
1>../../bin/debug/DeferredShading.exe : fatal error LNK1120: 9 个无法解析的外部命令
dumpbin /ALL DXUT.lib > dxut.log, found the symbol name doesn't match btw *.obj and DXUT.lib
AE984 ?AddStatic@CDXUTDialog@@QAEJHPBGHHHH_NPAPAVCDXUTStatic@@@Z
6 ?__LINE__Var@?1??DXUTCreateWindow@@YAJPBGPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z@4JA
遇到个NV demo的 vs2008 链接问题
发现是符号名称不完全匹配,不知道vs的编译器是怎么产生symbol的有没有什么
DeferredShadingApp.obj : error LNK2019: 无法解析的外部符号"long __cdecl DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YAJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z),该符号在函数_WinMain@16 中被引用
然后在DXUT.lib里
这个函数的符号名稍微有不同
DXUT.lib 里, 1594BC ?DXUTCreateWindow@@YAJPBGPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z
还是找NVDSK 9.5,然后重新编译DXUT再看看
http://developer.download.nvidia.com/SDK/9.5?M=A
HDR Defered Shading (using MRT)的更多相关文章
- [ZZ] RGBM and RGBE encoding for HDR
Deferred lighting separate lighting rendering and make lighting a completely image-space technique. ...
- 引擎设计跟踪(九.14.3) deferred shading 准备
目前做的一些准备工作 1.depth prepass for forward shading. 做depth prepass的原因是为了完善渲染流程, 虽然架构上支持多个pass, 但实际上从来没有测 ...
- Medusa引擎开源了
首先贴出 Github地址 然后博客地址 相比于市面上其他的著名游戏引擎,例如Unity,cocos2dx,Unreal,Medusa游戏引擎目前还非常的简陋,目前实现的功能还集中在2D部分,3D的虽 ...
- Deferred Lighting
Deferred lighting separate lighting from rendering and make lighting a completely image-space techni ...
- Deferred Shading,延迟渲染(提高渲染效率,减少多余光照计算)【转】
Deferred Shading,看过<Gems2> 的应该都了解了.最近很火的星际2就是使用了Deferred Shading. 原帖位置: http://blog.csdn.net ...
- Deferred shading rendering path翻译
Overview 概述 When using deferred shading, there is no limit on the number of lights that can affect a ...
- Unity的Deferred Shading
什么是Deferred Shading Unity自身除了支持前向渲染之外,还支持延迟渲染.Unity的rendering path可以通过Edit/Project Settings中的Graphic ...
- [ZZ] HDR the bungie way
http://blog.csdn.net/toughbro/article/details/6755394 bufferencoding游戏float算法 bungie 06年,gamefest上的p ...
- Deferred Shading(延迟渲染)
1.简介 在计算机图形学的词典里,Shading表示“对受光物体的渲染”,这个渲染过程包括下面几步[1]: 1) 计算几何多边形(也就是Mesh). 2) 决定表面材质特性,例如法 ...
随机推荐
- Redis笔记(三)Redis的数据类型
前面说过,Redis的一大特性是支持丰富的数据类型, 这为更多的应用场景提供了可能. Redis有五种数据类型,包括string,list,set,sorted set和hash,注意,Redis的数 ...
- 批量传递ID数组字符串到后台的处理
js代码: $(function () { $("#btnTest").click(function () { var array = new Array(); array.pus ...
- jquery easy ui 1.3.4 表单(7)
7.1.ValidateBox(表单验证) 使用validType属性指定验证方法 1.标签方式创建 <input type="text" class="easyu ...
- 在HTML中优雅的生成PDF
关键代码<script type=</text> </para> <para align=" value=" ...
- 对学长所谓“改变世界的游戏”《shield star》的运行感想-毛宇部分(完整版本请参考团队博客)
对于学长项目<shield star>的思考和看法: Ryan Mao ((毛宇) 110616-11061171 试用了一下学长黄杨等人开发的<shield star>游戏 ...
- C++的那些事:表达式与语句
表达式 1,应该把函数调用当作是一种运算符,这种运算符对参与运算的对象没有数量限制. 2,关于“左值(lvalue)”和“右值(rvalue)”可以做一个简单的归纳:当一个对象被用作右值的时候,用的是 ...
- kali实用链接
1.Kali-linux安装之后的简单设置 :http://xiao106347.blog.163.com/blog/static/215992078201342410347137/ 2.kali文 ...
- android 按钮宽度按比例
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_paren ...
- 解析Cloudera Manager内部结构、功能包括配置文件、目录位置等
转载自 http://www.aboutyun.com/thread-9189-1-1.html 问题导读1.CM的安装目录在什么位置? 2.hadoop配置文件在什么位置? 3.Cloudera m ...
- LoadRunner中多值关联的3种处理方式
需求:通过关联取得的ParamName参数可能存在多个值,需要对每个ParamName参数值进行处理 脚本:可通过3种不同的实现方式,将每个参数值作为HTTP请求内容发出 web_reg_save_ ...


