## MESHTOOL/OGFVIEWER for IBM OS/2 README, FAQ [201306xx]

#### 0. WHAT IS IT?

OGFVIEWER/MESHTOOL - crossplatform utilities toolkit for viewing, conversion 3d-models and levels from different gaming engines.

Supported formats for open:

- GSC S.T.A.L.K.E.R. X-Ray ogf v4 (builds 2xxx-3xxx)
- GSC S.T.A.L.K.E.R. X-Ray ogf v3 (builds 1xxx)
- GSC S.T.A.L.K.E.R. X-Ray object v3 (builds 1xxx)
- GSC S.T.A.L.K.E.R. X-Ray object v4 (builds 2xxx-3xxx)
- GSC S.T.A.L.K.E.R. X-Ray level (builds 2xxx-3xxx)
- Orion engine v1 MSH - Stalin Subway, Red Veil, Metro-2
- Autodesk 3DStudio MAX 3DS (watcom builds only)
- DS2 Engine *.ds2md - You Are Empty (models only)
- 4A Games Engine *.model, *.mesh - Metro 2033, Metro Last Light
- DirectDraw surface *.dds - viewed as quad of 2x2 meters.

Exported formats:

- Wavefront Object (*.OBJ)
- Valve Software HalfLife (*.SMD)
- Ascii Scene Export (*.ASE)
- Autodesk 3dsMax (*.3DS)
- LightWave 3D (*.LWO) - in development
- StereoLitho (*.STL)
- Collada XML (*.DAE)
- MilkShape3D (*.MS3D)
- X-Ray SDK OGF (*.OGF)

Conversion:

- meshconv(console): ogf, object, msh, 3ds, ds2md, model, mesh -> obj, ase, smd, 3ds, stl, ms3d, ogf (no animations)

Note that in OGFViewer assumes metric coordinate system. For Orion engine v1 models (which are in centimeters) rescaling is used.

Used engines: IBM OpenGL 1.0, IBM OpenGL 1.1 Gold (beta), WarpMesaGL, 1.4 Scitech SNAP MGL 6.0 (based on Mesa3D OpenGL 1.5 spec).

#### 1. SYSTEM REQUIREMENTS

- OS/2 v3, v4, v4.5x, eComStation client or server editions
  for OS/2 v3* - 80386 or later CPU required
  for OS/2 v4 and later - 80486 or later CPU required
- Multimedia Support for IBM OS/2 (MMOS2 directory)
- IBM OpenGL 1.0 (base, stable) or OpenGL 1.1 Gold (beta)
- 15/16/24 or 32 bit display mode

* to make OGFVIEWER work in OS/2 v3, copy these OpenGL 1.0 DLLs from here: service.boulder.ibm.com) or Warp4 installation to {root}/OS2/DLL directory of your OS/2 v3 PC:

    GLUT.DLL
    LIBAUX.DLL
    LIBTK.DLL
    OPENGL.DLL
    RASTER.DLL

OS/2 v3 is incompatibe with any version of IBM OpenGL 1.1 Gold (beta)

Separately available Windows version - http://www.gameru.net/forum/index.php?showtopic=33123

#### 2. VERSION DIFFERENCES

In base version, object moves over (0:0:0). In alternate version, free camera moves over scene.
All versions built in OpenWatcom 1.9. IBM OS/2, IBM/MS DOS:

