SetTexture()

编程入门 行业动态 更新时间:2024-10-24 01:53:13

SetTexture()

SetTexture()

设置当前要渲染的纹理  
HRESULT  SetTexture(  DWORD      Stage,                           //多级纹理的索引,从0-7,单层纹理取0  IDirect3DBaseTexture9        *pTexture      //Direct3D的纹理接口指针  
);  

Parameters

Sampler
[in] Zero based sampler number. Textures are bound to samplers; samplers define sampling state such as the filtering mode and the address wrapping mode. Textures are referenced differently by the programmable and the fixed function pipeline:
  • Programmable shaders reference textures using the sampler number. The number of samplers available to a programmable shader is dependent on the shader version. For vertex shaders, see see Sampler. For pixel shaders see Sampler.
  • The fixed function pipeline on the other hand, references textures by texture stage number. The maximum number of samplers is determined from two caps: MaxSimultaneousTextures and MaxTextureBlendStages of the D3DCAPS9 structure.

There are two other special cases for stage/sampler numbers.

  • A special number called D3DDDMAPSAMPLER is used for Displacement Mapping.
  • A programmable vertex shader uses a special number defined by a D3DVERTEXTEXTURESAMPLER when accessing Vertex Textures in vs_3_0.
pTexture
[in] Pointer to an IDirect3DBaseTexture9 interface, representing the texture being set.

更多推荐

SetTexture()

本文发布于:2023-06-13 09:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/679068.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SetTexture

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!