SPONSORED LINKS
Bookshelf Contents Previous Next Glossary Index Search

Sony PlayStation


Converting to PlayStation Files

This section describes how to use the interface of the Sony PlayStation-specific Direct Translator. For information on how to run the translator, see Using the MakeGame Plug-in on page 9 and Using Translators from the Command Line on page 15.

Availability

Download the PlayStation translator and documentation from the Sony web site or the Sony developer CD.

Sony distributes the PlayStation translator as a non-encrypted tar file containing the translator, TIM image module, source code and Makefile.

GetPlayStation Translator

GetPlayStation converts Alias wire models to PlayStation file formats.

Special Features

Limitations

Installing

The translator archive is a non-encrypted, compressed tar file.

To install the PlayStation translator:

  1. Note the path to the tar archive, whether you downloaded it to a directory if it is on the CD-ROM. You will need to tell InstallGame where it is.
  2. Run the InstallGame script to install the PlayStation-specific libraries:
    InstallGame -e -f <path to tar file>
    

    See Installing Platform Specific Libraries on page 6.

Using the PlayStation Translator

Options

When you run the translator from MakeGame, the Sony PlayStation Export window appears. Use this window to set the options described below, then click OK to start converting.

File Format Section

RSD Group

Output the RSD group (PLY, MAT, GRP, and RSD files) for all geometry in the scene.

TMD file

Output the TMD file for all geometry in the scene. Choose the TMD file format from the pop-up menu.

TMD file format

Standard - output a TMD file for the specified frames of animation.

Difference - output a VDF and NDF file for the specified animation frames for MIME animation.

Sequence - output a sequence of TMD files for the specified frames.

TOD file

Output a TOD file for animation (only available if the scene contains animation). Choose the TOD file format from the pop-up menu.

TOD file format

Rot Std - transfer Alias rotation matrices directly (more accurate).

Rot Opt - same as Rot Std, but optimized (do not output data for objects that have "identity" matrices or TRS components).

TRS Std - decompose Alias rotation matrices into TRS values.

TRS Opt - same as above, but optimized (do not output data for objects that have "identity" matrices or TRS components).

HMD file

This option is not implemented in this version. The option is included for use with a custom-written translator.

HMD file format

This option is not implemented in this version. The option is included for use with a custom-written translator.Choose from Binary, PC ASCII text, or UNIX ASCII text.

MetaCycle

ON - output a NET file containing MetaCycle information.

OFF - output the specified range of animation frames.

Material Properties Section

Texture output

Off - do not output textures.

Tiled - tile the texture if the UV coordinates for the texture are outside the 0.0 - 1.0 range. Texture size is maintained.

Not Tiled - do not tile the texture if the UV coordinates are outside the 0.0 - 1.0 range. The UV coordinates are clipped.

Material type

By material - output the texture according to the materials assigned in Alias.

Flat - convert all materials to flat shading.

Gouraud - convert all materials to Gouraud shading.

Vmapper...

Click to open the Video RAM Mapper window. This window lets you load textures into the video RAM of the PlayStation. See Video RAM Mapper on page 38.

Options Section

Scale Factor

The translator will scale the whole model by this factor before conversion.

Light source calculation

Replace lights with a material that simulates the light source.

Triangulate all polygons

Triangulate all polygons in the scene.

Backface polygons

Turn on backfacing in the MAT file.

Verbose mode

Write all messages to STDERR (the shell or the console window) during the conversion.

Output filename

Enter a filename for the TMD and TOD files.

Merge Groups

This option is not implemented in this version. The option is included for use with a custom-written translator.

Animation Section

Start Frame

End Frame

Start and end frames of animation to convert.

Video RAM Mapper

The Video RAM Mapper, also called the VMapper, allows you to place the textures used in the scene into the video RAM of the PlayStation development system. PlayStation video RAM is made up of 32 pages (numbered 0 to 31), represented in the VMapper by two rows of vertical bars.

To load a texture into video RAM

  1. Click a name in the Select current texture list. The Select current texture list shows all the textures in the scene.

    The texture appears in the texture swatch area.

  2. Click a page in the texture page area.

    A rectangle appears. This rectangle represents the size (in memory) of the texture.

  3. Drag the texture rectangle to fit it. Large rectangles can overlap pages.
  4. Use the controls at the bottom of the window to set up the texture (see below).
  5. When you have set up all the textures in video RAM, click OK. To start over, click Clear. To cancel any changes and go back to the main window. click Cancel.

    The light blue rectangles represent the active video area (the part of memory reserved for the visible display). You cannot place textures in this area. The amount of space taken by the active video area reflects the screen size.

Screen Size Section

X Res

horizontal resolution of the PlayStation video screen.

