Vertex Shader ToolsAs you will see in a few seconds, you are required to master a specific RISC-oriented assembly language to program vertex shaders, because the vertex shader allows you to program the geometry processor yourself. So it is important to get the right tools to begin as fast as possible to develop shaders in a productive way. I would like to present you with the available tools that I'm aware of. If you know other interesting tools, give me a sign via e-mail and I will add it to upcoming versions of this text. nVidia Effects Browser 2.0nVidia provides their own DirectX 8 SDK, that encapsulates all their tools, demos and presentations on DirectX 8.0. All the demos use a consistent framework called Effects Browser. The effects in the Effects Browser can not be displayed by a wide variety of graphics hardware, as you might expect. For example my ATI RADEON doesn't support a lot of these, whereas the RADEON 8500 supports all the effects despite the ones that use RT patches. The Effects Browser is a wonderful tool to test and develop vertex and pixel shaders. You can select the effect you would like to see in the left column. The middle column gives you the possibility to see the source of the vertex and/or pixel shader. The right column shows you the effect. Independent of your current graphic card preferences, I recommend downloading the nVidia DirectX 8 SDK and trying it out. It provides and explains in detail a lot of examples which show you a variety of effects possible with vertex and pixel shaders. nVidia Shader DebuggerOnce you've used it, you won't want to live without it. The nVidia shader debugger provides you with information on the current state of the temporary registers, the input streams, the output streams, and the constant memory in the debugging windows. This data changes interactively while stepping through the shaders. It is also possible to set specific breakpoint events as well as instruction breakpoints. A user manual that explains all the possible features is provided. Philip Taylor explains the features in his first article on vertex shaders at MSDN too. You need at least Windows 2000 with Service Pack 1 to run the Shader Debugger, because debug services in DX8 are only supplied in Windows 2000 and higher. It is important that your application uses software vertex processing (or you have to switch to the reference rasterizer) in the runtime for the debugging process. Note: The shader debugger can be used for re-engineering. If you start an application with a vertex shader with the Reference Rasterizer, you might be able to see the vertex and pixel shader source in the Shader Debugger. Shader CityYou can find another vertex and pixel shader tool with source code at http://www.palevich.com/3d/ShaderCity/. It is built by Jack Palevich (who by the way modified the Quake 1 source to use Direct3D 8). You are able to see any modification of the vertex and/or pixel shaders in the small client window in the left upper edge: You can modify the vertex and pixel shaders, save them, and load them to see the results of your changes. In addition, you are able to load index and vertex buffers from a file. The source of this tool might help you to encapsulate Direct3D in an ActiveX control ... so try it. Vertex Shader AssemblerTo compile a vertex shader ASCII file - for example basic.vsh - into a binary file - for example basic.vso - you have to use a vertex shader assembler. As far as I know, there are two vertex shader assemblers: the Microsoft vertex shader assembler and the nVidia vertex and pixel shader macro assembler. The later provides all of the features of the Vertex Shader Assembler plus many other niceties, whereas the Vertex Shader Assembler gives you the possibility to use effect files (possible since the advent of DirectX 8.1).
NVLink 2.1NVLink is a very interesting tool. It allows you to do the following:
This way you are able to generate shaders on demand, that will fit into the end-users hardware limits (registers/instructions/constants). The best thing is about this tool is that it will cache and optimize your shaders on the fly. NVLink works in the NVEffects Browser: You can choose the vertex shader capabilities in the dialog box and the resulting vertex shader will be built in output0.nvv. Note: the NVLink 2.x example shows the implementation of the fixed-function pipeline in a vertex shader. ATILLAComing soon :-) nVidia Photoshop PlugInsThere are two very frequently updated plug-ins for Adobe Photoshop. nVidia's Normal Map Generator plugin and Photoshop compression plugin. You will need the normal map generator for creating normal maps (for example for bump mapping and per-pixel lighting): The plugin requires that you have DirectX 8.0 or later installed. There is a readme.txt provided to explain its features. CTRL + left-mouse-button moves the light in the small preview window, located in the upper left corner, around. It works with layers too. If you select or deselect Wrap, the texture borders are clamped or wrapped to the edge. The value for Scale is the height of the height posts. There are different options for height generation:
To use the compression plugin, you have to choose <Save As> in Adobe Photoshop and then the <DDS> file format. This dialog will appear: This texture compression plugin allows you to open and save *.dds files. It also provides a 3D preview and a lot of other possibilities. Perhaps you will be surprised by the compression ratio that is possible with the DXT* file formats. Take a look at the preview by clicking on the <3D Preview> button. Both tools support Adobe Photoshop 5.0 and higher. As far as I know these plugins are also supported in JASC Paintshop Pro. 3D Studio MAX 4.xThe new 3D Studio MAX 4.x gives a graphic artist the possibility to produce vertex shader and pixel shader code while producing the models and animations. You can see in a WYSIWYG view how your work will appear by displaying multitextures, true transparency, opacity mapping, and the results of custom pixel and vertex shaders. I can't comment on this tool, because I don't own it. As far as I know there will be a reduced but free version of this tool for game development activities. Read more at discreet. Most of these tools are free to use and provided by Microsoft or different graphic hardware producers. If you have any experience with one of these tools and want to write a few paragraphs on your experience, I would be happy to expand my short descriptions. Just drop me an e-mail. I am sure that there will be numerous new tools that help you even more in the future. But that shouldn't prevent us from getting deeper into vertex shader programming by looking at a graphical representation of the vertex shader architecture. |