Although Blade3D comes with a number of pre-canned shaders at some point you will want to modify or create your own effects. For this, the Blade3D development environment provides a HLSL editor for editing your shader code. The editor provides full syntax coloring and error highlighting as standard.
To use the editor:
Click on the HLSL Editor tab at the bottom of the application
Or select an effect in the Object Browser under MyModule->Effects
You will see the editor window pop up at the bottom of the application. By default this window is docked, but you can undock it by toggling the auto-hide button on the top right hand side of the window and then double clicking the title bar. You can then resize and position the editor however you like. To dock the window simply double click on the title bar again.
To view or edit an effect click on the list of HLSL effects on the left hand side of the editor window. As you work with different effects, the color of the items in the list becomes brighter according to its popularity.
Right click on the editor window to see all the options available and the sortcut keys for these options.
The editor includes a disassembler window that shows you how your HLSL is being compiled.
To see the disassembler click on the expander bar to pop up the window.
The disassembler window shows the instructions generated for the effect during compilation. Blade3D automatically compiles the effect so there is no extra steps necessary to compile your code. If there are errors in the code, the disassembler window shows the error with the line number that the error occurred on.
Press Ctrl+G to bring up the Goto Dialog and enter the line number, press ok and the editor will position the cursor on the specified line.
Additionally, the HLSL editor supports error highlighting. When there is an error in the code, you will see a red squiggly underneath the line that caused the error. Hover over the red line to see the tooltip showing the error message.
The Blade3D® runtime also features support for DXSAS (DirectX Standard Annotations and Semantics) which allows many shader constants to be driven directly by the runtime without any specialized application level code. In Blade3D, HLSL based shaders are extended into the object model. As they are edited, the material system (and therefore the scene) automatically gets updated with changes in real-time. As an example, if you add a new constant to a shader it will appear as a property on the corresponding material in the object model and becomes editable in the property grid.
Note that the UIWidget annotation can be set to "slider" to enable changing the value through the Slider control in the property grid. Changing the semantic of a shader constant is also propagated through the system. For example, specifying that a float4 shader constant represents the diffuse material color will allow you to change the value using the gallery based property editors.
For a list of supported HLSL semantics see the Materials And Effects->Effects->
Supported HLSL Semantics section.