Need help getting a billboard-like behavior for a poly arc ribbon

I’ve been failing to do it by myself.

I want to create a script that will allow for a single-poly wide ribbon to rotate its transversal edges towards the camera. Almost like a billboard, but with some warping. I’m hoping that this can be done in C# and not require a vertex shader graph, since I’m already using a “curved world” one for all my materials, but I can modify it for these objects if necessary.

To specify, if the local Z axis of each of these edges was aligned with the immediate direction of the ribbon’s arc, that edge would rotate along that axis until its normal (or its attached quads’ normals) were pointed at the camera.

The attached image shows what I’m trying to do. The three arcs are the same: it’s only the transversal edges that are rotated. The upper-right corner shows the same scene from a different angle. The edges highlighted in orange are the ones that would be affected (so to speak).

The ribbons will have a lightning texture and be pre-made in various sizes, lengths, arcs and lines. I’m not expecting for someone to do my work for me. I’d be grateful to be pointed in the right direction. In exchange for the help I’ll post the full solution here once I have it.

Any ideas?

I’m not sure but it feels like you’re describing the default functioning of the LineRenderer… have you tried playing with that?? It has a couple of billboarding modes but the basic one might be what you want… and you can “bake” the mesh off of it too.

Otherwise if you want some examples of procgen stuff, I keep a bunch or random stuff in my MakeGeo project.

MakeGeo is presently hosted at these locations:

https://bitbucket.org/kurtdekker/makegeo

It was that easy, huh? Thanks for the answer.

You’re welcome! Your lightning looks awesome btw, that bloom really brings out the crackle!

And yes, line renderers are awesome as long as you stay within their assumptions.

Here’s my little blue crackles on the solar panels at an outlying remote antenna installation in my mobile / TV Jetpack Kurt Space Flight game:

They dance around from solar panel to solar panel, sometimes dancing around the edges, jumping between, etc. It’s just a bunch of invisible transforms marking potential anchor points and some code to slew the LR around.