Sunteți pe pagina 1din 5

############################################################################ TransGaming Inc. SwiftShader 2.0 Demo March 31, 2008 SwiftShader is Copyright(c)2003-2008 TransGaming Inc.

############################################################################ Thank you for downloading the demonstration release of SwiftShader, TransGaming's high-speed pure-software 3D renderer. This new release of SwiftShader now supports Shader Model 2.0, and many additional features. SwiftShader is a revolutionary software-only 3D renderer that provides DirectX 9 features including both Pixel and Vertex Shaders and can be more than 50 times faster than Microsoft's reference rasterizer. SwiftShader achieves this level of performance through the use of TransGaming's SwiftAsm runtime code generation system. SwiftAsm allows developers to easily and efficiently generate highly optimized code entirely at runtime. SwiftShader uses SwiftAsm to translate both shader-based and fixed function geometry and pixel pipeline operations into high-speed x86 SSE and MMX code, which is then cached for later reuse as needed. NOTE: Use of the SwiftShader 2.0 Demo is subject to the enclosed SwiftShader License agreement. System requirements ------------------* * * * * x86 CPU, SSE support recommended Basic 2D video card - no 3D card necessary! Microsoft Windows 98SE, Windows 2000, Windows XP, or Windows Vista 128 MB RAM 25 MB free hard disk space

Installation -----------SwiftShader 3D renderer is packaged into two DLL files: D3D8.DLL and D3D9.DLL These DLL files can be dropped into a directory containing an application that uses Direct3D, and SwiftShader will automatically be used in place of the built-in OS version of Direct3D. Note that some applications may load the D3D DLL directly from the Windows System32 directory. Such programs will not work directly with SwiftShader without modification. In addition to the DLL file, an optional configuration file can be used with SwiftShader. This file, SwiftShader.ini, can be put in the same directory as the application, and can be used to fine tune performance and quality settings. The commercial version of SwiftShader includes an API for changing many of these settings programatically at runtime.

SwiftConfig

----------By default, when SwiftShader is running, a simple configuration web server will be started locally on port 8080 of the system. This server can be accessed via: http://localhost:8080/swiftconfig Changes made via the webserver will be written to the SwiftShader.ini file in the Application's working directory.

Multi-core Support -----------------SwiftShader can use multiple CPU cores to speed up software rendering. Using SwiftConfig or the SwiftShader.ini file, you can determine how many threads will be used simultaneously. By default, SwiftShader will use as many cores as possible. Note that SwiftShader is currently optimized for single-processor multi-core configurations due to inter-core bandwidth limitations.

Sample Software --------------This SwiftShader Demonstration release includes five pre-built sample programs, CubeMap, Spheremap, DolphinVS, StencilMirror, and EffectEdit. These samples are part of the standard Microsoft DirectX 8 and DirectX 9 SDKs. Other DirectX example code can be downloaded separately from various web sites. To investigate the Shader Model 2.0 features of SwiftShader, we recommend downloading ATI's RenderMonkey Shader IDE and copy in the SwiftShader d3d9.dll file. The SwiftShader logo overlay cannot be removed in the Demonstration release. It is of course disabled in the commercial version.

RenderMonkey -----------ATI's RenderMonkey Shader IDE is an ideal way to experiment with the Shader Model 2.0 support available in this version of SwiftShader. Many of the shader examples in RenderMonkey require 2.0 level shaders, and thus require the use of SwiftShader on systems that are running older graphics hardware that doesn't support Shader Model 2.0 features.

DolphinVS --------The DolphinVS sample is a basic test of Direct3D vertex shaders. To try it, simply run the DolphinVS.exe file included in the directory. All required media files are included in the directory already, and

SwiftShader is pre-installed. This version of DolphinVS is built against the Direct3D 8 API, so it requires the D3D8.dll version of SwiftShader. The DolphinVS sample includes four vertex shader files with the .vsh extension. These files can be viewed and modified if desired, and are unmodified from the DirectX 8 SDK. To compare SwiftShader performance vs the Microsoft Reference Rasterizer, choose 'Change Device' from the file menu, and switch the Device from HAL to REF. SwiftShader's performance will be many times faster, regardless of the size of the window used. The smaller the window, the more time is be spent on geometry calculations instead of rasterization, so changing the window size can allow for a rough measure of rasterization vs geometry performance.

