本文整理汇总了C++中Vertices::getAttributes方法的典型用法代码示例。如果您正苦于以下问题:C++ Vertices::getAttributes方法的具体用法?C++ Vertices::getAttributes怎么用?C++ Vertices::getAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertices
的用法示例。
在下文中一共展示了Vertices::getAttributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reRender
//.........这里部分代码省略.........
{
// enable render options
glEnable(GL_DEPTH_TEST);
// clear background & zbuffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
// old: precalculate ambient occlusion data (now done in endscene)
for(list<Geometry*>::iterator i = scene.geometry.begin(); i != scene.geometry.end(); ++i)
{
// initialize variables
if((*i)->type != MESH_GEOMETRY)
continue;
Mesh& geometry = *(Mesh*)*i;
Points* points = geometry.points;
Vertices* vertices = geometry.vertices;
Edges* edges = geometry.edges;
Primitives* primitives = geometry.primitives;
Map* map = geometry.map;
if(vertices == null)
continue; // error - no vertices
// retrieve attributes
GlRasElements* locationElements = null,
* indexElements = null,
* normAreaElements = null;
GlStream* vertexStream = null,
* indexStream = null,
* normAreaStream = null;
if(points)
locationElements = (GlRasElements*)points->getAttributes(RE_LOCATION);
if(locationElements != null)
{
indexElements = (GlRasElements*)vertices->getAttributes(RE_INDEX);
normAreaElements = (GlRasElements*)vertices->getAttributes(RE_EXT_BENT_NORMAL_AREA);
}
else
{
locationElements = (GlRasElements*)vertices->getAttributes(RE_LOCATION);
if(locationElements == null)
return; //error
normAreaElements = (GlRasElements*)vertices->getAttributes(RE_EXT_BENT_NORMAL_AREA);
indexElements = null;
}
vertexStream = locationElements->getStream();
if(indexElements)
indexStream = indexElements->getStream();
if(normAreaElements)
normAreaStream = normAreaElements->getStream();
// calculate ambient occlusion
GlStream occlusionStream;
if(normAreaStream)
{
// create occlusion stream (one occlusion value per vertex)
occlusionStream.create(vertexStream->getLength(), VEC4_FLOAT16_STREAM, null); //FLOAT16_STREAM?
// create (& bind) occlusion kernel
GlKernel kernel;
kernel.build(fsCalculateDiscOcclusion1Pass, vsTexCoord1);
kernel.bind();