how to load textures?

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

how to load textures?

Hi,
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;
     parksData.name() = "parks";
     parksData.url() = PARKS_URL;
     parksData.buildSpatialIndex() = true;
     Style style;
     style.setName("parks");
     ModelSymbol* model = style.getOrCreate<ModelSymbol>();
     model->url()->setLiteral(TREE_MODEL_URL);
     model->scale()->setLiteral(0.2);
     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.name() = "parks";
      parks.featureSource() = parksData;
      parks.layout() = layout;
      parks.styles() = new StyleSheet();
      parks.styles()->addStyle(style);
      parks.instancing() = true;
      parks.clusterCulling() = false;
      map->addLayer(new FeatureModelLayer(parks));


gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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
Loading...