第八章 第三题

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、搞定

转载于:https://www.cnblogs.com/KEGame/p/3838073.html

3D Game Programming with directx 11 习题答案 8.3相关推荐

  1. 第一.Introduction to 3D Game Programming with DirectX 11介绍一

    搜索<Introduction to 3D Game Programming with DirectX 11>下载本书及代码 有的需要从VC++6.0的习惯中走出来 从VC++6.0到VS ...

  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 11》随书代码在 Win10 和 Visual Studio 2017上的修改

    <Introduction to 3D Game Programming with Directx 11>书中代码的修改以适配Win10 SDK(原版代码需依赖Microsoft Dire ...

  4. Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(一)

    顶点和顶点布局 在Direct3D中,顶点由空间位置和各种附加属性组成,Direct3D可以让我们灵活地建立属于我们自己的顶点格式:换句话说,它允许我们定义顶点的分量.要创建一个自定义的顶点格式,我们 ...

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

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

  6. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十五章:第一人称摄像机和动态索引...

    Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十五章:第一人称摄像机和动态索引 原文:Introduction to 3 ...

  7. Introduction to 3D Game Programming with DirectX 12一书学习记录(第一个例子编译错误)

    准备开始学一学d3d,听说<Introduction to 3D Game Programming with DirectX 12>这本书不错,于是就拿来学一学.不料第一个例子,按照书中的 ...

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

    Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十九章:法线贴图 原文:Introduction to 3D Game P ...

  9. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第四章:Direct 3D初始化

    学习目标 对Direct 3D编程在3D硬件中扮演的角色有基本了解: 理解COM在Direct 3D中扮演的角色: 学习基本的图形学概念,比如存储2D图像.页面切换,深度缓冲.多重纹理映射和CPU与G ...

最新文章

  1. 论文《一种金融市场预测的深度学习模型:FEPA》(3)--EMD+PCA
  2. Windows性能分析器概述(一)
  3. ffmpeg-- audio decoder
  4. 来自一名程序员的表白
  5. 【学习笔记】Python - PyQt
  6. 与时代并肩的数字创新者
  7. 讲师两年升“教授”,成功实现“三连跳”
  8. c++ 走向高级之日积月累
  9. [流体输配管网]古罗马渡槽从水源到城市的落差估计
  10. 《Xcode实战开发》——1.1节下载
  11. ubuntu装指定分区_安装Ubuntu16.04系统步骤详细加分区
  12. 洛谷刷题C语言:数字反转、再分肥皂水、三角形面积、Apples Prologue/苹果和虫子、数的性质
  13. C# 读取outlook 本地签名
  14. Docker基础(上)
  15. 3.牛顿迭代法求解方程的根
  16. android开发-验证邮箱输入是否合法
  17. 论如何在 uni-app 上使用 sockjs 以及 stomp(顺便)
  18. 2022年xx地 信息安全管理与评估赛题
  19. [Expression Blend 4] [SketchFlow系列] Chapter 1 瞭解SketchFlow Map (上)
  20. jQuery学习第一天(上)

热门文章

  1. vue 计算属性_lt;Vue 源码笔记系列6gt;计算属性 computed 的实现
  2. BootStrap笔记-badge的使用
  3. C++笔记-利用远程线程注入获取PC版微信个人昵称
  4. 前端笔记-webpack加载前端资源(图片,css等)
  5. Qt工作笔记-使用qrand与QTime产生随机数
  6. c++ ffmpeg内存推流_最简单的基于FFmpeg的AVfilter的例子
  7. php数组10000分割1000_PHP切割整数工具类似微信红包金额分配的思路详解
  8. 狼人杀c语言,微赛狼人杀正式版C位出道
  9. linux2.6 gcc,在Linux内核 2.6.38.7 上,gcc堆栈粉碎代码不工作 请帮助_gcc_开发99编程知识库...
  10. MySQL怎么给表简明_科学网—mySQL简明入门 - 张金龙的博文