* .hlsl文件有什么作用,此文件与* .fx文件之间的关系是什么? [英] What does *.hlsl files do, what the relationship between this file and *.fx file?

查看:216
本文介绍了* .hlsl文件有什么作用,此文件与* .fx文件之间的关系是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读DirectX项目的示例,我看到了 *。fx *。hlsl 文件。 / p>

我知道 fx 是DirectX读取的效果文件,但是 hlsl的目的是什么文件?此文件有用吗?

解决方案

历史上 fx 包含使用效果的着色器系统语法(技术 pass 等),而 hlsl 包含不带Effects系统语法的纯HLSL着色器。



但是,这纯粹是一种约定,实际上并没有特别一致地遵循。最后,重要的是用来编译文件的配置文件。 VS 2012+会将 fx hlsl 文件视为相同(即与您使用FXC构建的文件一样)。



Direct3D 11的最新效果可在 CodePlex GitHub ,但对 fx_5_0 配置文件的编译器支持已正式弃用。它仍然有效,但是它存在许多已知问题,并且将来可能会被删除。



请参见Effect 11项目站点上的讨论线程: .fx和.hlsl文件之间有何区别?


I am reading an example of DirectX project, I saw *.fx and *.hlsl files.

I know fx is effect file which is read by DirectX, but what's purpose of hlsl file? Are this files useful?

解决方案

Historically fx contains shaders using the Effects system syntax (technique, pass, etc.) while hlsl contains pure HLSL shaders without Effects system syntax.

This is, however, purely a convention and one that is not actually followed particularly consistently. In the end, all that matters is what profile you use to compile the file with. VS 2012+ will treat either fx or hlsl files the same (i.e. as something you build with FXC).

The latest Effects for Direct3D 11 is available on CodePlex and GitHub, but the complier support for the fx_5_0 profile is officially deprecated. It still works, but it has a number of known issues and will likely be removed at some point in the future.

See this discussion thread on the Effects 11 projects site: What's the difference between an .fx and .hlsl file anyhow?

这篇关于* .hlsl文件有什么作用,此文件与* .fx文件之间的关系是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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