osgEarth的Rex引擎原理分析(六十六)DrawTileCommand中的采样器
作者:互联网
目标:(五十五)中的问题137
DrawTileCommand中的颜色采样器_colorSamplers和共享采样器_sharedSamplers的区别,能不能用一个。RenderBindings将采样器分为6个,前2个是颜色采样器,后4个是共享采样器。
osgEarthDrivers/engine_rex/RenderBindings
enum Usage
{
COLOR = 0,
COLOR_PARENT = 1,
ELEVATION = 2,
NORMAL = 3,
COVERAGE = 4,
SHARED = 5 // non-core shared layers start at this index
};
这些采样器,在裁剪器中进行赋值
osgEarthDrivers/engine_rex/TerrainCuller.cpp
DrawTileCommand*
TerrainCuller::addDrawCommand(UID uid, const TileRenderModel* model, const RenderingPass* pass, TileNode* tileNode)
{
DrawTileCommand* tile = &drawable->_tiles.back();
// install everything we need in the Draw Command:
tile->_colorSamplers = pass ? &(pass->samplers()) : 0L;
tile->_sharedSamplers = &model->_sharedSamplers;
}
hankern 发布了367 篇原创文章 · 获赞 33 · 访问量 9万+ 私信 关注
标签:DrawTileCommand,Rex,采样器,pass,tile,sharedSamplers,RenderBindings 来源: https://blog.csdn.net/hankern/article/details/104188262