Environment Mapping ------------------The two samples involving environment mapping, the Direct3D 9 CubeMap and SphereMap samples, show the versatility of SwiftShader including its support for rendering to cubemaps. In the CubeMap sample, an airplane model is rendered to a cubic environment map, which is then used to render the reflection from a mirrored teapot. In the SphereMap sample, the same mirrored teapot is rendered, but with a static environment. The SphereMap sample uses a Vertex Shader to calculate the texture coordinates and other geometry required to render the teapot.

Stencil Buffering ----------------The SwiftShader demo includes one example showing SwiftShader's stenciling capabilities. The StencilMirror sample shows a helicopter model that is reflected in a lake, using stenciling capabilities to ensure that the helicopter model reflection is only visible over water, and not over land.

EffectEdit ---------The EffectEdit sample is a generic editor for Direct3D 'effects' files. These files consist of high level shader based descriptions of how to display a given effect. A number of sample effects are included in the EffectEdit directory, as well as a number of .x geometry description files which can be used within the effect file to specify a sample object to apply the effect to. The available .fx files can be opened directly within EffectEdit through the File..Open menu command. The EffectEdit sample allows you to explore the performance of any supported vertex or pixel shader operation within SwiftShader.

Managed DirectX

---------------The SwiftShader demo includes an example of using SwiftShader in conjunction with Microsoft's Managed DirectX. Integrating SwiftShader with Managed DirectX requires some low level code to substitute the SwiftShader d3d9 DLL for the standard one used by Managed DirectX. Sorce code is included to demonstrate this integration. Code in the sample where these changes are required is marked with by a 'TRANSGAMING' comment. The first required change sets up the loading of the SwiftShader DLL and how the IDirect3D9* object is created: // TRANSGAMING: Begin SwiftShader using Microsoft.DirectX.PrivateImplementationDetails; using System.Reflection; using System.Runtime.InteropServices; public class SwiftShader { // IDirect3D9 *Direct3DCreate9( UINT SDKVersion ); [System.Security.SuppressUnmanagedCodeSecurity] [DllImport("swiftshader_d3d9.dll")] public static extern IDirect3D9 *Direct3DCreate9(uint SDKVersion ); } // TRANSGAMING: End SwiftShader The second required change to the sample substitutes the SwiftShader device for the one that Managed DirectX would normally use: // TRANSGAMING: Begin SwiftShader Type type = typeof(Microsoft.DirectX.Direct3D.Manager); FieldInfo info = type.GetField("m_lpUM", BindingFlags.NonPublic | Bindin gFlags.Static); unsafe { IDirect3D9 *d3d9 = SwiftShader.Direct3DCreate9(31); object pD3d9obj = Pointer.Box(d3d9, typeof(Microsoft.DirectX.Pri vateImplementationDetails.IDirect3D9*)); info.SetValue(null, pD3d9obj); } // TRANSGAMING: End SwiftShader

My application doesn t work with SwiftShader installed. Why not? ----------------------------------------------------------------There are a number of possible reasons for this. If your application explicitly loads the D3D DLL from the system32 directory, it will not load SwiftShader in place of the standard D3D DLL until you explicitly change the call used to load the D3D DLL. It is also possible that your application uses an API feature such as shader model 3.0 that SwiftShader does not support at this time. TransGaming works with developers to ensure that SwiftShader is able to run as wide a variety of applications as possible. If your application

isn t working, please send additional information about it to: swiftshader@transgaming.com. CONTACTS -------For more information regarding SwiftShader, SwiftAsm, or other TransGaming products, please contact us as follows: Sales and Licensing Inquiries: sales@transgaming.com Technical Questions and Information: swiftshader@transgaming.com

S-ar putea să vă placă și