MCPcopy Create free account
hub / github.com/carbonengine/trinity / PushRtGeometry

Method PushRtGeometry

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:3986–4038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3984}
3985
3986void 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
4040ITr2AudGeometryPtr EveSpaceObject2::GetAudioGeometry() const
4041{

Callers

nothing calls this directly

Calls 14

UpdateRtPerObjectDataFunction · 0.85
GetRtMeshMethod · 0.80
GetAreasMethod · 0.80
IsCastingShadowsMethod · 0.80
GetRtMeshAreaMethod · 0.80
GetGeometryConstantsMethod · 0.80
AddGeometryMethod · 0.80
GetMaterialInterfaceMethod · 0.80
AddBindlessResourcesMethod · 0.80
IsGoodMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected