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 教學 Batch指令 Creating a Batch File to copy a directory   Pre-build Event/Post-build Event Command Line Dialog Box

D3D instancing

D3D instance 技术概述与实践  Efficiently Drawing Multiple Instances of Geometry (Direct3D 9)  Instancing Sample

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:,2019-9.html GDC 2009,

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:

GPU Gems

Gems 1: Gems 2: Gems 3: