osgearth 代码 hack(六) groundcover 解析

GroundCover 翻译为地被植物。

 

/**
* A Biome is a collection of ground cover objects corresponding
* to a set of land cover classes. For example, the "forest" biome
* might map to three different tree billboards.
*/

 

GroundCoverObject  代表单个的地表覆盖物

GroundCoverObjects  地表覆盖物的集合。 

GroundCoverBillboard 是地表覆盖物的一种。 还有其他种?

 

GroundCoverBiomes  是什么? A: 代表了一个种类的地表覆盖物。 例如一个 forest biome 可以映射为3个不同的树 billboard。包含了 GroundCoverObjects

GroundCoverBiomes  实现哪些功能?

 

GroundCoverLayer  parent is patchLayer.

//! Macro to use when defining a Layer class
#define META_Layer(LIBRARY, MYCLASS, OPTIONS, SUPERCLASS, SLUG) \
    private: \
        OPTIONS * _options; \
        OPTIONS   _optionsConcrete; \
        MYCLASS ( const MYCLASS& rhs, const osg::CopyOp& op ) { } \
    protected: \
        OE_COMMENT("Construct a new layer with default options") \
        MYCLASS (OPTIONS* optr) : SUPERCLASS (optr? optr: &_optionsConcrete), _options(optr ? optr : &_optionsConcrete) { } \
    public: \
        META_Object(LIBRARY, MYCLASS); \
        \
        OE_COMMENT("Construct a new layer with default options") \
        MYCLASS () : SUPERCLASS (&_optionsConcrete), _options(&_optionsConcrete) { MYCLASS::init(); } \
        \
        OE_COMMENT("Construct a new layer with user-defined options") \
        MYCLASS (const OPTIONS& o) : SUPERCLASS (&_optionsConcrete), _options(&_optionsConcrete), _optionsConcrete(o) { MYCLASS::init(); } \
        \
        OE_COMMENT("Mutable options for this layer") \
        OPTIONS& options() { return *_options; } \
        \
        OE_COMMENT("Immutable options for this layer") \
        const OPTIONS& options() const { return *_options; } \
        \
        OE_COMMENT("Configuration key for this layer (e.g. for earth files)") \
        virtual const char* getConfigKey() const { return #SLUG ; }

  PatchLayer 的作用是什么,还没有弄的很清楚,  跟GL_PATCH什么关系呢?

GL_PATCH  是一种新的primitive .  和 GL_POINT   GL_LINE  等并列关系。   OPENGL4 中新增了  细分曲面shader .    专门处理 GL_PATCH .    在vertex  shader中, 只能处理单个的vertex . 

vertex 之间的关系,没有用上。  这个patchlayer  和 GL_PATCH 是什么关系呢 ?

 

posted @ 2020-05-19 12:49  小阳明  阅读(505)  评论(0)    收藏  举报