MCPcopy Create free account
hub / github.com/ImageEngine/cortex / renderInstances

Method renderInstances

src/IECoreGL/SpherePrimitive.cpp:136–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void SpherePrimitive::renderInstances( size_t numInstances ) const
137{
138 if( !m_vertIdsBuffer )
139 {
140 // we don't build the actual buffer until now, because in the constructor we're not guaranteed
141 // a valid GL context.
142 CachedConverterPtr cachedConverter = CachedConverter::defaultCachedConverter();
143 m_vertIdsBuffer = IECore::runTimeCast<const Buffer>( cachedConverter->convert( m_vertIds.get() ) );
144 }
145
146 Buffer::ScopedBinding indexBinding( *m_vertIdsBuffer, GL_ELEMENT_ARRAY_BUFFER );
147 glDrawElementsInstancedARB( GL_TRIANGLES, m_vertIds->readable().size(), GL_UNSIGNED_INT, nullptr, numInstances );
148}
149
150Imath::Box3f SpherePrimitive::bound() const
151{

Callers

nothing calls this directly

Calls 4

readableMethod · 0.80
convertMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected