Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Carradine

Using Effect Edit in Visual C++ NET as a FX file debugger.

This topic is 5542 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

We did this in our HLSL workshop at the Game Developer''s Conference. I finally installed Visual Studio .NET, and i have Effect Edit, but I do not know how to make Effect Edit debug my FX files at runtime. I am supposed to have some debug options for it in VC++ NET but I do not see them. Does anyone else have this implented and can explain how it was done? Carradine

Share this post


Link to post
Share on other sites
Advertisement
Effect Edit isn''t used to debug your shaders

You need to install the DX extensions for Visual Studio .NET during the SDK install. It''s not selected for install by default, so you may have missed it.

Don''t forget to compile your shaders w/ debug info, and w/o optimizations. Then, inside VS .NET choose "Start D3D" off the menu.



Development Lead
Windows Graphics & Gaming Technology

Share this post


Link to post
Share on other sites
Well I found the .NET file extensions (they were seperate from the actual SDK download), and I have the startD3D option in my debug menu option now.

However, I do not know how to make EffectEdit load in the FX file that is being used within Visual C++.NET I does warn me to turn shader debugging on, and and I make sure everything else is in debug mode, but all it does when I execute the startD3D option it starts EffectEdit with its own default FX file, and does not use anything within the C++. NET program at all. Is there certain project type, or file format that needs to be used in order for the C++.Net program to compile and use the current FX file correctly within EffectEdit?


Share this post


Link to post
Share on other sites

To effectively debug Vertex/Pixel shaders using EffectEdit, you need to tell EffectEdit to work from a file. This option is called ''Use External Editor'' in the menus. When this option is enabled, EffectEdit compiles the effect file whenever it changes from file. The advantage to this is that the debugger needs to have file/line info for the effect file. In EffectEdit''s normal mode of operation it compiles from memory, which means that you can only debug the asm version of the shaders.

The HLSL workshop used to command line options of EffectEdit to "integrate" into the VS.net environment. The project files had the command line arguments "/EE HLSLWorkshop.fx" hardcoded. This launches EffectEdit in External Editor mode on the specified file. Probably the most useful way of setting up a stand alone shader debugging environment in my opinion.

Craig Peeper
Microsoft, Direct3D

This posting is provided "AS IS" with no warranties, and confers no rights.

Share this post


Link to post
Share on other sites
How exactly is the EffectEdit command line "hardcoded" in?

I can execute EffectEdit with the /EE command line from a command prompt window. However, when I put the /EE option in the commasnd line for my actual project not VC++ NET is says it does not recognize the command. How do I tell VC++ NET to use a command line of /EE "filename" when I select the "StartD3D" option from the debug menu, instead of it just running a the default version of EffectEdit?


[edited by - Carradine on April 21, 2003 6:31:26 PM]

Share this post


Link to post
Share on other sites
It sounds like you added the /EE to the wrong field of the properties dialog box. It needs to go in the "Command Arguments" field.


Craig Peeper
Microsoft, Direct3D

This posting is provided "AS IS" with no warranties, and confers no rights.

Share this post


Link to post
Share on other sites
Okay The program will compile again, but it ignores the command argument put into the project settings. I try ''EffectEdit /EE filename'' and it will not load Effect Edit. Also, I am trying to figure out if this program will work with any C++ project with effects shaders within it, or must I specifically compile the EffectEdit project and insert my fx file there?

Also, is the project used for the HLSL workshop available for download? That may help me see how I need to configure VC++ NET to make this work.



Share this post


Link to post
Share on other sites
You can debug any program that uses shaders with the Shader Debugger Extensions, assuming the application has not disabled shader debugging on purpose.
You need to compile your shaders from file and have the debug flag set when calling the compiler. Compiling without optimizations is also recommended.

EffectEdit is just an app that uses shaders that is convenient to debug, since everyone has that who has the SDK. Debugging should be just as convenient of more so from your own application.


Craig Peeper
Microsoft, Direct3D

This posting is provided "AS IS" with no warranties, and confers no rights.

Share this post


Link to post
Share on other sites
I have actually gotten to the point of actually being able to put breakpoints into the shader code, and and able to see the current values of the current shader rendering loop. However, the program will still not execute EffectEdit.

This is code used to compile the FX file:

hr = D3DXCreateEffectFromFile( g_pd3dDevice,
"dx9_hlsl_fx_simple.fx",
NULL,
NULL,
D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION,
NULL,
&g_pEffect,
&pBufferErrors );

And this works. This program created its own D3D window and shows a textured ractangle that is pixel/vertex shaded.

I will just have to continue to figure out why the ''Command Argument'' parameter of VC++ NET project file will not execute any programs for me.

Thanks for all of your help Craig.




Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!