-------------------------------------------------------------------------------- Description: helper method to fill shaders of a mesh --------------------------------------------------------------------------------
| 2129 | // helper method to fill shaders of a mesh |
| 2130 | // -------------------------------------------------------------------------------- |
| 2131 | void EveSOF::SetupShaders( const EveSOFDNAPtr dna, Tr2MeshBase* mesh ) const |
| 2132 | { |
| 2133 | if( mesh == nullptr ) |
| 2134 | { |
| 2135 | return; |
| 2136 | } |
| 2137 | // multi-hull! so mesh index must be tracked |
| 2138 | size_t meshIndexOffset = 0; |
| 2139 | // cycle over all hulls in the multi-hull list |
| 2140 | for( size_t hullIdx = 0; hullIdx < dna->GetMultiHullCount(); ++hullIdx ) |
| 2141 | { |
| 2142 | size_t cntr = 0; |
| 2143 | cntr += FillMeshAreaVector( mesh->GetAreas( TRIBATCHTYPE_OPAQUE ), TRIBATCHTYPE_OPAQUE, dna, hullIdx, meshIndexOffset ); |
| 2144 | cntr += FillMeshAreaVector( mesh->GetAreas( TRIBATCHTYPE_OPAQUE ), TRIBATCHTYPE_DECAL, dna, hullIdx, meshIndexOffset ); |
| 2145 | cntr += FillMeshAreaVector( mesh->GetAreas( TRIBATCHTYPE_TRANSPARENT ), TRIBATCHTYPE_TRANSPARENT, dna, hullIdx, meshIndexOffset ); |
| 2146 | cntr += FillMeshAreaVector( mesh->GetAreas( TRIBATCHTYPE_ADDITIVE ), TRIBATCHTYPE_ADDITIVE, dna, hullIdx, meshIndexOffset ); |
| 2147 | cntr += FillMeshAreaVector( mesh->GetAreas( TRIBATCHTYPE_DISTORTION ), TRIBATCHTYPE_DISTORTION, dna, hullIdx, meshIndexOffset ); |
| 2148 | |
| 2149 | auto distortionAreas = mesh->GetAreas( TRIBATCHTYPE_DISTORTION ); |
| 2150 | for( auto ait = begin( *distortionAreas ); ait != end( *distortionAreas ); ++ait ) |
| 2151 | { |
| 2152 | ( *ait )->SetMinLod( TR2_LOD_HIGH ); |
| 2153 | } |
| 2154 | meshIndexOffset += cntr; |
| 2155 | } |
| 2156 | } |
| 2157 | |
| 2158 | // -------------------------------------------------------------------------------- |
| 2159 | // Description: |
nothing calls this directly
no test coverage detected