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.

 

User Guide

Video  
Download

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)的更多相关文章

  1. [ZZ] RGBM and RGBE encoding for HDR

    Deferred lighting separate lighting rendering and make lighting a completely image-space technique. ...

  2. 引擎设计跟踪(九.14.3) deferred shading 准备

    目前做的一些准备工作 1.depth prepass for forward shading. 做depth prepass的原因是为了完善渲染流程, 虽然架构上支持多个pass, 但实际上从来没有测 ...

  3. Medusa引擎开源了

    首先贴出 Github地址 然后博客地址 相比于市面上其他的著名游戏引擎,例如Unity,cocos2dx,Unreal,Medusa游戏引擎目前还非常的简陋,目前实现的功能还集中在2D部分,3D的虽 ...

  4. Deferred Lighting

    Deferred lighting separate lighting from rendering and make lighting a completely image-space techni ...

  5. Deferred Shading,延迟渲染(提高渲染效率,减少多余光照计算)【转】

    Deferred Shading,看过<Gems2> 的应该都了解了.最近很火的星际2就是使用了Deferred Shading. 原帖位置:   http://blog.csdn.net ...

  6. Deferred shading rendering path翻译

    Overview 概述 When using deferred shading, there is no limit on the number of lights that can affect a ...

  7. Unity的Deferred Shading

    什么是Deferred Shading Unity自身除了支持前向渲染之外,还支持延迟渲染.Unity的rendering path可以通过Edit/Project Settings中的Graphic ...

  8. [ZZ] HDR the bungie way

    http://blog.csdn.net/toughbro/article/details/6755394 bufferencoding游戏float算法 bungie 06年,gamefest上的p ...

  9. Deferred Shading(延迟渲染)

    1.简介      在计算机图形学的词典里,Shading表示“对受光物体的渲染”,这个渲染过程包括下面几步[1]: 1) 计算几何多边形(也就是Mesh).      2) 决定表面材质特性,例如法 ...

随机推荐

  1. js prototype

    1 原型法设计模式 在.Net中可以使用clone()来实现原型法 原型法的主要思想是,现在有1个类A,我想要创建一个类B,这个类是以A为原型的,并且能进行扩展.我们称B的原型为A. 2 javasc ...

  2. VS读取文件或写入文件时出现中文乱码问题

    最近我发现我从文本文档中读取文件处理后再存入新文本文档后,只要是有中文的都显示乱码了~~当我把中文去掉后一切又都正常了,而在我处理过程中,很确定没有对中文进行处理.使用记事本打开发现没有乱码现象,但是 ...

  3. VBScript [ 译 ]

    VBScript ( Visual Basic Scripting Edition) 使用COM 来和宿主环境交互.从Microsoft Windows 98 开始的所有的微软桌面操作系统的relea ...

  4. PHP 过滤 及 字符转换 函数

    PHP过滤html标签的内部函数. php过滤html的函数: strip_tags(string) 这样就可以过滤掉所有的html标签了. 如果想过滤掉除了<img src="&qu ...

  5. 利用OData轻易实现串流数据的可视化

    OData(开放数据协议,Open Data Protocol)一直是我喜欢一种的标准(OASIS 标准),它基于RESTful协议提供了一种强大的查询和编辑数据的访问接口.虽然是微软推出的,不过在诞 ...

  6. 三星笔记本预装WIN8_降级WIN7方法

    相信很多人在近两年购买笔记本都会遇到这样的问题.预装系统是windows 8用着不习惯想换系统的请往下看.换windows 7  windows XP 设备方法相同 WIN8降级WIN7是要重新分区的 ...

  7. C++的那些事:const用法面面观

    一.const是什么 在 C/C++ 语言中,const关键字是一种修饰符.所谓“修饰符”,就是在编译器进行编译的过程中,给编译器一些“要求”或“提示”,但修饰符本身,并不产生任何实际代码.就 con ...

  8. Android 贝塞尔曲线 折线图

    1.贝塞尔曲线:http://baike.baidu.com/view/60154.htm,在这里理解什么是贝塞尔曲线 2.直接上图: 3.100多行代码就可以画出贝塞尔曲线,直接上代码 packag ...

  9. sample

    sample是在数据源取样. val data = sc.parallelize(1 to 20) data.sample(true,0.4).collect sample第一个参数表示是否是重复抽样 ...

  10. 调整linux的时钟

    想把linux时钟调整的正常了. 网上找了找资料,找到了同步办法: http://blog.51yip.com/server/1474.html 即使用: sudo yum install ntp s ...