本文整理汇总了C++中LLVertexBuffer::getColorStrider方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVertexBuffer::getColorStrider方法的具体用法?C++ LLVertexBuffer::getColorStrider怎么用?C++ LLVertexBuffer::getColorStrider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVertexBuffer
的用法示例。
在下文中一共展示了LLVertexBuffer::getColorStrider方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getGeometry
void LLParticlePartition::getGeometry(LLSpatialGroup* group)
{
LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
LLFastTimer ftm(mDrawableType == LLPipeline::RENDER_TYPE_GRASS ?
LLFastTimer::FTM_REBUILD_GRASS_VB :
LLFastTimer::FTM_REBUILD_PARTICLE_VB);
std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareDistanceGreater());
U32 index_count = 0;
U32 vertex_count = 0;
group->clearDrawMap();
LLVertexBuffer* buffer = group->mVertexBuffer;
LLStrider<U16> indicesp;
LLStrider<LLVector3> verticesp;
LLStrider<LLVector3> normalsp;
LLStrider<LLVector2> texcoordsp;
LLStrider<LLColor4U> colorsp;
buffer->getVertexStrider(verticesp);
buffer->getNormalStrider(normalsp);
buffer->getColorStrider(colorsp);
buffer->getTexCoord0Strider(texcoordsp);
buffer->getIndexStrider(indicesp);
LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[mRenderPass];
for (std::vector<LLFace*>::iterator i = mFaceList.begin(); i != mFaceList.end(); ++i)
{
LLFace* facep = *i;
LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject();
facep->setGeomIndex(vertex_count);
facep->setIndicesIndex(index_count);
facep->mVertexBuffer = buffer;
facep->setPoolType(LLDrawPool::POOL_ALPHA);
object->getGeometry(facep->getTEOffset(), verticesp, normalsp, texcoordsp, colorsp, indicesp);
vertex_count += facep->getGeomCount();
index_count += facep->getIndicesCount();
S32 idx = draw_vec.size()-1;
BOOL fullbright = facep->isState(LLFace::FULLBRIGHT);
F32 vsize = facep->getVirtualSize();
if (idx >= 0 && draw_vec[idx]->mEnd == facep->getGeomIndex()-1 &&
draw_vec[idx]->mTexture == facep->getTexture() &&
(U16) (draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount()) <= (U32) gGLManager.mGLMaxVertexRange &&
//draw_vec[idx]->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange &&
draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() < 4096 &&
draw_vec[idx]->mFullbright == fullbright)
{
draw_vec[idx]->mCount += facep->getIndicesCount();
draw_vec[idx]->mEnd += facep->getGeomCount();
draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize);
}
else
{
U32 start = facep->getGeomIndex();
U32 end = start + facep->getGeomCount()-1;
U32 offset = facep->getIndicesStart();
U32 count = facep->getIndicesCount();
LLDrawInfo* info = new LLDrawInfo(start,end,count,offset,facep->getTexture(), buffer, fullbright);
info->mExtents[0] = group->mObjectExtents[0];
info->mExtents[1] = group->mObjectExtents[1];
info->mVSize = vsize;
draw_vec.push_back(info);
//for alpha sorting
facep->setDrawInfo(info);
}
}
buffer->setBuffer(0);
mFaceList.clear();
}
示例2: getGeometry
void LLParticlePartition::getGeometry(LLSpatialGroup* group)
{
LLFastTimer ftm(FTM_REBUILD_PARTICLE_GEOM);
std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareDistanceGreater());
U32 index_count = 0;
U32 vertex_count = 0;
group->clearDrawMap();
LLVertexBuffer* buffer = group->mVertexBuffer;
LLStrider<U16> indicesp;
LLStrider<LLVector4a> verticesp;
LLStrider<LLVector3> normalsp;
LLStrider<LLVector2> texcoordsp;
LLStrider<LLColor4U> colorsp;
LLStrider<LLColor4U> emissivep;
buffer->getVertexStrider(verticesp);
buffer->getNormalStrider(normalsp);
buffer->getColorStrider(colorsp);
buffer->getEmissiveStrider(emissivep);
LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[mRenderPass];
for (std::vector<LLFace*>::iterator i = mFaceList.begin(); i != mFaceList.end(); ++i)
{
LLFace* facep = *i;
LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject();
if (!facep->isState(LLFace::PARTICLE))
{ //set the indices of this face
S32 idx = LLVOPartGroup::findAvailableVBSlot();
if (idx >= 0)
{
facep->setGeomIndex(idx*4);
facep->setIndicesIndex(idx*6);
facep->setVertexBuffer(LLVOPartGroup::sVB);
facep->setPoolType(LLDrawPool::POOL_ALPHA);
facep->setState(LLFace::PARTICLE);
}
else
{
continue; //out of space in particle buffer
}
}
S32 geom_idx = (S32) facep->getGeomIndex();
LLStrider<U16> cur_idx = indicesp + facep->getIndicesStart();
LLStrider<LLVector4a> cur_vert = verticesp + geom_idx;
LLStrider<LLVector3> cur_norm = normalsp + geom_idx;
LLStrider<LLVector2> cur_tc = texcoordsp + geom_idx;
LLStrider<LLColor4U> cur_col = colorsp + geom_idx;
LLStrider<LLColor4U> cur_glow = emissivep + geom_idx;
LLColor4U* start_glow = cur_glow.get();
object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_glow, cur_idx);
BOOL has_glow = FALSE;
if (cur_glow.get() != start_glow)
{
has_glow = TRUE;
}
llassert(facep->getGeomCount() == 4);
llassert(facep->getIndicesCount() == 6);
vertex_count += facep->getGeomCount();
index_count += facep->getIndicesCount();
S32 idx = draw_vec.size()-1;
BOOL fullbright = facep->isState(LLFace::FULLBRIGHT);
F32 vsize = facep->getVirtualSize();
bool batched = false;
U32 bf_src = LLRender::BF_SOURCE_ALPHA;
U32 bf_dst = LLRender::BF_ONE_MINUS_SOURCE_ALPHA;
object->getBlendFunc(facep->getTEOffset(), bf_src, bf_dst);
if (idx >= 0)
{
LLDrawInfo* info = draw_vec[idx];
if (info->mTexture == facep->getTexture() &&
info->mHasGlow == has_glow &&
info->mFullbright == fullbright &&
info->mBlendFuncDst == bf_dst &&
info->mBlendFuncSrc == bf_src)
{
//.........这里部分代码省略.........
示例3: getGeometry
void LLParticlePartition::getGeometry(LLSpatialGroup* group)
{
LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
LLFastTimer ftm(FTM_REBUILD_PARTICLE_GEOM);
std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareDistanceGreater());
U32 index_count = 0;
U32 vertex_count = 0;
group->clearDrawMap();
LLVertexBuffer* buffer = group->mVertexBuffer;
LLStrider<U16> indicesp;
LLStrider<LLVector4a> verticesp;
LLStrider<LLVector3> normalsp;
LLStrider<LLVector2> texcoordsp;
LLStrider<LLColor4U> colorsp;
buffer->getVertexStrider(verticesp);
buffer->getNormalStrider(normalsp);
buffer->getColorStrider(colorsp);
LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[mRenderPass];
for (std::vector<LLFace*>::iterator i = mFaceList.begin(); i != mFaceList.end(); ++i)
{
LLFace* facep = *i;
LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject();
if (!facep->isState(LLFace::PARTICLE))
{ //set the indices of this face
S32 idx = LLVOPartGroup::findAvailableVBSlot();
if (idx >= 0)
{
facep->setGeomIndex(idx*4);
facep->setIndicesIndex(idx*6);
facep->setVertexBuffer(LLVOPartGroup::sVB);
facep->setPoolType(LLDrawPool::POOL_ALPHA);
facep->setState(LLFace::PARTICLE);
}
else
{
continue; //out of space in particle buffer
}
}
S32 geom_idx = (S32) facep->getGeomIndex();
LLStrider<U16> cur_idx = indicesp + facep->getIndicesStart();
LLStrider<LLVector4a> cur_vert = verticesp + geom_idx;
LLStrider<LLVector3> cur_norm = normalsp + geom_idx;
LLStrider<LLVector2> cur_tc = texcoordsp + geom_idx;
LLStrider<LLColor4U> cur_col = colorsp + geom_idx;
object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_idx);
llassert(facep->getGeomCount() == 4);
llassert(facep->getIndicesCount() == 6);
vertex_count += facep->getGeomCount();
index_count += facep->getIndicesCount();
S32 idx = draw_vec.size()-1;
BOOL fullbright = facep->isState(LLFace::FULLBRIGHT);
F32 vsize = facep->getVirtualSize();
bool batched = false;
if (idx >= 0 &&
draw_vec[idx]->mTexture == facep->getTexture() &&
draw_vec[idx]->mFullbright == fullbright)
{
if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1)
{
batched = true;
draw_vec[idx]->mCount += facep->getIndicesCount();
draw_vec[idx]->mEnd += facep->getGeomCount();
draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize);
}
else if (draw_vec[idx]->mStart == facep->getGeomIndex()+facep->getGeomCount()+1)
{
batched = true;
draw_vec[idx]->mCount += facep->getIndicesCount();
draw_vec[idx]->mStart -= facep->getGeomCount();
draw_vec[idx]->mOffset = facep->getIndicesStart();
draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize);
}
}
if (!batched)
{
U32 start = facep->getGeomIndex();
U32 end = start + facep->getGeomCount()-1;
U32 offset = facep->getIndicesStart();
U32 count = facep->getIndicesCount();
//.........这里部分代码省略.........