Download

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.