void MD5ModelNode::render(RenderableCollector& collector, const VolumeTest& volume, const Matrix4& localToWorld, const IRenderEntity& entity) const { // Do some rough culling (per model, not per surface) if (volume.TestAABB(localAABB(), localToWorld) == VOLUME_OUTSIDE) { return; } SurfaceLightLists::const_iterator j = _surfaceLightLists.begin(); // greebo: Iterate over all MD5 surfaces and render them for (MD5Model::const_iterator i = _model->begin(); i != _model->end(); ++i, ++j) { assert(i->shader); // Get the Material to test the shader name against the filter system const MaterialPtr& surfaceShader = i->shader->getMaterial(); if (surfaceShader->isVisible()) { collector.setLights(*j); i->surface->render(collector, localToWorld, i->shader, entity); } } // Uncomment to render the skeleton //collector.SetState(entity.getWireShader(), RenderableCollector::eFullMaterials); //collector.addRenderable(_model->getRenderableSkeleton(), localToWorld, entity); }
// Renderable submission void PicoModelNode::submitRenderables(RenderableCollector& collector, const VolumeTest& volume, const Matrix4& localToWorld, const IRenderEntity& entity) const { // Test the model's intersection volume, if it intersects pass on the // render call if (volume.TestAABB(_picoModel->localAABB(), localToWorld) != VOLUME_OUTSIDE) { // Submit the lights collector.setLights(_lights); // Submit the model's geometry _picoModel->submitRenderables(collector, localToWorld, entity); } }
void MD5ModelNode::render(RenderableCollector& collector, const VolumeTest& volume, const Matrix4& localToWorld) const { // Do some rough culling (per model, not per surface) if (volume.TestAABB(localAABB(), localToWorld) == VOLUME_OUTSIDE) { return; } SurfaceLightLists::const_iterator j = _surfaceLightLists.begin(); SurfaceRemaps::const_iterator k = _surfaceRemaps.begin(); // greebo: Iterate over all MD5 surfaces and render them for (MD5Model::const_iterator i = _model->begin(); i != _model->end(); ++i, ++j, ++k) { collector.setLights(*j); (*i)->render(collector, localToWorld, k->shader != NULL ? k->shader : (*i)->getState()); } }