UVs for a flipping billboard animation

Ask questions about how to do XY using MOPs
Post Reply
polimpiado
Posts: 2
Joined: Thu Jan 31, 2019 6:00 am

UVs for a flipping billboard animation

Post by polimpiado » Thu Jan 31, 2019 6:40 am

I am trying to make a flipping billboard

Like this:

Image

Instancing and animating a prism shape in MOPs is very easy and great. The question is how can I get proper UVs on the 3 different sides of the prism?The UVs would need to be added after the MOPs instancer but before the falloff and transformation but this is not possible without converting to primitives...

Is there something I am missing or is this a constraint of MOPs?

User avatar
toadstorm
Site Admin
Posts: 154
Joined: Mon Jun 04, 2018 2:16 pm
Contact:

Re: UVs for a flipping billboard animation

Post by toadstorm » Thu Jan 31, 2019 9:01 pm

The most straightforward solution is to unpack the instanced geo, project UVs, and then re-pack as packed fragments before handling the transformations (MOPs Convert should be able to handle this). There might be a trickier way to handle this by using a custom Mantra shader, but I'm not sure it's worth the time to figure out when the unpack > project > repack as fragments workflow is fairly quick to calculate with such simple geometry.

I'm attaching an example file here. There's a couple of gotchas... first, the material assignments are happening BEFORE the geometry is ever instanced, since it's a per-face material assignment, and because of this you need to make sure that the Mantra ROP is set to "Save All Materials" under Rendering > Render. This is because materials that live inside a packed object aren't by default added to the IFD if nothing else in the scene references them. (The alternative would be to use stylesheets.) Second, each material needs to know what uv set to use for the diffuse texture, so the textures are manually connected to the diff_clr inputs of the Classic Shaders rather than using the built-in texture inputs. You could likely find a clever way to combine all of this into a single material using a Switch VOP and some point/prim attributes, but this works for the example anyways.
Attachments
mops_multiple_uvs.zip
(85.62 KiB) Downloaded 8 times

polimpiado
Posts: 2
Joined: Thu Jan 31, 2019 6:00 am

Re: UVs for a flipping billboard animation

Post by polimpiado » Thu Jan 31, 2019 9:02 pm

Awesome thanks I take a look

Post Reply