Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Direct3D 11 effect files deprecated?

Tags:

direct3d

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.

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.

like image 881
Toji Avatar asked Feb 28 '10 20:02

Toji


People also ask

Is d3d11 deprecated?

Save a texture to a file. The D3DX (D3DX 9, D3DX 10, and D3DX 11) utility library is deprecated for Windows 8 and is not supported for Windows Store apps.

Is DirectX 11 the same as Direct3D 11?

Well, this is as quick as can be without being too brief. First, a bit of clarification: Direct3D is a subset of DirectX. DirectX contains Direct3D which is the primary graphics handling portion of DirectX. OpenGL, on the other hand, is it's own API.

Is Direct3D an API?

Direct3D is a low-level API for drawing primitives with the rendering pipeline, or for performing parallel operations with the compute shader.

What is device in Direct3D?

A device is used to create resources and to enumerate the capabilities of a display adapter. In Direct3D 11, a device is represented with an ID3D11Device interface. Each application must have at least one device, most applications only create one device.


2 Answers

Many professional game and graphics developers don't use the effects interfaces in Direct3D, and many of the leading game engines do not use them either. Instead, custom material/effects subsystems are built on top of the lower-level shader and graphics state state management facilities. This allows developers to do things like target both Direct3D and OpenGL through a common asset management pipeline.

like image 152
Jesse Avatar answered Oct 10 '22 02:10

Jesse


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.

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).

like image 31
Magnus Österlind Avatar answered Oct 10 '22 01:10

Magnus Österlind