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) 决定表面材质特性,例如法 ...
随机推荐
- deep web
http://free.vpn.wwdhz.com/ (1小时vpn)http://thehiddenwiki.org (Hao123这样的导航网站)http://hss3uro2hsxfogf ...
- 谈谈异步加载JavaScript
前言 关于JavaScript脚本加载的问题,相信大家碰到很多.主要在几个点—— 1> 同步脚本和异步脚本带来的文件加载.文件依赖及执行顺序问题 2> 同步脚本和异步脚本带来的性能优化问题 ...
- Cocos2dx开发游戏移植到Android平台
第一步:安装配置安卓SDK,下载NDK并解压,下载cygwin并安装 第二步:导入platform文件夹下,android文件夹下java文件夹 在eclispe的windows--pereferen ...
- 查询DDOS攻击IP列表 grep -i
[root@xsx ~]# netstat -an|grep -i syn_recv|awk '{print $5}'|awk -F\: '{print $1}'|sort|uniq -c 1 149 ...
- ASP.NET Web.Config 读写辅助类
using System; using System.Configuration; using System.Web; using System.Web.Configuration; namespac ...
- java中的null和""区别
(1)问题一:null和""的区别String s=null;string.trim()就会抛出为空的exception String s=""; string ...
- 【框架】RefreshListView下拉刷新
布局: <com.example.administrator.d30_myrefreshlistview.RefreshListView android:id="@+id/refres ...
- 寒假D1 B
B - B Crawling in process... Crawling failed Time Limit:0MS Memory Limit:0KB 64bit IO Format ...
- 最近公共祖先(lca)
囧啊囧. lca的求法太多了 倍增,tarjan,st,lct,hld.... 后边三个我就不写了,其中st我没写过,估计用不上,在线用倍增,离线用tarjan就行了. 嗯. 第一种,倍增(O(nlo ...
- PHP 实现 一致性哈希 算法(转的)
<?php /** * Flexihash - A simple consistent hashing implementation for PHP. * * The MIT License * ...


