[2197] | 1 | GameTools standalone tool:
|
---|
| 2 |
|
---|
| 3 | Command line options
|
---|
| 4 | #############################
|
---|
| 5 | > pathmap.exe [s|p/v] -D <media input directory> -L <level file> -M <materials file> -O <mesh output dir>
|
---|
| 6 | -P <prm out put dir> -E <number of entry points> -C <number of clusters> -S <shadow map resolution>
|
---|
| 7 |
|
---|
| 8 | operations
|
---|
| 9 | s - Segment input meshes: creates new versions of input meshes, and outputs them to the <mesh output dir>.
|
---|
| 10 | These processed meshes will contain smaller submeshes, to which PRM textures will be assigned.
|
---|
| 11 | p - Precompute PRM textures. Outputs textures (hdr format), a new level file (with cluster assigment info),
|
---|
| 12 | and an entry point file.
|
---|
| 13 | sp- Do both of the above.
|
---|
| 14 | v - Do neither of the above, only visualize results.
|
---|
| 15 |
|
---|
| 16 | switches
|
---|
| 17 | D directory for input files (level file, material file, meshes in .x or OGRE xml format, texture images)
|
---|
| 18 | L file name of level file (txt file listing meshes and entities)
|
---|
| 19 | M file name for material file (txt file listing material name - color texture pairs)
|
---|
| 20 | O output directory for segmented meshes and the new level file
|
---|
| 21 | (this is also the input directory for the same files if operation 's' is not specified)
|
---|
| 22 | P output directory for PRM textures and the entry point file.
|
---|
| 23 | (this is also the input directory for the same if operation 'p' is not specified)
|
---|
| 24 | E number of entry points. Must be 4096*n.
|
---|
| 25 | C number of entry point clusters overall. How many of them influences a single entity is given in the level file.
|
---|
| 26 | S depth map resolution used for indirect illumination precomputation.
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | File formats
|
---|
| 30 | #############################
|
---|
| 31 | Level file [media\*.level]
|
---|
| 32 | Lists meshes and entities.
|
---|
| 33 | Mesh attributes:
|
---|
| 34 | ogrefile Binary OGRE file. (output as input, not used in tool)
|
---|
| 35 | ogreXMLfile XML OGRE file. (loaded in tool)
|
---|
| 36 | xfile DirectX mesh file. (loaded if no OGRE xml specified)
|
---|
| 37 | patmapresolution PRM tile resolution. (also influences UV map generation)
|
---|
| 38 | divide Number of desired mesh segments. (a PRM texture is assigned to a segment)
|
---|
| 39 | Entity attributes
|
---|
| 40 | mesh mesh name
|
---|
| 41 | transformation modeling trnasformation as a 4x4 matrix
|
---|
| 42 | pathmapclusters number of clusters relevant to subentities of this entity (recommended:32)
|
---|
| 43 | pathmapfile output texture file name stub
|
---|
| 44 |
|
---|
| 45 | Material file [media/*.materials]
|
---|
| 46 | XML file that describes materials OGRE for the pathmap tool.
|
---|
| 47 | For every material name, a texture name or a solid color is given.
|
---|
| 48 |
|
---|
| 49 | Entry points file [prm\prmEntryPoints.text]
|
---|
| 50 | Lists entry points with position, normal and generation probability,
|
---|
| 51 | plus number of entry points per cluster.
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | Real-time global illumination
|
---|
| 55 | #############################
|
---|
| 56 |
|
---|
| 57 |
|
---|
| 58 | Provided effect:
|
---|
| 59 | #################
|
---|
| 60 |
|
---|
| 61 | Indirect illumination with Precomputed Radiance Maps (PRM)
|
---|
| 62 |
|
---|
| 63 | Standalone final rendering (real time GI) application without or with [if
|
---|
| 64 | GENERATE_PATH_MAPS is defined in PathMapEffect.cpp] PRM precomputing
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | Algorithm benefits:
|
---|
| 68 | ###################
|
---|
| 69 | Provides real-time indirect illumination. As opposed to static light maps,
|
---|
| 70 | actual lighting conditions influence indirect illumination. The effect is
|
---|
| 71 | achieved by combining multiple 'PRM panes' (partial "light maps") according to
|
---|
| 72 | current illumination of 'entry point clusters'.
|
---|
| 73 |
|
---|
| 74 | As opposed to PRT (precomputed radiance transfer), no tessellation (finite
|
---|
| 75 | elements) is needed, and near light sources are handled. (We do not assume
|
---|
| 76 | infinitely distant
|
---|
| 77 | environment lighting.)
|
---|
| 78 |
|
---|
| 79 | Accuracy of PRMs depends on the number of entry points used, influencing
|
---|
| 80 | preocessing time only.
|
---|
| 81 |
|
---|
| 82 | Final rendering requires a compositing of PRMs, where performance depends on the
|
---|
| 83 | number of 'entry point clusters' considered for an object. As many texture
|
---|
| 84 | fetches as clusters are needed. A lower number of clusters will result in
|
---|
| 85 | indirect illumination which is less responsive to actual lighting, but still
|
---|
| 86 | plausible. (A single cluster would reproduce a static light map which is scaled
|
---|
| 87 | according to the total direct illumination.)
|
---|
| 88 |
|
---|
| 89 |
|
---|
| 90 | Build:
|
---|
| 91 | ######
|
---|
| 92 | This is a standalone DirectX 9.0 application, compiles under Visual C++ 2003
|
---|
| 93 | with DirectX SDK April 2006 (identical to June 2006).
|
---|
| 94 |
|
---|
| 95 | Parameters (PRM resolution, shadow map resolution, #entry points, #clusters,
|
---|
| 96 | etc.) are hardcoded as #define directives in PathMapEffect.h.
|
---|
| 97 |
|
---|
| 98 | GENERATE_PATH_MAPS in PathMapEffect.cpp must be defined to perform precomputing,
|
---|
| 99 | outputting textures to the PRM subfolder. Otherwise, PRM textures are loaded
|
---|
| 100 | from the PRM subfolder.
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | Usage notes:
|
---|
| 104 | ############
|
---|
| 105 | - as precomputing is used, this tool should be used for static level geometry
|
---|
| 106 | - multiple static objects are supported and encouraged: every object will use a
|
---|
| 107 | set of most important PRM panes
|
---|
| 108 | - models must have unique texture mapping (just like light maps)
|
---|
| 109 |
|
---|
| 110 | - there is no support for any particular 'level geometry' discription format.
|
---|
| 111 | DirectX .x files and referenced textures are loaded from code.
|
---|
| 112 | - To include the method in a particular engine, the level geometry should be
|
---|
| 113 | used to compose the scene which is used to generate the PRM textures. Final
|
---|
| 114 | compositing must be implemented in the shader system of the game engine,
|
---|
| 115 | assigning the computed PRMs to the respective objects as textures.
|
---|