| 3984 | } |
| 3985 | |
| 3986 | void EveSpaceObject2::PushRtGeometry( Tr2RaytracingManager& rtManager ) const |
| 3987 | { |
| 3988 | if( !m_mesh || !m_display || !m_castShadow ) |
| 3989 | { |
| 3990 | return; |
| 3991 | } |
| 3992 | |
| 3993 | if( m_boundingSphereRadius <= 0.0 ) |
| 3994 | { |
| 3995 | return; |
| 3996 | } |
| 3997 | |
| 3998 | if( m_estimatedPixelDiameter <= 15.f ) |
| 3999 | { |
| 4000 | return; |
| 4001 | } |
| 4002 | |
| 4003 | auto rtMesh = m_mesh->GetRtMesh(); |
| 4004 | |
| 4005 | if( !rtMesh || !rtMesh->IsGood() ) |
| 4006 | { |
| 4007 | return; |
| 4008 | } |
| 4009 | |
| 4010 | USE_MAIN_THREAD_RENDER_CONTEXT(); |
| 4011 | |
| 4012 | const Tr2MeshAreaVector* opaqueAreas = m_mesh->GetAreas( TRIBATCHTYPE_OPAQUE ); |
| 4013 | |
| 4014 | UpdateRtPerObjectData( m_psData, nullptr, renderContext, m_rtPerObjectData ); |
| 4015 | |
| 4016 | #pragma region geometry |
| 4017 | uint32_t vertexBufferDataIndex = 0; |
| 4018 | for( Tr2MeshAreaVector::const_iterator it = opaqueAreas->begin(); it != opaqueAreas->end(); ++it, ++vertexBufferDataIndex ) |
| 4019 | { |
| 4020 | auto area = *it; |
| 4021 | if( area->GetDisplay() && area->IsCastingShadows() ) |
| 4022 | { |
| 4023 | auto geometry = area->GetRtMeshArea(); |
| 4024 | if( geometry ) |
| 4025 | { |
| 4026 | const Tr2ConstantBufferAL* vertexBufferData = nullptr; |
| 4027 | if( area->HasVertexBufferAccessInRtShadow() ) |
| 4028 | { |
| 4029 | vertexBufferData = area->GetRtMeshArea()->GetGeometryConstants( *rtMesh, renderContext ); |
| 4030 | } |
| 4031 | rtManager.GetGeometry().AddGeometry( *rtMesh, *geometry, area->GetMaterialInterface(), &m_rtPerObjectData, vertexBufferData, m_worldTransform ); |
| 4032 | } |
| 4033 | } |
| 4034 | } |
| 4035 | #pragma endregion |
| 4036 | |
| 4037 | rtManager.GetGeometry().AddBindlessResources( *opaqueAreas, *rtMesh ); |
| 4038 | } |
| 4039 | |
| 4040 | ITr2AudGeometryPtr EveSpaceObject2::GetAudioGeometry() const |
| 4041 | { |
nothing calls this directly
no test coverage detected