
Direct3D
skyman_2001
这个作者很懒,什么都没留下…
展开
-
突然彻底明白了Stencil Shadow Volume的原理
前几天一直对用Stencil Buffer来判断物体是否位于Shadow Volume中的原理有些模糊,今天在喝公司的“立顿”红茶时突然顿悟了,有点坐禅的感觉,呵呵! 基本原理就是,在绘制正对视点的阴影体的面时,让Stencil Buffer加1;在绘制背对视点的阴影体的面时,让Stencil Buffer减1,这样在阴影体中的像素的stencil值就为1,其他的像素stenci原创 2006-09-30 10:25:00 · 5164 阅读 · 0 评论 -
HLSL中如何把输入映射到输出像素
当使用PS来进行2D图像处理的时候,实际上仍然在做3D成像。我们渲染多边形直接和屏幕对齐,然后覆盖在屏幕上。我们直接把2D Pixel Shader应用到这个表面上。 最常用的方法是用一个简单的与屏幕对齐的矩形(两个三角形)来覆盖屏幕。如果定义了一个3D单位大小的正方形,所有的点在x和y轴范围从-n到n(n一般取0.5或1.0),而z坐标为0。然后用下面的代码将它与屏幕对齐。注意原创 2006-12-17 16:30:00 · 2148 阅读 · 0 评论 -
在D3D中实现纹理的关键色透明
一般用于实现billboard。首先,通过D3DXCreateTextureFromFileEx()加载纹理:D3DXCreateTextureFromFileEx( g_pd3dDevice, "fire.bmp", D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0,原创 2006-08-18 11:58:00 · 3754 阅读 · 1 评论 -
Depth Bias
An application can help ensure that coplanar polygons are rendered properly by adding a bias to the z-values that the system uses when rendering the sets of coplanar polygons. To add a z-bias t转载 2006-08-21 20:54:00 · 3106 阅读 · 0 评论 -
Direct3D Performance Optimizations
摘自《DirectX Software Development Kit》(April 2006)Every developer who creates real-time applications that use 3D graphics is concerned about performance optimization. This section provides guidelines fo转载 2006-12-22 22:30:00 · 2283 阅读 · 5 评论 -
WJ的Direct3D简明教程1:Save Screen To the Image
转载请注明:来自http://blog.youkuaiyun.com/skyman_2001 IDirect3DSurface9 *pBackBuffer; // 取得后缓存表面 Device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer); // 将后缓存表面保存为文件(D3DXIFF_*为保存的图片格式,有B原创 2007-04-07 00:01:00 · 2270 阅读 · 0 评论 -
WJ的Direct3D简明教程2:Render-To-Texture
转载请注明:来自http://blog.youkuaiyun.com/skyman_2001Rendering to a texture is one of the advanced techniques in Direct3D. On the one hand it is simple, on the other hand it is powerful and enables numerous spec原创 2007-04-07 00:13:00 · 3521 阅读 · 1 评论 -
WJ的Direct3D简明教程3:Create Texture with User-defined Image Data
转载请注明:来自http://blog.youkuaiyun.com/skyman_2001Usually we use D3DXCreateTextureFromFile() function to create a texture from external file, but how do we create it with user-defined image data? The way is原创 2007-04-07 00:23:00 · 2974 阅读 · 0 评论