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) 决定表面材质特性,例如法 ...
随机推荐
- ping: unknown host www.baidu.com
#注意有很多的DNS服务器 为了防止DDOS攻击 所以都禁止PING [root@86 ~]# ping -c 2 www.baidu.com ping: unknown host www.baidu ...
- stsadm.exe
Usage: stsadm.exe -o <operation> [<parameters>] stsadm.exe -help [<operation>] Ope ...
- SQL如何在数据库间复制表
方法一: DB1 tb1 DB2 tb2 选择DB1 到表的列表那里选择tb1表 右键 所有任务 数据导出 下一步 选择你要导出的数据库DB1 下一步 选择你要导入的数据库DB2 下一步 选 ...
- sublime Emmet的用法及相关语法
本节来讲一下Emmet插件的用法及相关语法. Emmet插件极大的提高了编程员的编程速度,下面我们来讲讲它的具体语法: 一.生成 HTML 文档初始结构 HTML 文档的初始结构,就是包括 docty ...
- php session跨页面传递 session值丢失问题
.session_start();应该尽量放置到页面的顶部: .如果php.ini里面没有配置 session Autostart的话,每次会话之前,都得手动开启session:session_sta ...
- Gym 100971D Laying Cables 单调栈
Description One-dimensional country has n cities, the i-th of which is located at the point xi and h ...
- MySQL 安装 启动命令总结
MySQL 安装 启动 基本语法概述 MySQL安装和配置 我是直接使用安装包:mysql-installer-community-5.6.10.1.msi 安装的时候其中有几点要注意: 1.记住端口 ...
- WPF如何实现拖拽打开文件(将文件拖进窗体打开)
在WPF中的实现和WinForm中的实现99%相似,将要实现接受拖拽释放的控件添加DragEnter事件和Drop事件,本例中控件Grid grid作为接受控件,添加事件操作如下: private v ...
- LightOJ1316 A Wedding Party(状压DP)
这题事实上只需要关心15个商店和一个起点一个终点,预处理出这几个点之间的最短距离.Floyd会超时,用Dijkstra即可. 然后就是dp[u][S]表示已经经过商店集合S且当前在第u个商店所花的最少 ...
- LightOJ1057 Collecting Gold(状压DP)
这道题可以想到几点: 整个行程可以看作一次次的行走,每次行走都是用最短的路程从某一非空点到达另外一非空点: 两点间最少的步数是二者x和y坐标差的最大值: 返回原点这个过程,肯定是取完最后一个黄金后直接 ...


