摘要: DX默认绘制顺时针 ,cull逆时针.参考: http://blog.csdn.net/diyer2002/article/details/1655146绘制东西时,还是在纸上画画比较好,脑袋想容易出错。顺时针的判断:根据三角形的法线和摄像机方向向量乘积的值,小零则为顺时针。(左手坐标系下) ... 阅读全文
posted @ 2014-04-17 20:23 dust_fly 阅读(1042) 评论(0) 推荐(0)
摘要: int sizeLight = sizeof(LightStruct); wchar_t bufferT[256]; wsprintfW(bufferT,L"%d",sizeLight); MessageBox(NULL,bufferT,bufferT,MB_OK);其中:LPCWSTR: t... 阅读全文
posted @ 2014-04-17 14:06 dust_fly 阅读(599) 评论(0) 推荐(0)
摘要: 今天创建constantBuffer给shader使用时一直不成功:struct LightStruct{ XMFLOAT4 lightColor; XMFLOAT3 lightDir;// float ss;//};createBuffer时,constant lightStruct的buffe... 阅读全文
posted @ 2014-04-17 14:01 dust_fly 阅读(205) 评论(0) 推荐(0)
摘要: 参考:https://blog.delphij.net/2009/12/buffercache.html 目的: cache 是cpu和主存之间的硬件,由于cpu的计算速度远快与读取主存数据速度,用cache存储cpu刚刚用过的数据,同时cache的读取速度较快。这样来提高cpu读取 ... 阅读全文
posted @ 2014-04-14 22:39 dust_fly 阅读(228) 评论(0) 推荐(0)
摘要: fxc.exe可以用于 编译fx的语法问题。今天实现: 1.显示两个不同z值的不同纹理三角形 2.一个被覆盖掉一部分 问题:为什么是ID3D11Texture2D 而不是ID3D11Buffer来创建 depthStencil Buffer呢,规定吧,毕竟depthStencil需要知道view的w... 阅读全文
posted @ 2014-04-14 22:31 dust_fly 阅读(1746) 评论(0) 推荐(0)
摘要: http://www.rastertek.com/tutindex.html上面网址的教程用微软初级教程的顺序编程来实现,不用考虑类。今天是教程5添加纹理功能。添加texture:1.定义上: 修改vertexStruct, 定义ID3D11ShaderResourceView(实例化资源 供sha... 阅读全文
posted @ 2014-04-13 20:41 dust_fly 阅读(1121) 评论(0) 推荐(0)
摘要: 今绘制三角形一直不显示:后对比给出的例子发现是 PixelShader输入的Position应定义为 SV_POSITION而不是POSITIONmsdn上SV_POSITION的描述:1.When used in a pixel shader, SV_Position describes the ... 阅读全文
posted @ 2014-04-11 18:06 dust_fly 阅读(1376) 评论(0) 推荐(0)
摘要: 哎呦我去,网上例子很多说Thread和Runnable区别是资源共享。1.两个是不同类别,一个类,一个借口。Thread implements Runnable2.例子里 三个售票窗口 卖10张票,两者都可以实现。 可以说,实现多线程的方式 有Thread和Runnable两种。class MutliThread extends Thread{//class MutliThread implements Runnable{//都可实现资源共享 private int ticket=10;// public void run(){ while(ticket>0){ ... 阅读全文
posted @ 2014-04-11 16:05 dust_fly 阅读(192) 评论(0) 推荐(0)
摘要: 今决定先看dx sample browser上的内容,毕竟好理解些。Tutorial 0: Win32 Basics1.setting up an empty window to prepare for Direct3D基本上没看懂啥意思。。。。。。。。。待有空解读:LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )??Tutorial 1: Direct3D 11 Basics:create three objects: adevice, animmediate context, 阅读全文
posted @ 2014-03-13 19:52 dust_fly 阅读(371) 评论(0) 推荐(0)