------------------------------------------------------------- Description: Put the very basic info of a mesharea (block) into a class that contains the list of areas and a pointer to a material -------------------------------------------------------------
| 525 | // Put the very basic info of a mesharea (block) into a class that contains the list of areas and a pointer to a material |
| 526 | // ------------------------------------------------------------- |
| 527 | void Tr2MeshBase::CollectAreaBlocksWithSharedMaterials( std::vector<TriRenderBatchAreaBlocksWithSharedMaterial>& collectors, TriBatchType areaType ) const |
| 528 | { |
| 529 | const Tr2MeshAreaVector* areas = GetAreas( areaType ); |
| 530 | for( auto a = areas->begin(); a != areas->end(); ++a ) |
| 531 | { |
| 532 | if( areaType == TRIBATCHTYPE_OPAQUE && !( *a )->IsCastingShadows() ) |
| 533 | { |
| 534 | continue; |
| 535 | } |
| 536 | if( areaType == TRIBATCHTYPE_DECAL && !( *a )->IsCastingShadows() ) |
| 537 | { |
| 538 | continue; |
| 539 | } |
| 540 | |
| 541 | uint32_t i = 0; |
| 542 | for( ; i < collectors.size(); i++ ) |
| 543 | { |
| 544 | if( collectors[i].m_shaderMaterial->GetHashValue() == ( *a )->GetMaterialInterface()->GetHashValue() ) |
| 545 | { |
| 546 | break; |
| 547 | } |
| 548 | } |
| 549 | if( i == collectors.size() ) |
| 550 | { |
| 551 | auto entry = TriRenderBatchAreaBlocksWithSharedMaterial(); |
| 552 | entry.m_shaderMaterial = ( *a )->GetMaterialInterface(); |
| 553 | collectors.push_back( entry ); |
| 554 | } |
| 555 | |
| 556 | TriRenderBatchAreaBlock ab( ( *a )->GetIndex(), ( *a )->GetCount() ); |
| 557 | collectors[i].m_areaBlockVector.push_back( ab ); |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | void Tr2MeshBase::SetShaderOption( const BlueSharedString& name, const BlueSharedString& value ) |
| 562 | { |
no test coverage detected