Jump to content

Imposter/billboard Scaling in NodeReferences


photo

Recommended Posts

I'm using an ObjectBillboard Imposter as the last LOD level for distant rendering of an object.  For example I have an LOD0 object, an LOD1 object, and an Imposter for distant view, all 3 of which are child objects parented to one master dummy node. This is saved as a NodeReference and placed where needed around my terrain.  This works great when the NodeReference is scaled at 1.0, however if I want to selectively scale a particular node reference at a different size the Billboard/imposter object ignores the parent scale. 

I can break the NodeReference link and manually scale the imposter under the "billboard" settings, BUT that defeats the benefit of setting up a NodeReference as I want to use many instances of the same object but retain the ability to scale them when needed.

I would like a setting that allows the billboard to be scaled automatically relative to the parent scaling, similar to how other child node objects inherit the scaling of the parent.

Or perhaps you have a better solution for this?  I looked into Mesh Clusters, but then did not see a way to add LODs or Imposters to these, other than running the Imposter Creator directly on the MeshCluster object (which would need to be done every time a cluster sub-object is changed or added).

Link to comment
54 minutes ago, TanukiDigital said:

I can break the NodeReference link and manually scale the imposter under the "billboard" settings, BUT that defeats the benefit of setting up a NodeReference as I want to use many instances of the same object but retain the ability to scale them when needed.

Hello! what do you mean by "break the NodeReference link "? you can modify each instance of NodeReference without any affect on other instances. 
Billboard ignore scale of parent objects because it can not be scaled by x or y. 

You can try to write component and assign it to billboard witch will check scale of parent object and translate it into billboard width/height. 
something like 

void update()
{
	NodePtr parent = billboard->getParent();
	if (parent)
	{
		vec3 scale = parent->getScale();
		billboard->setWidth(scale.x); // or scale.y ?? 
		billboard->setHeight(scale.z);
	}
}

 

  • Like 1
Link to comment
46 minutes ago, cash-metall said:

...you can modify each instance of NodeReference without any affect on other instances.

Thank you for the reply!  And yes, I could do so, but it's an extra step I was hoping to avoid.  It means manually adjusting the height/scale and y-offset of each billboard once set in place, which can get tedious very quickly.

The code you provided (thank you!) sounds like a nice solution for a small number of instances, but I assume this would quickly get expensive running such an update loop on a large number of objects.  I could write it to run on a pool of objects of course, and I can make such adjustments to my workflow if necessary.

But from a useability and creative-control perspective both these solutions just seem to be poor workarounds for something that should, perhaps, be re-thought for future updates.  I'm sure there is a reason billboards were programmed this way, but not being able to scale them directly seems really inconsistent, and in this particular case introduces a useability problem.

 

Link to comment
×
×
  • Create New...