Announcement

Collapse
No announcement yet.

Why FDynamicMeshBuilder not shaded?

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

    Why FDynamicMeshBuilder not shaded?

    Hello

    I create UE4 Editor plugin. And I need to draw dynamic shape

    I do it in my FEdMode::Render. Something like this:


    void FmyEdMode::Render(const FSceneView* View, FViewport* Viewport, FPrimitiveDrawInterface* PDI)

    {

    FEdMode::Render(View, Viewport, PDI);

    .....

    FDynamicMeshBuilder MeshBuilder(ERHIFeatureLevel::ES3_1);

    if ( AddTrianglesToMesh( MeshBuilder ) )

    {

    static UMaterial* mater = (UMaterial*)StaticLoadObject(UMaterial::StaticClass(), NULL, TEXT("/Engine/BasicShapes/BasicShapeMaterial"), NULL, LOAD_None, NULL);

    MeshBuilder.Draw(PDI, FMatrix::Identity, mater->GetRenderProxy(false), SDPG_World, true, false);

    }
    }


    And my mesh drawing in one color, without any shading.
    Is it possible to shading FDynamicMeshBuilder? If not - how I can drawing my own dynamic mesh?

    Thank you





Working...
X