?/TD> |
Microsoft DirectX 9.0 |
The EffectEdit sample implements a tool that allows easy experimentation with Effects. Effects provide a convenient way to package multiple techniques for rendering an object, including render states, vertex shaders, pixel shaders, and multiple passes. Using EffectEdit, you can load effect files, edit them, and see an object rendered with the effect. Changes to the effect are reflected immediately on the rendered object.
Note that not all effect files will work well with EffectEdit. Effects that need a lot of parameters to be set by the application will probably not work well. EffectEdit sets only a limited number of parameters as follows:
Source: (SDK root)\Samples\C++\Direct3D\EffectEdit
Executable: (SDK root)\Samples\C++\Direct3D\Bin
The user interface is a window divided into four panes. You can press CTRL+TAB to change the keyboard focus between these panes.
The Effect file source code pane shows the source code for the current effect and provides text editing capability.
The Effect compilation results pane shows the results of compiling the current effect. You can double-click on errors to jump to the offending line in the source code pane. If there are no errors, the results pane will say "Compilation successful!" and you should see the rendered object.
The Rendered scene pane shows the rendered object, using the current effect. You can drag the left mouse button to rotate the object, the right mouse button to move the object, and click the scroll wheel to zoom the object.
The Rendering options pane lets you change various aspects of how the object is rendered. The Reset Camera button moves the camera back to the default position and orientation.
EffectEdit is an Microsoft Foundation Classes (MFC) application, using the single-document model. CEffectDoc is the class representing the document, which is mainly just the text contents of the effect. CMainFrame manages the display of the four different views used on this document, and the splitter windows that control the panes containing the views. CTextView is the text editor, CErrorsView is the compilation results, COptionsView is the rendering options, and CRenderView is the rendered output. Only the last class really uses Microsoft?Direct3D?and Direct3D code. CRenderView is derived from both CFormView and CD3DApplication, so it can use familiar methods like FrameMove, InitDeviceObjects, etc.
This sample uses the sample framework code that is shared with other samples in the Microsoft DirectX® software development kit (SDK). All common headers and source code can be found at (SDK root)\DXSDK\Samples\C++\Common.