Hi!
I’m new to this so I don’t really know my way around to well.
I’m trying to draw a custom mesh but when I, in the SceneProxy, call PDI->DrawMesh the game just crashes and the only thing in the VS output is
Couldn't find Shader TBasePassVSFCachedVolumeIndirectLightingPolicy for Material Resource WorldGridMaterial!
With VF=FWaterSurfaceVertexFactory, Platform=PCD3D_SM5
ShouldCache: Mat=1, VF=0, Shader=1
Material Usage = MSM_DefaultLit, BLEND_Opaque, SpecialEngine, TSNormal
And I have no clue what is causing it so if anyone knows what might be causing the issue then please help me out here. Here’s the code where I render the mesh.
FMeshBatch Mesh;
FMeshBatchElement& BatchElement = Mesh.Elements[0];
Mesh.bWireframe = bWireframe;
Mesh.VertexFactory = &VertexFactory;
Mesh.MaterialRenderProxy = MaterialProxy;
Mesh.ReverseCulling = IsLocalToWorldDeterminantNegative();
Mesh.Type = PT_TriangleList;
Mesh.DepthPriorityGroup = SDPG_World;
BatchElement.IndexBuffer = &IndexBuffer;
BatchElement.PrimitiveUniformBuffer = CreatePrimitiveUniformBufferImmediate(GetLocalToWorld(), GetBounds(), GetLocalBounds(), true);
BatchElement.FirstIndex = 0;
BatchElement.NumPrimitives = IndexBuffer.Indices.Num() / 3;
BatchElement.MinVertexIndex = 0;
BatchElement.MaxVertexIndex = VertexBuffer.Vertices.Num() - 1;
PDI->DrawMesh(Mesh);