Project vertices on surface, make a shape

Hi all,

I am trying to implement a sort of decal system for projecting very simple 2d figures onto other surfaces.
If I understand correctly, the most indicated way to do this is with rendertextures, but I don’t have the Pro version, and I was looking for an alternative, even if it’s resource intensive, inefficient, and whatnot, since performance is not an issue.

So let’s think of a sample case: I have a mesh of a five pointed star, and I need to project that onto the terrain, from Vector3.Up

The “easy” part is raycasting all points down to ground, and actually “projecting” the mesh, but this is frequently a bad approach since projecting on a cone or other bumped surfaces will correctly deploy the vertices of the star, but the star’s surface would not adapt to the geometry.

Sadly, projectors don’t seem to accomodate a mesh as the cookie source, so I don’t know which way to go from here.

I thought about shaders for a second, but I’m illiterate in the field so I don’t really know what can be done in that direction.

Any advice is welcome.

Presumably your mesh is going to deform in some unusual way? Because if it was just rotating and scaling you’d be able to make a star texture offline and rotate/scale the projector.

If it’s deforming in a consistent way, and memory is no object, you could render off the deformation into a texture atlas and have the projector project the animation by adjusting the UVs.

Otherwise you may have to roll your own projector, but that will probably take days to do and weeks to iron the bugs out of :confused: