Material/shader to output just points (vertices) and their colors

Hi. I can render procedural mesh data using wireframe output, but not vertices/points on their own. Is it possible to make a Material Editor example (or C++ code) for me that outputs vertices with vertex colors from Procedural Mesh data (Runtime Mesh Component)? I can do that for meshes/wireframes just fine. A simple example would be great.

Here’s a ‘simple’ pass through vertex shader: https://www.unrealengine.com/en-US/t…shaders-to-ue4 - to replace wireframe rendering. A passthrough vertex shader won’t draw in point mode if you draw triangles - DrawPrimitiveUP(RHICmdList, PT_TriangleStrip, 2, Vertices, sizeof(Vertices[0])); Renders the vertices as a collection of isolated points. This value is unsupported for indexed primitives.

The Point Cloud library approach will be ‘easier’ but inefficient computationally (and by resource usage). Custom shader is more difficult, but more efficient overall.

Below is what works for wireframe… what about for vertices only?

You’d have an easier time making a mesh specifically for it… even the internal vertex color render doesn’t actually render the color on the vertex.

You could try using the mesh in niagara and generating particles on its verticis…

Well, I already have a procedural mesh and don’t see the need to duplicate data again (another mesh) to show points. Also need the solution to scale. I found a vertex shader that might do the trick. It’s unfortunate that a simple feature could be so much overlooked versus other Game Engines and 3D packages. One can tick “Wireframe” in the Material Editor, but “Show Vertices Only” - nope. Generating particles is an idea, but I’m concerned about scale.

Looking for this as well – would you mind sharing the Vertex material you found?

I think the easiest way to do this would be to just set up a Niagara effect that spawns a particle at each vertex and sets its color by sampling the mesh vertex color.

This is easier, but hits performance hard.

Not really? I suppose it depends on the number of vertices but if you use an opaque/masked particle the performance cost should be pretty minimal

It really does, I’m running a 3070ti and having 3million mesh replicated particles dancing around reduces my frames to around 60-80fps. Using masked materials too, and opaque. The problem is also the initializing part where unreal slows to a crawl at around 12fps for a few seconds then jumps back up.

I’m trying to find workarounds but realistically in my scene I’ll be needing 15-20million of these and distance culling doesn’t seem to help at all lol

Yes, if you try to do this on a mesh with many millions of triangles you’re going to run into performance problems. Not really much of a surprise there.