Compile pixel shader to .fx format

Started by
3 comments, last by Nik02 15 years, 10 months ago
How to compile my pixel shader (*.psh file) into .fx format.
Advertisement
.fx files usually contain uncompiled shaders that the effect framework will compile for you. You can, however, use assembly language shaders in effect files; instead of specifying the shader with the "compile target entrypoint([arguments])" syntax, you can set the shader to be an asm block:

VertexShader = asm {...your assembly shader here...};


Note that D3D10 and later do not allow specifying shaders in assembly language anymore.

Niko Suni

I'm sorry I don't fully understand the question. Fx extension is mostly used as a effect shader source file. Ie. You put your effects source code in there. Compiling shaders can be done using the standalone compiler that comes with the DXSDK.

GBS
GBS
*.psh and *.vsh contains simply a pixel and vertex shader code that you will compile separately.
You will gain a ID3D10PixelShader and ID3D10VertexShader which, set in the device, will draw your geometries.

The *.fx file contains, instead, 1 or more pixel, vertex and geometry shader, grouped in a technique and passes.
Quote:Original post by XVincentX


The *.fx file contains, instead, 1 or more pixel, vertex and geometry shader, grouped in a technique and passes.


Correction: 0 or more [smile]

Also, the .fx, .psh and .vsh are just convenient (and common) extensions for effect and shader files - the compiler doesn't actually distinguish the files based on the extensions nor does it actually care what the extensions are, as long as the files get found and their contents are comprehensible.

Niko Suni

This topic is closed to new replies.

Advertisement