Hardware-Instancing Mesh scale issue

Considering my Grass prototype project, I’m experimenting with Hardware Instancing to generate grass fields. Upon declaring which asset mesh to use and scale, the mesh always initiates larger than expected.

Here is the issue visualized (Grass mesh upscaled):

This causes the mesh to appear like shown:

This briefly shows the suspected look, with type “box” in place of the target type “asset”. I enlarged the ‘instanceCount’ value as well.

RED ) Using procedural generation to spawn a grassEntity.clone() along a grid with a shader on each instance. (Bad performance yet Proper Mesh)

BLUE ) Hardware instancing, using render component with ‘box’ type; replace with grass mesh. (Ideal performance yet missing Proper Mesh)

I even tried simpler, smaller scaled meshes, and 0 scale code with no luck. Each mesh loads the same scale as shown in first image. Is this a common thing, or is there some other setup I’m missing?

Hi @khaelou,

I think I had similar issues with hardware instancing and I’ve tracked them down into the internal node of the mesh instance that is being used.

With hardware instancing you need to either take it into account, or prepare your model so it’s zeroed (and scale to 1).

If that the case with your issue, you can fix it in Blender. For example here is your grass mesh transform:

You can select the object, press Ctrl + A and select All transforms:

3 Likes

Hmm you dug a bit deeper.

Nice find, I’ll look into this!

1 Like