TA的每日心情 | 开心 2020-3-20 17:50 |
---|
签到天数: 1 天 [LV.1]初来乍到
|
楼主 |
发表于 2020-3-11 15:57:00
|
显示全部楼层
本帖最后由 liyihongcug 于 2020-3-11 16:18 编辑
例如
<options type="geocentric">
<cache path="d:/test/cache_dir" type="filesystem" />
<terrain first_lod="0" tile_size="17" />
</options>
<options>
<lighting>false</lighting>
<overlay_blending>false</overlay_blending>
<terrain min_lod="8"/>
</options>
MapOptions( const ConfigOptions& options =ConfigOptions() )
: ConfigOptions ( options ),
_cachePolicy ( ),
_cstype ( CSTYPE_GEOCENTRIC ),
_referenceURI ( "" ),
_elevationInterpolation( INTERP_BILINEAR )
MapOptions MapOptions.cpp
optional<std::string> _name;
optional<rofileOptions> _profileOptions;
optional<CacheOptions> _cacheOptions;
optional<CachePolicy> _cachePolicy;
optional<CoordinateSystemType> _cstype;
optional<std::string> _referenceURI;
optional<ElevationInterpolation> _elevationInterpolation;
terrain的源文件在TerrainOptions.cpp
MapOptions:XML<<options>>节点下配置的信息,主要是配置地形渲染时的属性;包括如下
<elevation_interploation> 插值,nearset 最近点插值 average 最近点平均值 bilinear 线性插值, triangulate 三角面片插值
<elevation_tile_size> 瓦片大小
<elevation_texture_size> 纹理大小
<overlay_wapring> 纹理装载
<overlay_blending>混合
<overlay_minmapping> 纹理映射
<overlay_texture_size>
<overlay_attach_stencil>模板 2.8里没有这些参数,2.10才有
TerrainOptions::getConfig() const
{
Config conf = DriverConfigOptions::getConfig();
conf.key() = "terrain";
conf.updateIfSet( "tile_size", _tileSize );
conf.updateIfSet( "vertical_scale", _verticalScale );
conf.updateIfSet( "vertical_offset", _verticalOffset );
conf.updateIfSet( "min_tile_range_factor", _minTileRangeFactor );
conf.updateIfSet( "range_factor", _minTileRangeFactor );
conf.updateIfSet( "max_lod", _maxLOD );
conf.updateIfSet( "min_lod", _minLOD );
conf.updateIfSet( "first_lod", _firstLOD );
conf.updateIfSet( "lighting", _enableLighting );
conf.updateIfSet( "attenuation_distance", _attenuationDistance );
conf.updateIfSet( "lod_transition_time", _lodTransitionTimeSeconds );
conf.updateIfSet( "mipmapping", _enableMipmapping );
conf.updateIfSet( "cluster_culling", _clusterCulling );
conf.updateIfSet( "blending", _enableBlending );
conf.updateIfSet( "mercator_fast_path", _mercatorFastPath );
conf.updateIfSet( "min_normal_map_lod", _minNormalMapLOD );
conf.updateIfSet( "gpu_tessellation", _gpuTessellation );
conf.updateIfSet( "debug", _debug );
conf.updateIfSet( "bin_number", _binNumber );
conf.updateIfSet( "min_expiry_time", _minExpiryTime);
conf.updateIfSet( "min_expiry_frames", _minExpiryFrames);
//Save the filter settings
conf.updateIfSet("mag_filter","LINEAR", _magFilter,osg::Texture:INEAR);
conf.updateIfSet("mag_filter","LINEAR_MIPMAP_LINEAR", _magFilter,osg::Texture::LINEAR_MIPMAP_LINEAR);
conf.updateIfSet("mag_filter","LINEAR_MIPMAP_NEAREST", _magFilter,osg::Texture::LINEAR_MIPMAP_NEAREST);
conf.updateIfSet("mag_filter","NEAREST", _magFilter,osg::Texture::NEAREST);
conf.updateIfSet("mag_filter","NEAREST_MIPMAP_LINEAR", _magFilter,osg::Texture::NEAREST_MIPMAP_LINEAR);
conf.updateIfSet("mag_filter","NEAREST_MIPMAP_NEAREST",_magFilter,osg::Texture::NEAREST_MIPMAP_NEAREST);
conf.updateIfSet("min_filter","LINEAR", _minFilter,osg::Texture::LINEAR);
conf.updateIfSet("min_filter","LINEAR_MIPMAP_LINEAR", _minFilter,osg::Texture::LINEAR_MIPMAP_LINEAR);
conf.updateIfSet("min_filter","LINEAR_MIPMAP_NEAREST", _minFilter,osg::Texture::LINEAR_MIPMAP_NEAREST);
conf.updateIfSet("min_filter","NEAREST", _minFilter,osg::Texture::NEAREST);
conf.updateIfSet("min_filter","NEAREST_MIPMAP_LINEAR", _minFilter,osg::Texture::NEAREST_MIPMAP_LINEAR);
conf.updateIfSet("min_filter","NEAREST_MIPMAP_NEAREST",_minFilter,osg::Texture::NEAREST_MIPMAP_NEAREST);
return conf;
} |
|