Y Res

vertical resolution of the PlayStation video screen.

Changing these options changes the size of the active video area (the part of memory reserved for the visible display). You cannot place textures in this area.

Map Files Section

Load

Click to load a saved video RAM configuration.

Textures that were saved in a previous session but are not available now will appear as unmovable black rectangles.

If the Reload option (in the MakeGame window) was turned off, the texture swatch may not update. However, the textures will output correctly.

Save

Click to save a video RAM configuration to disk.

Textures section

The Textures section displays the PlayStation video RAM information for the selected texture.

Page#

Page of video RAM in which the texture resides.

Freeze

Lock the position of the texture in video RAM.

Offset X,Y

Horizontal and vertical offset of the texture in the page.

Color Depth

Color depth of the converted texture.

Changing the color depth affects the size of the texture in memory.

Four bit (16 color) textures have a yellow outline. Eight bit (256 color) textures have a green outline. Sixteen bit (65536 color) textures have a blue outline.

CLUT X,Y

horizontal and vertical location of the color look-up table in Video RAM.

Translucent

Turn on the transparency (STP) bit for color (non-black) pixels.

Transparent

Turn on the transparency (STP) bit for black pixels.

Dither

Dither when generating a palette mapped image.

Use Original TIM File

Try to use the original TIM file from the Alias shader as the texture. The original TIM file is copied to the output directory and the VRAM display is updated.

SemiTransparency

This option is not implemented in this version. The option is included for use with a custom-written translator.

GetPlayStation Command Line Options

If you turn the GUI checkbox off in the MakeGame window, enter these options in the Option field to control the conversion:

If you do not use the GUI (and the video RAM mapper tool), the translator will not output texture information.

-v (verbose) Output progress updates during conversion.
-rsd Output RSD group.
-tmd option Output TMD file. For option use: standard = output a TMD file for the specified frames of animation. difference = output a VDF and NDF file for the specified animation frames for MIME animation. sequence = output a sequence of TMD files for the specified frames.
-tod option Output TOD file. For option use: r = transfer Alias rotation matrices directly (more accurate). R = same as above, but do not output data for objects that have "identity" matrices or TRS components. t = decompose Alias rotation matrices into TRS values. T = same as above, but do not output data for objects that have "identity" matrices or TRS components.
-net Output MetaCycle file.
-flat Convert all material to flat shading (cannot be used with -gouraud).
-gouraud Convert all material to gouraud shading (cannot be used with -flat).
-s factor Scale model by factor before converting.
-lightSource Turn Pre-light sourcing ON.
-b Turn backface polygons ON.
-t Triangulate all polygons.
-x scriptname Run shell script scriptname after conversion.

Most of the command line options duplicate controls in the GUI window. See Options on page 36 for a description of the GUI interface.

Environment Variables

DT_EXPORT_DIR

The directory where exported files are created. This is the same as the Export directory field of the MakeGame window.

Parameters: a valid path to a directory

Default: '.' (the current working directory)

DT_PCNAMES

Enables the translator to output files with DOS-compatible filenames of the form DTF#dddd (where dddd is a 4-digit number) whenever filenames exceed the 8- and 3- character DOS name and type limits. There is no easy way to match these numbers to the original filenames.

Parameters: none

Default: OFF

DT_PSX_BEGSCRIPT

A shell script to run before conversion (for example, /usr/aw/alias/ODS/Games/bin/psx_begscript).

Parameters: a valid path to a directory

Default: none

DT_PSX_ENDSCRIPT

A shell script to run after conversion (for example, /usr/aw/alias/ODS/Games/bin/psx_endscript).

Parameters: a valid path to a directory

Default: none

DT_PSX_H1500_LOADER

The pathname of the DTL-H1500 loader program. If this variable is set, the psx_endscript script will use the DTL-H1500 to view the converted model.

Parameters: a valid path to a directory

Default: none

DT_TIM_DIR

The default directory for the Replace Texture button.

Parameters: a valid path to a directory

Default: none

DT_VRM_DIR

The directory for loading and saving vrm files.

Parameters: a valid path to a directory

Default: none

PLAY_DEGEN_FACTOR

Sets the limit of tolerance for determining if a polygon is degenerate. (If set < 0.0, then polygons will never be found to be degenerate, even if they actually are.)

Parameters: a floating point value (units = degrees)

Default: 0.1

PLAY_DIFF_MATRIX

Sets a flag to enable output of difference matrix/TRS components instead of absolute matrices. This output is not fully implemented in the current translator.

Parameters: none

Default: outputs absolute matrix/TRS values

PSX_RSD_SCALE

Adds the texture page offset to the texture UV values (included for backwards compatibility with an older version of the translator).

