Announcement

Collapse
No announcement yet.

How to get mesh data(PosL/Normal/Tangent and index) from the Codes?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to get mesh data(PosL/Normal/Tangent and index) from the Codes?

    I had finished blend something into scene color texture like this:

    Code:
          	FPostOpaqueRenderDelegate PostOpaqueRender;
    	PostOpaqueRender.BindLambda(
    		[this](FPostOpaqueRenderParameters& p)
    	{
    		this->ExecutePixelShaderInternal();//Render Code,just some C++ and HLSL
    	}
    	);
    	GetRendererModule().RegisterPostOpaqueRenderDelegate(PostOpaqueRender);
     
    ....
    
         ExecutePixelShaderInternal()
        {
             SetRenderTarget(RHICmdList, FSceneRenderTargets::Get(RHICmdList).GetSceneColorTexture(), FTexture2DRHIRef());
        }

    I found that void FSkeletalMeshSceneProxy::GetDynamicElementsSection collect and render the meshcomponents.
    just like this:
    Code:
    			if ( ensureMsgf(Mesh.MaterialRenderProxy, TEXT("GetDynamicElementsSection with invalid MaterialRenderProxy. Owner:%s LODIndex:%d UseMaterialIndex:%d"), *GetOwnerName().ToString(), LODIndex, SectionElementInfo.UseMaterialIndex) &&
    				 ensureMsgf(Mesh.MaterialRenderProxy->GetMaterial(FeatureLevel), TEXT("GetDynamicElementsSection with invalid FMaterial. Owner:%s LODIndex:%d UseMaterialIndex:%d"), *GetOwnerName().ToString(), LODIndex, SectionElementInfo.UseMaterialIndex) )
    			{
    				Collector.AddMesh(ViewIndex, Mesh);
    			}
    
    			const int32 NumVertices = Chunk.NumRigidVertices + Chunk.NumSoftVertices;
    			INC_DWORD_STAT_BY(STAT_GPUSkinVertices,(uint32)(bIsCPUSkinned ? 0 : NumVertices));
    			INC_DWORD_STAT_BY(STAT_SkelMeshTriangles,Mesh.GetNumPrimitives());
    			INC_DWORD_STAT(STAT_SkelMeshDrawCalls);
    As you see, I'd been stopped here.I can't get the vertex data for doing something like C++ with HLSL.
    Do someone know how to get mesh data for another rendering pipeline?

    Codes guide comes from Temaran and "女施主,使不得呀"
    Last edited by Jingz; 11-07-2016, 02:55 AM.

    #2
    why only me?

    Comment

    Working...
    X