Direct3D 11效果文件已弃用? [英] Direct3D 11 effect files deprecated?

查看:129
本文介绍了Direct3D 11效果文件已弃用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直在玩Direct3D 11,并且由于缺乏有关API基础知识的文档(例如简单的几何图形渲染)而感到沮丧。稀疏文档带来的混乱点之一是(明显)不使用着色器效果。

I've been playing around with Direct3D 11 a little bit lately and have been frustrated by the lack of documentation on the basics of the API (such as simple geometry rendering). One of the points of confusion brought on by the sparse documentation is the (apparent) move away from the use of effects for shaders.

在D3D11中,所有效果(.fx)支持都已从D3DX库中删除,并埋藏在很难找到的(当然是文档很少的)共享源中图书馆。所包含的示例均未使用它,而是直接编译HLSL文件。所有这些都对我说,Microsoft试图使人们停止使用效果文件格式。真的吗?是否有任何说明这些内容的文件?无论哪种方法我都很好,但是多年来,他们一直在推广.fx格式,因此突然决定放弃它似乎有点奇怪。

In D3D11 all of the effect (.fx) support has been removed from the D3DX libraries and buried away in a hard to find (sparsely documented, of course) shared source library. None of the included examples use it, preferring instead to compile HLSL files directly. All of this says to me that Microsoft is trying to get people to stop using the effect file format. Is that true? Is there any documentation of any kind that states that? I'm fine doing it either way, but for years now they've been promoting the .fx format so it seems odd that they would suddenly decide to drop it.

推荐答案

我处于完全相同的位置,并且甚至为使用D3DX11CreateEffectFromMemory的最简单的示例疯狂搜索之后,我我们也得出这样的结论:.fx文件支持不是他们的最高优先级。尽管很奇怪,他们添加了EffectGroup概念,这是11的新功能,如果他们不想我们使用它。

I'm in the exact same position, and after Googling like crazy for even the simplest sample that uses D3DX11CreateEffectFromMemory, I've too come to the conclusion that .fx file support isn't their highest prio. Although it is strange that they've added the EffectGroup concept, which is new to 11, if they don't want us to use it.

我玩过新的反射API几乎没有什么用,所以看起来很容易将您自己的函数用于设置变量等,实质上是创建自己的Effect-class,下一步将是查看它们的支持通过API创建渲染状态块。能够直接在.fx文件中进行编辑的功能非常好,因此希望类似的东西仍然存在(或者,更糟的是,我可以从Effect11代码中删除该部分)。

I've played a little with the new reflection API, so it looks like it will be pretty easy to hack together your own functions for setting variables etc, in essence creating your own Effect-class, and the next step is going to be to see what support their is for creating render state blocks via the API. Being able to edit those directly in the .fx file was very nice, so hopefully something like that still exists (or, at worst, I can rip that part from the Effect11 code).

这篇关于Direct3D 11效果文件已弃用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