第八章 第三题

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的更多相关文章

  1. 3D Game Programming with directx 11 习题答案 8.2

    第八章 第二题 1.首先找到Directx Texture Tool,它位于 2.填入配置 3.用画图工具画好每个level的图片,例如level0 4.用Directx Texture Tool添加 ...

  2. Introduction to 3D Game Programming with DirectX 11 翻译--开篇

    Direct3D 11简介 Direct3D 11是一个渲染库,用于在Windows平台上使用现代图形硬件编写高性能3D图形应用程序.Direct3D是一个windows底层库,因为它的应用程序编程接 ...

  3. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十三章:角色动画

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十三章:角色动画 学习目标 熟悉蒙皮动画的术语: 学习网格层级变换 ...

  4. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十一章:环境光遮蔽(AMBIENT OCCLUSION)

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二十一章:环境光遮蔽(AMBIENT OCCLUSION) 学习目标 ...

  5. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十四章:曲面细分阶段

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十四章:曲面细分阶段 代码工程地址: https://github. ...

  6. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十三章:计算着色器(The Compute Shader)

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十三章:计算着色器(The Compute Shader) 代码工程 ...

  7. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试 代码工程地址: https://github.co ...

  8. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第九章:贴图

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第九章:贴图 代码工程地址: https://github.com/j ...

  9. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第八章:光照

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第八章:光照 代码工程地址: https://github.com/j ...

随机推荐

  1. (DT系列二)device tree的书写规范

    devicetree的书写规范 下面从节点,属性,reg,ranges,中断控制器等几个方面叙述devicetree的书写规范. 1,dts的基本元素:节点 .dts(或者其include的.dtsi ...

  2. Axure RP 8.0 中继器初体验

    为了解决增删等复杂交互的问题,中继器是个不错的选择. 拖拽出一个默认的中继器 中继器的数据集感觉就像是数据库一样,在右边检视窗口中可以看到中继器的默认数据集,可以理解成一张二维表.默认有1列,现成的3 ...

  3. dell vfoglight

    vFoglight针对RH/Vmware/Hyper-v/Vsphere环境的相关软件包下载链接 https://software.dell.com/register/getfile/?param=2 ...

  4. cat、cp命令

    cat是查看文件内容, cp –cp是连目录及件文件都拷贝 cp是拷贝文件 a.txt里的内容是, abc def ghi cat a.txt |grep –v ghi 得到结果, abc def h ...

  5. Android之ContextMenu的使用方法以及与OptionMenu的区别

    >> ContextMenu是android的context menu上下文菜单,选择某项VIEW后长按menu键,就会显示出来.比如EditeText就可以通过长按来弹出拥有“cut”, ...

  6. clas

  7. NIO组件Selector工作机制详解(下)

    转自:http://blog.csdn.net/haoel/article/details/2224069 五.  迷惑不解 : 为什么要自己消耗资源? 令人不解的是为什么我们的Java的New I/ ...

  8. 图解三种APP的区别

  9. MVC入门教程-视图中的Layout使用

    本文目标 1.能够重用Razor模板进行页面的组件化搭建 本文目录 1.母板页_Layout.cshtml 2.用户自定义控件 3.默认Layout引用的使用(_ViewStart.cshtml) 1 ...

  10. OpenGL ES2学习笔记(9)-- 转换矩阵

    线性代数是计算机图形学的一块基石,本篇文章总结如何在Shader中使用矩阵来移动.缩放和旋转顶点. 代码和效果 把下面的代码复制到OpenGL Console里: import java.nio.By ...