Parameters: none

Default: OFF

You can type environment variable names in Alias text boxes (such as the MakeGame Options field). The text box will replace the variable with its value.

Output
Filename Contents
<scene>.tmd Geometry.
<scene>.objects List of PlayStation objects (TMD) IDs and the corresponding Alias object/
<scene>.tod Animation information.
<scene>.net MetaCycle information.
<texture name>.tim PlayStation texture map files.

The demo Viewer batch file requires that the output files be named test (test.tmd, test.tod, test.net, and *.tim).

Testing the Output

Types of Demo Viewer

Alias|Wavefront supplies demo viewers for three different types of PlayStation developer configuration:

The viewers are based on the provided PlayStation demo viewer source code.

Setting Up the Demo Viewer

On a PC with the DTL-2000 PlayStation Card

To test your PlayStation output, you must download the output to a PC on the network running the development environment and the Alias|Wavefront Demo Viewer. This process can be automated with the supplied shell scripts, but first you must install the Demo Viewer on the development PC.

To install the demo viewer on a development PC:

  1. Create a directory structure on your PC:
    cd <hard drive letter>:\
    
    mkdir awgames
    
    cd awgames
    
    mkdir bin
    
    mkdir psx
    
  2. Copy the viewer source files from the Alias installation to the PC:
    cd psx
    
    xcopy \\<sgimachinename>\usr\aw\alias\ODS\Games\source\PlayStation\tools\PC\*
    
  3. Edit the rerun.bat file. Make sure the path names point to the correct locations of the PC executables and the PlayStation PC development system.
  4. Copy the PC executable programs to the bin directory:
    copy chk_bios.com ..\bin
    
    copy netv.bat ..\bin
    
    copy rerun.bat ..\bin
    

netv.bat

front-end batch file for netv.cpe (loads the TMD/TIM/TOD/NET files to the expected memory locations and runs netv.cpe).

shownetw.bat

batch file, watches the user-specified directory, and runs netv.bat when new test files are saved. Use this batch file on the PC to automatically view models on the PlayStation when they are converted.

netv.cpe

example executable Demo Viewer.

netv.c

source code for the Demo Viewer.

makefile.mak

PC makefile for the Demo Viewer.

chk_bios.com

utility needed by the Demo Viewer (checks the development machine for the presence of the dex BIOS).

rerun.bat

secondary batch file needed by the Demo Viewer (checks if the dex BIOS is loaded and resets the PlayStation development console if necessary).

On an SGI Workstation with the DTL-H1500 Stand-alone box

To use the H1500 viewer, set the $DT_PSX_H1500_LOADER variable to the pathname of the H1500 viewer executable on your SGI workstation:

setenv DT_PSX_H1500_LOADER /usr/aw/alias/ODS/Games/bin/PSXloader

When the sample psx_endscript script checks that the variable is set, it will run the demo viewer on the development PlayStation.

When you install the PlayStation translator, the H1500 version of the demo viewer is installed in the Dtplugins directory. It is a CPE executable.

The H1500 development environment must be set up, with the utilities (such as psbload and psrun) in your $PATH.

On an SGI Workstation with the DTL-H3050 Serial Cable

To use the DTL-H3050 serial cable, you must load the files onto the development machine with the sbload program, then run the code with the srun program. The PSXloader program checks for the following environment variables:

DT_PSX_3050_LOADER

The path of the SGI executable to use to download a file through the 3050 serial cable (usually sbload).

DT_PSX_3050_RUN

The path of the SGI executable to use to send the run command to the development system through the 3050 serial cable (usually srun).

sbload and srun are available from the PSX development web site.

sbload and srun download only .exe files (not CPE files). The files supplied by Alias are currently in cpe format and

They will download .EXE files only (not CPE format), The Alias supplied files are currently in CPE format and cannot be downloaded directly. You must convert them to .EXE format with tools supplied by Sony.

Downloading to a Development Machine

To download and test from UNIX, use the shell scripts psx_begscript and psx_endscript:

  1. The scripts provided are examples. Use a text editor to modify the scripts to fit your configuration.
  2. Set the environment variables $DT_PSX_BEGSCRIPT and $DT_PSX_ENDSCRIPT to the full pathnames of the modified scripts. For example:
    setenv DT_PSX_BEGSCRIPT /usr/aw/alias/ODS/Games/bin/psx_begscript
    
    setenv DT_PSX_ENDSCRIPT /usr/aw/alias/ODS/Games/bin/psx_endscript
    
  3. The PlayStation translator will run the scripts for each conversion.

Running the Demo Viewer on the PC



Bookshelf Contents Previous Next Glossary Index Search

aliasdocs@aw.sgi.com
Copyright © 1998, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved.