随笔分类 -  dx11

2012.9月
摘要:// 设置体元语义,渲染三角形列表.deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST);以前我们选择的体元语义都是triangle list,在tessellation程序中,不一样了,现在我们的输入虽然还是一个三角形,但它当作patch处理,三个顶点即为patch的三个控制点。其它的shader文件中,我们都要加上下面的代码,否则的话,其它物体的渲染可能会出错:deviceContext->HSSetShader(NULL, NULL, 0);devic 阅读全文
posted @ 2012-10-31 15:46 凌霄神采奕奕 阅读(534) 评论(0) 推荐(0)
摘要:In the pixel shader, we first define base interfaces for different light and material types://-------------------------------------------------------------------------------------- // Interfaces //-------------------------------------------------------------------------------------- interface ... 阅读全文
posted @ 2012-10-15 15:19 凌霄神采奕奕 阅读(516) 评论(0) 推荐(0)
摘要:1.构造一个平截台体(Frustum)最近距离=-projMatirx.43/projMatrix.33projMatrix。33 =深度/(深度-最近距离)projMatrix。44=-最近距离*(深度/(深度-最近距离))FrustumMatrix = projectionMatrix*viewMatirx;FM=FrustumMatrix;//最近面m_planes[0].a = FrustumMatirx._14 + FrustumMatirx._13; m_planes[0].b = FrustumMatirx._24 + FrustumMatirx._23; m_planes[0] 阅读全文
posted @ 2012-10-15 11:23 凌霄神采奕奕 阅读(213) 评论(0) 推荐(0)
摘要:ID3D11DeviceContext InterfaceThe ID3D11DeviceContext interface represents a device context which generates rendering commands.MembersThe ID3D11DeviceContext interface inherits from ID3D11DeviceChild. ID3D11DeviceContext also defines the following types of members:MethodsMethodsThe ID3D11DeviceContex 阅读全文
posted @ 2012-10-10 15:06 凌霄神采奕奕 阅读(661) 评论(0) 推荐(0)
摘要:资源视图(VIEW)主要有两个功能 :1)告诉 Direct3D 如何使用资源 (即,指定资源所要绑的管线阶段 ); 2)如果在创 建资源时指定的是弱类型 (typeless )格式 ,那么在为它创建资源视图时就必须指定明确的类型 。对于弱类 ,纹理元素可能会在一个管线阶段中视为浮点数 而在另一个管线阶段中视为整数当创建资源时 , 为资源指定强 类型 ( fullyfully-typed)格式 , 把资源的用途 限制在格式规定的范围内 ,有利于提高运行时环境对资源的访问速度 ……”所以 ,你只应该在真正需要弱类型资 ,才创建弱类型资源 ;否则 ,应尽量创建强类型资源 应尽量创建强类型资源The 阅读全文
posted @ 2012-10-07 12:00 凌霄神采奕奕 阅读(162) 评论(0) 推荐(0)
摘要:Directx10和Directx11很多resource类都有个Map()函数,个人感觉它是一个蛮重要的CPU和GPU沟通桥梁。下面以ID3D11DeviceContext::Map()为例讲下。 ID3D11DeviceContext::Map官方解释是:ID3D11DeviceContext::Map Method Get a pointer to the data contained in a subresource, and deny the GPU access to that subresource. SyntaxHRESULT Map( ID3D11Resource *pRes 阅读全文
posted @ 2012-09-26 11:01 凌霄神采奕奕 阅读(1238) 评论(0) 推荐(0)
摘要:SV is short for Systems Value;This means that they have a specific meaning to the pipeline. In the case of SV_Position, if it's attached to a vertex shader output that means that the output will contain he final transformed vertex position used for rasterization. Or if you use it for a pixel sha 阅读全文
posted @ 2012-09-21 16:26 凌霄神采奕奕 阅读(3163) 评论(0) 推荐(0)
摘要:今天学习dx11的时候遇到一个问题,事情是这样的dx11引入了常量缓存(const buffer)用来实现数据的高速传输,这块儿buffer是cpu only write,gpu only read这样的特点,其他还是dx9的惯例,SetShaderParameters的时候,出现了这样的问题,先上代码: D3DXMatrixTranspose(&worldMatrix, &worldMatrix); D3DXMatrixTranspose(&viewMatrix, &viewMatrix); D3DXMatrixTranspose(&projectio 阅读全文
posted @ 2012-09-21 11:51 凌霄神采奕奕 阅读(832) 评论(0) 推荐(0)
摘要:dx11 04shader渲染intializeD3DX11CompileFromFile(vsFilename,NULL,NULL,"ColorVertexShader","vs_5_0",D3D10_SHADER_ENABLE_STRICTNESS,0,NULL, &vertexShaderBuffer,&errorMessage,NULL);D3DX11CompileFromFile(psFilename,NULL,NULL,"ColorPixelShader","ps_5_0", D3D10 阅读全文
posted @ 2012-09-20 18:12 凌霄神采奕奕 阅读(2065) 评论(0) 推荐(0)