コード例 #1
0
bool ShouldGenerateSurfelsOnMesh(const FMeshBatch& Mesh, ERHIFeatureLevel::Type FeatureLevel)
{
	//@todo - support for tessellated meshes
	return Mesh.Type == PT_TriangleList 
		&& !Mesh.IsTranslucent(FeatureLevel) 
		&& Mesh.MaterialRenderProxy->GetMaterial(FeatureLevel)->GetShadingModel() != MSM_Unlit;
}
コード例 #2
0
	virtual void DrawMesh(const FMeshBatch& Mesh, float ScreenSize)
	{
		if (Mesh.GetNumPrimitives() > 0)
		{
			check(Mesh.VertexFactory);
			check(Mesh.VertexFactory->IsInitialized());
#if DO_CHECK
			Mesh.CheckUniformBuffers();
#endif
			FStaticMesh* StaticMesh = new(PrimitiveSceneInfo->StaticMeshes) FStaticMesh(
				PrimitiveSceneInfo,
				Mesh,
				ScreenSize,
				CurrentHitProxy ? CurrentHitProxy->Id : FHitProxyId()
				);
		}
	}
コード例 #3
0
	virtual void DrawMesh(
		const FMeshBatch& Mesh,
		float MinDrawDistance,
		float MaxDrawDistance,
		bool bShadowOnly
		)
	{
		check(Mesh.GetNumPrimitives() > 0);
		check(Mesh.VertexFactory);
		check(Mesh.VertexFactory->IsInitialized());
#if DO_CHECK
		Mesh.CheckUniformBuffers();
#endif
		FStaticMesh* StaticMesh = new(PrimitiveSceneInfo->StaticMeshes) FStaticMesh(
			PrimitiveSceneInfo,
			Mesh,
			FMath::Square(FMath::Max(0.0f,MinDrawDistance)),
			FMath::Square(FMath::Max(0.0f,MaxDrawDistance)),
			bShadowOnly,
			CurrentHitProxy ? CurrentHitProxy->Id : FHitProxyId()
			);
	}
コード例 #4
0
void FMeshElementCollector::AddMesh(int32 ViewIndex, FMeshBatch& MeshBatch)
{
	checkSlow(MeshBatch.GetNumPrimitives() > 0);
	checkSlow(MeshBatch.VertexFactory && MeshBatch.MaterialRenderProxy);
	checkSlow(PrimitiveSceneProxy);

	if (MeshBatch.bCanApplyViewModeOverrides)
	{
		FSceneView* View = Views[ViewIndex];

		ApplyViewModeOverrides(
			ViewIndex,
			View->Family->EngineShowFlags,
			View->GetFeatureLevel(),
			PrimitiveSceneProxy,
			MeshBatch.bUseWireframeSelectionColoring,
			MeshBatch,
			*this);
	}

	TArray<FMeshBatchAndRelevance,SceneRenderingAllocator>& ViewMeshBatches = *MeshBatches[ViewIndex];
	new (ViewMeshBatches) FMeshBatchAndRelevance(MeshBatch, PrimitiveSceneProxy, FeatureLevel);	
}