- MESHTOOL\OS2\3dsply10.exe - AutoDesk 3DS Viewer, OS/2 GLUT+OpenGL 1.0 *.
- MESHTOOL\OS2\3dsply11.exe - AutoDesk 3DS Viewer, OS/2 GLUT+OpenGL 1.1 *.
- MESHTOOL\OS2\MeshConv.exe - models converter *.
- MESHTOOL\OS2\Parse_Lev.exe - Xray level converter to OGF format.
- MESHTOOL\OS2\GL10 - Versions for IBM OpenGL 1.0, OS/2
- MESHTOOL\OS2\GL11 - Versions for IBM OpenGL 1.1 beta, OS/2
- MESHTOOL\OS2\WMGL - Versions for WarpMesaGL 1.4, OS/2
- MESHTOOL\OS2\SNAP - Versions for SnapGL 1.5, OS/2
  1. OGF_GLUT.exe - Base GLUT version (for models) *.
  2. OGF_GLUTA.exe - Alternate GLUT version (for levels) *.
  3. ogf_tk.exe - Base LIBTK version (for models) *.
  4. ogf_tka.exe - Alternate LIBTK version (for levels) *.
  5. ogf_os2.exe - Base pgl version (for models) *.
  6. ogf_os2a.exe - Alternate pgl version (for levels) *.
  7. ogf_cons.exe - Base LIBAUX version (for models) *.
  8. ogf_consa.exe - Alternate LIBAUX version (for levels) *.
  9. ogf_snap.exe - Base LIBAUX version (for models) *.
  10. ogf_snapa.exe - Alternate LIBAUX version (for levels) *.
- MESHTOOL\DOS32 - Versions for allegro, x86, DOS32 *

* start up from command line, File Commander.

    MESHTOOL\REF\MESH.TXT - Orion engine v1 MSH format datasheet
    MESHTOOL\REF\OGF3.H - xray ogf v.3 datasheet
    MESHTOOL\REF\OGF4.H - xray ogf v.4 datasheet
    MESHTOOL\REF\OBJECT.H - xray object datasheet
    MESHTOOL\SAMPLES - model samples
    MESHTOOL\SKY\ - skybox textures for ALT-version (files sky?.dds place in textures\sky)
    MESHTOOL\FAQ.HTM - FAQ & README (HTML)
    MESHTOOL\READMEOS2.HTM - FAQ & README for OS/2 (HTML)

#### 3. KEYBOARD, MOUSE CONTROLS

All versions

- BACKSPACE, E, F10 = reset scene
- TAB, SPACE = drawing mode wireframe / color / texture
- G - grid, sky, axis, off/on
- < * >, Y = changes background color
- F4, L = light, flares, lamps on/off
- F5, F = changes FOV (field of view)
- F7, 7 = speed step * 4
- F8, 8 = speed step / 4
- F9, M = changes texture filtering mode (mip)
- R = changes flipscreen mode (ogf_snap* only)
- 3, < - > = time - 1 hour
- 4, < + > = time + 1 hour
- 5 = decreases aspect ratio
- 6 = increases aspect ratio
- 9 = reset time to 06:00 <-> 18:00
- 0 = reset time to 12:00
- I = 3D-renderer info on screen (in OS/2 - it writed into gldump.log)
- T = dump stats to object.log
- F11 = fullscreen on/off (Windows platform only)
- Q = quit

Base Console-version (ogf_glut.exe, ogf_os2.exe, ogf_tk.exe, ogfcons.exe, ogf_snap.exe)

- A, D = move over axis X
- HOME, END, W, S = move over axis Z
- PGUP, PGDOWN = move over axis Y
- arrows = rotate over axis X/Y by 1 degree
- Z, X = rotate over axis Z by 1 degree
- < + >, < - >, C, V = zoom in/out
- < * >, Y = changes background color
- F1, 1 = draft picture quality
- F2, 2 = full picture quality
- F12 = centers model
- move with left mouse button = rotate over axis X/Y
- move up/down with right mouse button = zoom in/out
- move up/down with middle mouse button (scroll) = move over axis X/Y
- rotate scroll = zoom in/out

Alternate Console-version (ogf_gluta*.exe, ogf_os2a*.exe, ogf_tka*.exe, ogfconsa*.exe, ogf_snapa*.exe)

- HOME, C = rotates camera up over 5 degrees
- END, V = rotates camera down over 5 degrees
- Z = strafe camera left
- X = strafe camera right
- left arrow, A = rotates camera left over 5 degrees
- right arrow, D = rotates camera right over 5 degrees
- up arrow, W = move camera forward
- down arrow, S = move camera backward
- PGUP, O = move camera up
- PGDOWN, P = move camera down
- N = culling objects in view radius off/on
- F12 = camera placed in a model/scene center
- move with left mouse button = rotate camera left/right, up/down
- move up/down with middle mouse button (scroll) = move camera forward/backward
- move with right mouse button = move camera forward/backward, left/right
- rotate scroll = move camera forward/backward

#### 4. NOTES, BUGS

- Due to OpenGL interface is software-only, a very fast PC is needed to view large objects, f.e. game levels.
- IBM OpenGL libraries
  1. Do not try to start OpenGL 1.1 version of OGFVIEWER in OpenGL 1.0 system environment or vice versa. IBM's OpenGL 1.0 and 1.1 not only different in missing functions but also different ordinal numbers for equal OpenGL functions.
  2. You can install both of IBM OpenGL versions on the same PC:
     1. Install OpenGL 1.0: "Tools and games" - "OpenGL(R) 1.0 3D Graphics Library"
     2. Extract updated OpenGL 1.1 DLLs to somewhere f.e. C:\TEMP
     3. If you wish to run OGFVIEWER in OpenGL 1.0 environment - just run it.
     4. If you wish to run OGFVIEWER in OpenGL 1.1 environment - place updated updated OpenGL 1.1 DLLs in place, where OGFVIEWER exe-file is stored.
  3. In textured mode (i.e. drawmode#2) OpenGL 1.1 rendering is faster than OpenGL 1.0, but it has problems with alphablending, light and normales.
- WarpMesaGL OpenGL libraries
  1. WarpMesaGL (bases on Mesa3D 5.1 OpenGL 1.4, GLUT API v2) version requires these DLLs:

         libGLU.dll
         libGlut.dll
         Mesa_PM.dll
         MesaGL2.DLL

- SciTech SNAP 3.x MGL 6.0 OpenGL libraries
  1. SNAP MGL (bases on Mesa3D 6.2.1 OpenGL 1.5, GLUT API v2) version requires that SNAP driver is installed.
  2. Command line:

         GATest - SciTech SNAP Graphics Driver Compliance Test
                  Release 3.1 (Mar 27 2011)

         Copyright 1993-2006 SciTech Software, Inc. All Rights Reserved.

         Options are:
             -s       - Run in software only mode
             -e       - Emulate missing hardware features in software
             -g       - Use VESA GTF for refresh rate control
             -m  - Use XxY text mode (ie: -m80x60 for 80x60 text mode)
             -x       - Render to front buffer for OpenGL tests
             -X       - Disable hardware page flipping for OpenGL tests
             -d       - Disable dithering for 15/16-bit OpenGL tests
             -i - Open 3d-model file

     For example:

         ogf_snap.exe -d -iD:\GSC\GAMEDATA\MESHES\bunker.ogf

#### 5. WHAT NEW

    *** Changes (2011.04.30) ***

    OpenGL 1.0 versions of ogfviewer has no support for font output (not
    including pgl - ogf_os2?.exe).
    New light scheme - directional
    Mouse controls in os2 (no in pgl - ogf_os2?.exe)
    Scitech Snap Graphics support (fastest software OpenGL engine available!),
    in fullscreen only, random colors generation
    3ds file reading support (watcom-compiled binaries only)
    Proper normals creation

    *** Changes (2011.06.11) ***

    New light model in drawmode#1
    Support for YouAreEmpty(DS2 engine) and Metro2033 (static) models
    Now we can read build1935 levels exported by xray_re converter.exe
    Correct normals creation for *.3ds, *.object
    Proper bounding box calculation for object, ogfv3
    Better support for SNAP: ogf_snap supports VBO, DevIL.DLL can read not only
    DDS format
    OpenWatcom-written version can read 3DS models (LIB3DS.DLL required,
    supplied)
    Speed-up for reading 'terrain', 'water' meshes
    Sections mixed 0x1011, 0x1012 (object)
    Rendering optimization (OpenGL, non-VBO)
    drawmode#2 with light rewritten (testing...)
    For mipmapping proper work coeff. ALPHAREF = 50% for LODs (trees) and
    maxmeshcnt up to  30000 (for object)
    COMPACT_OBJECT option, now vertexes in object-s optimized (i.e. compressed)

    *** Changes (2011.07.17) ***

    New light scheme ( drawmode #1, #2 )
    Support for Orion engine v1 models with 0x00000102 header
    FOV calculated for Y, starts from 67.5 (FovX = 90) to 100 with step 5 then
    reset to 47.5
    Removed not supported tex.filtering combinations and mipmaps
    Skybox now 3000x1500x3000 metres, distance ~= 2500 metres
    0x1008 block - now 10 vmrefs max available (was max=4)

    *** Changes (2012.01.31) ***

    Skybox "authentic" as in game (10 planes)
    Base distance lowered to 400,200,400 + 350 ¬., as in game configs
    New advanced light scheme in drawmode#2, horizont angle light
    Now we can Widescreen aspect ratio - 16:9 etc. (keys '5','6')
    Horizont angle light changes by 7,8,9,0,< + >,< - > keys (drawmode#2)
    Light sources doesn't affect by ambient light
    Type model\selflightl = "base" object
    When loading 3DS nodels check materials and meshes limits
    OS2 GUI mode (PM_PM) except for ogfcons, removed printf(),WinMessageBox()
    OGF_GLUT: WarpMesaGL inverts Y axis

    *** Changes (2012.04.01) ***

    Export into Collada XML (*.DAE).
    Export into AutoDesk DXF, meshes arranged by materials in layers.
    "Reading" DDS-files, as surface of 2x2 meters.
    Export into StereoLitho (*.STL), MilkShape3D (*.MS3D), X-Ray SDK (*.OGF).
    OGFDOS16: My own ANM-format for storing animations - 1 mesh only.
    Reading "multi-mesh" *.DS2MD (You Are Empty).
    In *.SMD, *.ASE materials rearranged incorrectly - fixed.
    In *.SMD fixed "extra-large" 100x scale.
    Export obj rewritten according to X-Ray ActorEditor metodics (all in 1 file).
    BoundingBox drawn mirrored by Y axis (OpenGL).
    OGFDOS16: Normales support, misc. optimizations, 2D-"animations" (OGFPLY16), FastGraph engine.
    ALLE: Models are loded faster now, up-down directional light, statistics (totvert/totind) get from models structure.
    MESHCONV: Logging expanded.

    *** Changes (2012.07.31) ***

    PARSE_SPW: new instument to parse GSC S.T.A.L.K.E.R. spawn files
    ALL: 22 sky color variants skycolors.png  - DaySkyColorReference (frostbo.deviantart.com)
    ALL(GL): all versions now has two light modes - directional from camera (view pos), sun-similated.
    OGFLOADER: "Lost" support for multi-mesh ds2md is back. :)
    ALL (BASE): LOCALVIEWER render-state, reflexes are more accurate now.
    OGF_GLUT, OGF_TK: OnMouseMove() - removed duplicated x,y variables.
    OGFLOADER: Correct faces orientation in ms3d export code.
    ALL: side-step for moving lowered F7 (*4), F8 (/4)
    OGFLOADER: Removed maximum limit for meshes, materials.
    OGFLOADER: In metro2033 models duplicated materials are checked now.
    NEW_REND, OGFSCENE: Not another try to rewrite OGFVIEWER engine (WIP).
    PARSE_YAE: Now we can parse not only models (ds2md) but aslo geometry (ds2, WIP).
    OGFLOADER: Note that ms3d model size is limited by 65535 indexes, 65535 vertexes ("hard" limit for this format!).

    *** Changes (2012.10.31) ***

    [New features]
    PARSE_YAE: Now decoding binary models (ds2md) versions 0.6, 0.9, 1.0
    ALL: Support for binary ds2md (YaE) models version 0.9 (beriya.ds2md, ship.ds2md)
    ALL: Support for binary ds2md (YaE) models version 0.6 (krovat.ds2md medscen1.ds2md medscen2.ds2md toilet.ds2md trash_box.ds2md)
    ALL(DX, GL): In alternate version cull distance incremented to 3 km = 3000 m (was 400 m), use "N" key for it.

    [Fixed bugs]
    OGFLOADER: Fix for ds2md (YaE) models with "short" texture paths.
    ALL(GL): Don't call glBegin(GL_LINES) for grid twice.
    ALL: Correct rescale for ds2md models (divide by 100) and reading bounding box (ds2md 1.0)

    [Optimizations]
    OGFMODEL: Engine classes conflicts with AutoDesk 3DS MAX SDK - fixed (Mesh -> mtMesh ...).
    ALL: Remove _try {} except (1) everywhere

    [Notes]
    OGFLOADER: Size of ms3d model is limited (when exporting) by 65535 indices, vertices ("hardcoded" format limit!).

    *** Changes (2012.12.29) ***

    [New features]
    PARSE_BKP: NEW utility for restoring xray-level source backups
    MBENCH: new bench tool with tri, ply, nmb? model support, also ltest tool refresh
    ALL,DX,GL: fully implemented anisotropy
    PARSE_LEV: Option 4 correcrtly converts lightmaps separated from base geometry

    [Fixed bugs]
    PARSE_LEV: fix while deleting nonexistent array ( delete [] swiblk )
    OGFLOADER: crop vtx block larger than 65535 for LARGE objects
    OS2: fix for bad timer - now we use DosTmrQueryFreq/Time, does not depend now on tcpip.lib
    OS2: IBM CPP needs to remove optimization (-O+) or change it to (-Oc+) so cull using bbox will work properly
    OGFLOADERZ: now models import not affected by "pragma pack #1" ( /Zp1 ), used in MAX plugins
    OGFLOADER:fixed 0x0E S_BONE_NAMES section read

    [Optimizations]
    ALL: v_far_dist, HI_DIST now in base code (not only in ogf_dx?)
    OGFLOADER: read object portion 0x1005 in one block regardless of USE_XLAT
    MESHCONV: define USE_DX9 to disable pointless USE_XLAT stuff
    OGFLOADER: removing memcpy() where possible - it is slow - use f.e. *(int*) instead
    OGFLOADER: made normals, calc bbox once for object, m2033, calc bs_radius for *.ds2md
    PARSE_LEV: now removes duplicated vertices (10% economy for final levels, 30-40% for earlier builds!)
    OS2: it is safe to use -onatx (i.e. OPT=1) in all Watcom builds
    IL_WRAP: logging only when USE_LOG, mipmap support
    ALL,GL,OGFLOADER: anisotropy evaluates float constant
    ALL: optimize 'F9' MIPMAP code
    ALL,GL: glCompressedTeximage2D ext. in all code (excl. pure OS/2)

    *** Changes (2013.06.30) ***

    [New features]
    MESHCONV: support for rescaling while converting data
    OGFLOADER: Now we support all types of 4A Engine models (Metro 2033, Metro Last Light) - *.model, *.mesh

    [Fixed bugs]
    CHILDVIEW: When DISABLE_TEXTURING is declared program does not compile (Windows).

    [Optimizations]
    OGFLOADER: Internal model code for 4A Engine changed from 0x2033 to 0x4AE0
    ALL,GL: Now we show GLSL version in logs, info panels
    PARSE_203: Now removes duplicated vertices (see. PARSE_LEV above)

    * * *

2013.06.xx