Posts

Showing posts from August, 2010

Post-Build copy DLL to directory

 首先撰寫我們的batch file - build.bat :   XCOPY ..\..\folder\filename %1 /S /Y @pause  將它放在project檔案旁邊。接著在MSVC中project perporties中的 Post-Build Event輸入call ./build.bat $(OutDir)。 如此一來就 可以將我們的.dll copy到執行檔旁邊了。   Batch 教學 http://bbs.nsysu.edu.tw/txtVersion/boards/msdos/M.1078700757.A.html Batch指令 http://ca95.pixnet.net/blog/post/3922827 Creating a Batch File to copy a directory http://en.kioskea.net/forum/affich-30405-creating-a-batch-file-to-copy-a-directory   Pre-build Event/Post-build Event Command Line Dialog Box http://msdn.microsoft.com/en-us/library/42x5kfw4%28VS.80%29.aspx

D3D instancing

D3D instance 技术概述与实践 http://www.cnitblog.com/updraft/articles/56980.html  Efficiently Drawing Multiple Instances of Geometry (Direct3D 9) http://msdn.microsoft.com/en-us/library/bb173349%28VS.85%29.aspx  Instancing Sample http://msdn.microsoft.com/en-us/library/ee418269%28VS.85%29.aspx

Release Bug...

 這已經是我遇到第三次了吧,都是debug沒問題,到了執行release版本才會發生不可預期的錯誤,然後程式關不掉的問題...目前只能朝著記憶体超寫的問題作猜測,希望可以早點把問題解決@@ 結果竟然是dll and exe的project setting中optimization設定選項問題 (fiber-safe, whole program optimization),我手邊的project沒辦法讓exe dll跟slib用一樣最佳化的參數。改天真要好好搞懂那各是代表什麼意思。

Template in .cpp file

- Compiler uses template classes to create types by substituting template parameters, and this process is called instantiation . - The type that is created from a template class is called a  specialization.    //--------------------------------------------------------------- // in main.cpp #include "temp.h" int main() {     Foo A;     Foo B = A;         return 0; } // in temp .h template < typename T> class  Foo { public:     Foo() ;     ~Foo() ;     Foo( Foo &rhs )     {         int test = 0 ;     }; }; #include "temp.cpp" template < typename T> Foo ::Foo() {    int test = 0; } template < typename T> Foo ::~Foo() {     int test = 0; }   template class Foo ; // explicit instantiation    //---------------------------------------------------------------  With this approach, we don't have huge headers, and hence the build time will drop. Also, the header files will be "cleaner"

Shader Model 5.0

With Shader Model 5, Microsoft applies certain concepts of object-oriented programming to its shader language, HLSL. Unlike preceding versions, which introduced new capabilities (Dynamic Branching, integer support, etc.) Increase in maximum texture size from 4K x 4K to 16K x 16K and the possibility of limiting the number of mipmaps loaded in VRAM. There’s also the possibility of changing the depth value of a pixel without disabling functionality like early Z checking, support for double-precision floating-point types, scatter memory writes, etc. Reference: http://www.tomshardware.com/reviews/opengl-directx,2019-9.html GDC 2009, http://cmpmedia.vo.llnwd.net/o1/vault/gdc09/slides/100_Handout%206.pdf

Skybox Render

Skyboxes are often frame-buffer-bandwidth bound optimize them: (1) render them last, reading (but not writing) depth, and allow the early-z optimizations along with regular depth buffering to save bandwidth. (2) render the skybox first, and disable all depth reads and writes. Which option will save you more bandwidth is a function of the target hardware. If a large portion of the skybox is obscured, the first technique will likely be better; otherwise, the second one may save more bandwidth. reference: http://http.developer.nvidia.com/GPUGems/gpugems_ch28.html

GPU Gems

Gems 1: http://http.developer.nvidia.com/GPUGems/gpugems_part01.html Gems 2: http://http.developer.nvidia.com/GPUGems2/gpugems2_part01.html Gems 3: http://http.developer.nvidia.com/GPUGems3/gpugems3_part01.html