标签:style blog http color width 2014
1、将flare.dds和flarealpha.dds拷贝到工程目录
2、创建shader resource view
HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, L"Textures/flare.dds", 0, 0, &mFlareSRV, 0)); HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, L"Textures/flarealpha.dds", 0, 0, &mFlareAlphaSRV, 0));
3、在Basic.fx中添加纹理
Texture2D gFlare;
Texture2D gFlareAlpha;
4、设置纹理
Flare = mFX->GetVariableByName("gFlare")->AsShaderResource(); FlareAlpha = mFX->GetVariableByName("gFlareAlpha")->AsShaderResource();
5、在Basic.fx中将两个texel的值相乘(component-wise multiply)
float4 flareTex = gFlare.Sample(samAnisotropic, pin.Tex); float4 flareAlphaTex = gFlareAlpha.Sample(samAnisotropic, pin.Tex); texColor = flareTex * flareAlphaTex;
6、搞定
3D Game Programming with directx 11 习题答案 8.3,布布扣,bubuko.com
3D Game Programming with directx 11 习题答案 8.3
标签:style blog http color width 2014
原文地址:http://www.cnblogs.com/KEGame/p/3838073.html