Renderware

From ActiveWiki
(Redirected from RWX)
Jump to: navigation, search

Note, this article discusses the 3D file format, not the 3D Render Engine. Nevertheless, parts of Renderware Engine core are currently still used by the Active Worlds Browser. The engine as well as the file format were developed by Criterion Software and has been owned by EA Games since 2004. EA Games closed the product line in 2007 for 3rd party developers, continuing using the render engine for some of their own game titles.

The browser uses the legacy ASCII version of Renderware scripts also besides other 3D file formats. ASCII means the file are in a human readable form. Such files require the use of the ".rwx" file extension (Rendware Exchange format). This allows for creation and editing of RWX objects using a text editor such as Notepad.

ActiveWorlds has extended the file format's definition with its own extensions. The format is suitable for simple models and for jointed avatar (depreciated) structures/hierarchies only. Alternatives: For skinned avatars Blender and the DX format (.x file extension) is recommended. TrueSpace .cob file formats are also still supported.

File structure

As an ASCII script file format, models are made up with various case-insensitive commands and options in a hierarchy, not unlike HTML or XML. No special characters are used to define sections, however for human readability clumps are typically indented with spaces or tabs. The following is an example of a simple RWX object that uses four verticies with UV definitions to make a centered wall:

Note that ModelBegin and ModelEnd may be used at the top and bottom of the file, but are optional
 ClumpBegin
   Surface 1 1 0
   Texture tile1
   TextureModes Lit
   Vertex -.2 0 0 UV 0 1
   Vertex -.2 .4 0 UV 0 0
   Vertex .2 0 0 UV 1 1
   Vertex .2 .4 0 UV 1 0
   Quad 2 1 3 4
 ClumpEnd
Line-by-line analysis
Script Function
ClumpBegin Begins definition of an object
Surface 1 1 0 Shortcut for defining ambient, diffuse and specular respectively
Texture tile1 Name of texture file used for textured surfaces. In this case, this makes use of the standard AlphaWorld tile1.jpg texture.
TextureModes Lit Lighting mode of surfaces, of which only "Lit" is supported
Vertex -.2 0 0 UV 0 1 First defined point in space with UV values
Vertex -.2 .4 0 UV 0 0 Second defined point
Vertex .2 0 0 UV 1 1 Third defined point
Vertex .2 .4 0 UV 1 0 Fourth defined point
Quad 2 1 3 4 Defines a quad surface to render, referencing the four above verticies by the order of definition
ClumpEnd End of object definition

Commands

Standard commands

This is a list of the standard RWX script commands that the browser uses to render Renderware models. Some may have unsupported or unused options, such as point-cloud rendering for GeometrySampling.

Command Function
# Allows a comment to be placed within the Renderware file
AddMaterialMode Adds the specified material mode to the current material modes
AddTextureMode Adds the specified texture mode the the current texture modes
Ambient Defines the amount that the polygons will be affected by ambient lighting
AxisAlignment Defines if the object is to be a 'facer'
Block Creates a block (Cube for example)
ClumpBegin Declares the beginning of a clump
ClumpEnd Defines the end of a clump
Collision Determines if the object should be solid or not
Color Defines the color of an objects polygons
Cone Creates a cone
Cylinder Creates a cylinder
Diffuse Defines how the objects polygons will be affected by diffuse lighting
Disc Creates a flat disc
GeometrySampling Defines the geometry sampling mode of the current material
Hemisphere Creates a hemisphere
Identity Sets the current transformation matrix to the identity matrix
LightSampling Defines how lighting should affect an object overall
MaterialBegin Sets the beginning of a new material
MaterialMode Defines the material mode of the current material
MaterialEnd Sets the end of a material, to revert to a previous definition
ModelBegin Defines the beginning of a model
ModelEnd Defines the end of a model
Opacity Sets the opacity (transparency) of the current material
Polygon Creates a N sided polygon
ProtoBegin Defines the start of a new prototype
ProtoEnd Defines the end of a prototype
ProtoInstance Calls upon a defined prototype
ProtoInstanceGeometry Calls upon a defined prototype, ignoring it's materials
Quad Creates a 4 sided polygon
RemoveMaterialMode Removes the specified mode from the current material modes
RemoveTextureMode Removes the specified mode from the current texture modes
Rotate Used with a transformation matrix, rotating it to a given angle
Scale Used with a transformation matrix, scaling it accordingly
Specular Defines how polygons will be affected by specular lighting, currently not used
Sphere Creates a sphere
Surface Defines ambient, diffuse and specular lighting properties in one command
Tag Specifies a tag number to be called for special uses
Texture Defines the texture and mask used in the current material
TextureAddressMode Specifies the texture addressing mode to be used for all following textures
TextureMipmapState Specifies the mipmap state of all following textures
TextureMode Defines the texture mode to be used in the current material
Transform Replaces the current transformation matrix with the specified elements
TransformBegin Defines the beginning of a new transformation matrix
TransformEnd Defines the end of the current transformation matrix
Translate Moves the current transformation matrix
Triangle Creates a triangle based on 3 indexed vertices
Vertex Defines the position of a vertex within the object

Extension commands

Extra RWX commands are supported by the browser for tweaks. Historically, these were added from version 3.0. To keep scripts compatiable with other software and older versions, these commands make use of a crunchbang "#!" prefix which are otherwise interpeted as comments by non-supported software.

Command Function
#! OpacityFix on Start separating the following polygons, to fix transparency issues with neighbor polygons
#! OpacityFix off Stop separating polygons
#! Prelight In conjunction with the Vertex command, defines subtle lighting effects on objects
#! Seamless on Use seamless vertex normals, considering neighbor vertices
#! Seamless off Stop seamless vertex normals
#! RandomUVs Generate random texture coordinates
#! TextureAddressMode Modifies how repeating textures are rendered

Unsupported commands

The following commands are not supported by the browser. If any of these commands are used in the creation of your object they will be ignored by the rendering engine of the software, additionally some may cause an error message to be displayed.

  • AddHint
  • Hints
  • Include
  • IncludeGeometry
  • RemoveHint
  • TextureDithering
  • TextureGammaCorrection
  • Trace
  • TransformJoint

nl:RWX