how to load textures?

classic Classic list List threaded Threaded
2 messages Options
Latha Latha
Reply | Threaded
Open this post in threaded view

how to load textures?

I am loading  .osgb models  as below,Because of Models i am getting less frame rate.How to load textures in the place of models to get more frame rate?  
     OGRFeatureOptions parksData; = "parks";
     parksData.url() = PARKS_URL;
     parksData.buildSpatialIndex() = true;
     Style style;
     ModelSymbol* model = style.getOrCreate<ModelSymbol>();
     model->placement() = model->PLACEMENT_RANDOM;
     model->density() = 3000.0f; // instances per sqkm
     AltitudeSymbol* alt = style.getOrCreate<AltitudeSymbol>();
     alt->clamping() = alt->CLAMP_TO_TERRAIN;
     RenderSymbol* render = style.getOrCreate<RenderSymbol>();
     render->transparent() = true;
     render->minAlpha() = 0.15f;
     FeatureDisplayLayout layout;
      layout.tileSize() = 650;
      layout.maxRange() = 2000.0f;
      FeatureModelLayerOptions parks; = "parks";
      parks.featureSource() = parksData;
      parks.layout() = layout;
      parks.styles() = new StyleSheet();
      parks.instancing() = true;
      parks.clusterCulling() = false;
      map->addLayer(new FeatureModelLayer(parks));

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view

Re: how to load textures?

You can increase performance by loading a simpler model, Perhaps a tree model made up of 1 or 2 quads. The "tree.ive" model in the osgEarth repo is an example.

Glenn Waldron / Pelican Mapping