i have a bunch of "old-fashioned" ps files that i don't have the time to convert to HLSL.
i have the managed directx book and searched the forums but i cannot find the answer to this simple question:
how can i use those old ps files with C# and managed directx
i have the latest february sdk and vs 2005 installed but there's nothing in the documentation that is helpful. in fact, the documentation for managed directx is sketchy AT BEST.
could someone please post a few lines that outline the steps for getting from a ps file on hard disk to a PixelShader class
thanks.

using pixel shaders with C#
chopper
i saw a similar code snippet already a while ago but i couldn't get it to work in my environment.
the ShaderLoader class is supposed to be part of the Microsoft.DirectX.Direct3D namespace but intellisense can't find it and the compiler produces errors.
ShaderFlags is there but no ShaderLoader.
i have included a reference to the 2.0 version of DirectX in my project.
any suggestions
YodaC
Please take discussions about the MDX 2.0 libraries to the beta newsgroups (http://msdn.com/directx/beta). It dramatically raises your chances of 1) getting the question answered and 2) helping us spot bugs/issues.
hassanmushtaq
You need only two lines of code for this:
GraphicsStream
shaderTokenStream = ShaderLoader.FromFile(path, null, ShaderFlags.None);PixelShader
shader = new PixelShader (device, shaderTokenStream);Robert Johnson
You are using the Managed DirectX 2.0 (aka MDX2) beta. My code example was for MDX1. In the case you need this code in a productive system you should use MDX1 because at the moment there is no RTM for MDX2 and you should not use unstable betas in a productive system. If you are planning to do more work with the beta you should register over there:
http://connect.microsoft.com/
Anyway the new code for MDX2 looks like this:
GraphicsStream shaderTokenStream =
Shader.AssembleFile (path, null, null, ShaderFlags.None);PixelShader shader = new PixelShader (device, shaderTokenStream);
I have not tested this because my MDX2 beta is on my other development system. But it should work.