Impostors broken

I’ve run into and fixed this, so I’ll try to explain. It’s been a while since I worked on it so my memory is a bit foggy but I’ll do my best.

The primary issue is that painted foliage doesn’t play nicely with WorldToLocal and LocalToWorld transforms in ThreeFrameBlend, so the fix is to use tangent space instead. (Apparently the quality is a little lower but I don’t see a difference)

Here’s a picture of one such change - the local to world is no longer wired up and instead it uses tangent space transforms.

As you can see in the first picture, there is a comment there about scale. To get the scale to work I multiplied by ObjectScale X in a couple places. There were a few places where “DefaultMeshSize” was used and in those places I multiplied Default Mesh Size by ObjectScale X instead of using DefaultMeshSize as is. (There are 3 such instances in my ThreeFrameBlend)

In that first picture you can see that I multiply the Tangent Space Transform node by Object Scale X as well - that’s the only place I use Object Scale as a multiplier for the tangent. So I have 4 uses of Object Scale total - 3 that multiply the three uses of “Default Mesh Size” and the one in that first picture. I can’t remember why I needed that one in the first picture but…I did. I think because it was transforming world to tangent to world again, which lost the scale, and the other tangent-transform related nodes are just transforming from world to tangent or a normal-type vector from tangent to world so the scale doesn’t matter…or something like that. (Again…been a while…)

Also there are a couple different octohedral impostor things online - I’m not sure if mine is a modified version of Ryan Brucks’ or of the other one you can find around, but I don’t think the ThreeFrameBlend is very different in either.

TL;DR:

  1. Use Tangent To World and World To Tangent transforms instead of Local to World and World to Local
  2. Multiply by Object Scale in a few places since tangent transforms don’t handle scale the same way world → local → world does

I don’t remember having to change anything other than ThreeFrameBlend - I made some other changes to support things like color variation in my version, but I think the scale / rotation problems were just in ThreeFrameBlend.

Hope that helps.

3 Likes