   CGFX with XNA ?
  This has probably been answered before but I can't find much about it... Is it at all possible to use compiled CGFX under XNA?  Either natively or using some library.  Also, I'm under the impression that CGFX is DirectX compatible... so, failing an XNA solution, is it possible to use CGFX under DX9 / DX10.  Any examples, resources or msdn keywords I should look into ?It seems theres a lot of information about OpenGL but precious little about DirectX/XNA-Gary   
  I dont think so,that would be possible.because in xna, there are you dont find LPDIRECT3DDEVICE9 handleto initialize CGFX context.Quote:cgD3D9SetDevice( d3dDevice??? );btw. hlsl have same features.;  Yes you can use CgFX in DirectX. I dont know about XNA.I'm pretty sure that there are some examples in CgFX examples folder   ;  Definitely not going to work with XNA. While I'm sure that framework generates binary shaders that can be loaded as native vertex/pixel shaders in XNA, they're not going to be very useful without the runtime component. And you're not going to be able to use the runtime component, since XNA doesn't expose the underlying D3D9 device it uses.   ;  Hmmmm, I feared as much.Thanks anyway guys, I think I might try loading it in a skinny DX9 app applied to a quad - and then use 'DirectX Ripper' to hopefully dump the asm to a readable file and rewrite as a .fxThe things we have to do to learn : )-GaryCh   ;  FYI, you can use PIX to get the shader assembly.   ;  Well, not that it's ideal but you could expose the underlying device XNA uses via reflection.I'm not saying it's necessarily a wise solution but it's not impossible to get the device. That's what we have to do to get XNA running in a WPF app through D3DImage.   ;Quote:Original post by FlimflamWell, not that it's ideal but you could expose the underlying device XNA uses via reflection.I'm not saying it's necessarily a wise solution but it's not impossible to get the device.Sure, but since XNA assumes it "owns" the device it can do all sorts of weird things behind your back (like caching state and assuming it hasn't changed).;  PIX will give me asm from a compiled CgFX ?Wow!  Just installed it and it is incredible!  Can't wait to get home and try it on my compiled shaders.  Okay, this is one of those moments where you wonder why nobody told you about this before.  LOL.  I knew 'Direct3D Ripper' could give good information about how others approach shading problems but I had yet to see a standalone disassembler or debugger.It's almost like having SoftIce for shaders : )))))Heh, I got a new toy 8DYou may laugh but I was going through the linux wine docs :(http://source.winehq.org/source/include/d3d9types.h)...using the D3DSIO_* definitions and the shader instruction-format docs on MSDN to try to piece together the shader source by hand from the binary shader.You've just saved me weeks of painful work !-GaryCh   ;  Uh oh MJP, I just tried with a simple CgFX I compiled just now.  It seems FX Composer won't let me open a compiled CgFX file, it opens the binary as if it were ASCII and shows garbage.The problem is that the CgFX I have at home is compiled with no source available.Or am I just importing it incorrectly (Using Create->Effect->Create_from_file->CgFX->Browse) ... is there perhaps an additional plugin I need, besides PIX?-GaryCh   