Changeset 13041 for OpenSceneGraph/trunk/src/osgPlugins/txp/trpage_geom.h
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/txp/trpage_geom.h
r12538 r13041 148 148 This returns the number of terrain LODs in the file. It will be at least 1. 149 149 See trpgAttach for instructions on how to hook the terrain LODs together. 150 151 For version 2.1 and over, this number represent the depest lod that was found 152 in the gaming area. With variable lod, tiles will not ncessarily fill out all of 150 151 For version 2.1 and over, this number represent the depest lod that was found 152 in the gaming area. With variable lod, tiles will not ncessarily fill out all of 153 153 the gaming area for all of the lods. trpgAttach node are no longer used, instead 154 154 see trpgChildRef … … 191 191 } 192 192 bool GetIsMaster() const 193 { 193 { 194 194 return ((flags & ISMASTER)==ISMASTER); 195 195 } … … 259 259 void SetEnvMode(int); 260 260 // Values used by SetMinFilter and SetMagFilter 261 enum {Point, Linear, MipmapPoint, MipmapLinear, 261 enum {Point, Linear, MipmapPoint, MipmapLinear, 262 262 MipmapBilinear, MipmapTrilinear, Nearest}; 263 263 // Set the Minification filter for a texture … … 285 285 /* The Minification and Magnification filters control how texture 286 286 mipmap levels are used. We support the values: Point, Linear, 287 MipmapPoint, MipmapLinear, 287 MipmapPoint, MipmapLinear, 288 288 MipmapBilinear, MipmapTrilinear, Nearest 289 289 */ … … 494 494 495 495 // Note: Need to do equality operator 496 496 497 497 protected: 498 498 bool isBump; … … 718 718 // Set the transparent scale for Performer Lights 719 719 void SetPerformerTpScale( float64 ); 720 720 721 721 // Set the transparent clamp for Performer Lights 722 722 void SetPerformerTpClamp( float64 ); … … 945 945 // operator 946 946 trpgLightTable & operator = (const trpgLightTable &); 947 947 948 948 typedef std::map<int,trpgLightAttr> LightMapType; 949 949 LightMapType *getLightMap() { return &lightMap; } … … 1023 1023 /* The Range Table is new to 2.0. The goal is to provide information about 1024 1024 certain classes of features within a TerraPage database. It's intended 1025 to solve the following problem. 1026 1025 to solve the following problem. 1026 1027 1027 Let's say that you have an Image Generator that must draw a given TerraPage 1028 database at 60Hz. However, it's only hitting 30Hz reliably. Often, some 1028 database at 60Hz. However, it's only hitting 30Hz reliably. Often, some 1029 1029 feature set (e.g. bushes) must be sacrified in order to reach the target frame rate. 1030 1030 Determining which features can be throttled back can often be very difficult. … … 1046 1046 allow run-time systems to tell users what they're dropping (or allow them to pick). 1047 1047 The priority is there to tell systems what to get rid of first (according to the 1048 user who build the TerraPage archive). 1049 1048 user who build the TerraPage archive). 1049 1050 1050 Priorities are relative to each other within the Range Table. There can be 1051 1051 duplicates and there may be holes in the numbering. … … 1059 1059 ~trpgRangeTable(void); 1060 1060 1061 // Get the given range info 1061 // Get the given range info 1062 1062 bool GetRange(int id,trpgRange &) const; 1063 1063 … … 1109 1109 This is your central index for materials. If you can handle the multiple channels/sub-tables 1110 1110 then you can access those as you need. If you can't, just use 0 for the sub-table index where appropriate. 1111 1111 1112 1112 If you're doing a TerraPage writer you'll need to build up a trpgMatTable to pass to 1113 1113 trpgwArchive. If you're only doing a single sub-table (i.e. visible materials only) … … 1138 1138 //void SetMaterial(int subTable,int mat,const trpgMaterial &); 1139 1139 void SetMaterial(int,const trpgMaterial &); 1140 1140 1141 1141 /* This function should be used if you only have a single material sub-table. 1142 1142 It searches for a matching material and then adds a new one if it doesn't … … 1358 1358 int32 MipLevelSize(int miplevel); 1359 1359 1360 // Returns the offset of the mip level in the whole texture data buffer 1360 // Returns the offset of the mip level in the whole texture data buffer 1361 1361 int32 MipLevelOffset(int miplevel); 1362 1362 … … 1501 1501 } 1502 1502 protected: 1503 1503 1504 1504 TextureMapType textureMap; 1505 1505 //These are used to initialize the row/col values for … … 1665 1665 } 1666 1666 protected: 1667 1667 1668 1668 ModelMapType modelsMap; 1669 1669 }; … … 1683 1683 // Tiles can be stored individually (External and ExternalSaved) or in grouped files (Local). 1684 1684 // ExternalSaved still have an entry in the table. In this case the addess data is not valid. 1685 1685 1686 1686 enum TileMode {Local,External, ExternalSaved}; 1687 1687 … … 1703 1703 bool GetMode(TileMode &) const; 1704 1704 // Get the disk reference (local) 1705 bool GetTile(int x,int y,int lod,trpgwAppAddress &,float32 &min,float32 &max) const; 1705 bool GetTile(int x,int y,int lod,trpgwAppAddress &,float32 &min,float32 &max) const; 1706 1706 1707 1707 // Validity check … … 1864 1864 the trpgTexture object. 1865 1865 1866 The second way of doing texture paging (in version 2.0) is more complex, but 1866 The second way of doing texture paging (in version 2.0) is more complex, but 1867 1867 much more powerful. One of the big problems we encountered with v1.0 was the 1868 1868 enormous proliferation of texture files. In addition, much information was 1869 duplicated between the different terrain resolutions. Lastly, we (TERREX) have 1869 duplicated between the different terrain resolutions. Lastly, we (TERREX) have 1870 1870 had a lot of success with wavelet compressed image pyramids for solving quite a 1871 1871 few interesting problems. This second approach to texture paging makes use of 1872 1872 what we've learned from all of this. The idea is that instead of having lots of 1873 little textures, we have a small number of very large images which can support 1873 little textures, we have a small number of very large images which can support 1874 1874 extraction at any resolution. In this way we re-use information between terrain 1875 1875 levels of detail and we cut down on our disk usage, both in terms of number of … … 1887 1887 If you want to page models, you can do so by looking at the list of model IDs 1888 1888 used in a tile. 1889 1889 1890 1890 If you're doing a TerraPage writer you will need to construct one of these for 1891 1891 each tile that you build (remember that tiles are per-terrain LOD). You'll want … … 2487 2487 // Get the tile grid location 2488 2488 bool GetTileLoc(int &gx,int &gy,int &glod) const; 2489 2489 2490 2490 2491 2491 void SetTileAddress(const trpgwAppAddress& gAddr); … … 2493 2493 void SetTileZValue( float gZmin, float gZmax); 2494 2494 bool GetTileAddress(int32& file, int32& offset) const; 2495 bool GetTileAddress(trpgwAppAddress& gAddr) const; 2495 bool GetTileAddress(trpgwAppAddress& gAddr) const; 2496 2496 bool GetTileZValue( float& gZmin, float& gZmax) const; 2497 2497 2498 2498 2499 2499 // Validity check … … 2511 2511 // File Location 2512 2512 trpgwAppAddress addr; 2513 2513 2514 2514 float zmin, zmax; 2515 2515 … … 2892 2892 protected: 2893 2893 //std::vector<trpgTextStyle> styles; 2894 2894 2895 2895 StyleMapType styleMap; 2896 2896 }; … … 3020 3020 // Get the font style ID. Points into trpgSupportTable 3021 3021 int GetSupport(void) const; 3022 3022 3023 3023 // Write this class to a write buffer 3024 3024 bool Write(trpgWriteBuffer &); … … 3092 3092 bool isValid(void) const; 3093 3093 3094 3094 3095 3095 typedef enum {Left,Center,Right,MaxAlignmentType} AlignmentType; 3096 3096
