第八章 第三题

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. 好用的ajax后台框架

    dwz 简单实用的国产jquery Ui框架 http://www.j-ui.com/#_blank

  2. Opencl API解释(二)

    欢迎关注,转载引用请注明 http://blog.csdn.net/leonwei/article/details/8909897 这里将更深入的说明一些OpenCL API的功能 1. 创建buff ...

  3. 日志配置log4j 打印线程号

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 # Set root logger level to WARN and a ...

  4. python中类的继承

    python中类的继承 在python中面向对象编程中实现继承,以下面一个实例进行说明. class SchoolMenber(): # __init__类似于c++中的构造函数 # __init__ ...

  5. Eclipse修改字体大小

    1.MyEclipse|Window|General|Appearance|Colors and Fonts->点击Text Font->Edit

  6. Oracle 的 VKTM 进程 - virtual keeper of time

    在Oracle Database 11g中,VKTM是一个新增的后台进程.这个进程的含义是: VKTM (virtual keeper of time) is responsible for prov ...

  7. CodeForces - 269C Flawed Flow

    http://codeforces.com/problemset/problem/269/C 题目大意: 给定一个边没有定向的无法增广的残量网络且1是源点,n是汇点,给定每条边中的流.  让你把所有边 ...

  8. TimeSpan XML序列化

    /// <summary> /// 刷新时间 默认为1秒 /// </summary> /// <value>The refresh time.</value ...

  9. HTML5 汽泡效果

    又到了晚上了,精神只有在晚上的时候才能爆发,可能程序员的命吧.废话就不多说了,今天我为大家带来的是一个气泡的效果.  代码下载 下面请看效果图

  10. 【JAVA - SSM】之MyBatis开发DAO

    在SSM框架中的DAO层就是MyBatis中的Mapper,Mapper分为两部分:Mapper接口(JAVA文件)和Mapper映射文件(XML文件).DAO开发(Mapper开发)有两种方式:原始 ...