You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got an error: 'Attempting to create a zero length compute buffer' on the line _trsBuffer = new ComputeBuffer(_trueInstanceCount, sizeof(float) * 4 * 4);
which then breaks and fails to initialize the _visibleBuffer
maybe I have set the values wrong?
I'm using approach 5: occlusion culling + high performance. Here's my settings.
My terrain size is 512x512.
Unity version: 2022.3.23f1
URP version: 14.0.10
The text was updated successfully, but these errors were encountered:
This happens because _trueInstanceCount variable is 0 after the instances have been initialized. Meaning that the conditions for creating all instances failed.
These are the conditions for skipping a possible instance:
The grass is to small and below minGrassHeight - which it can't be since you've set the height to be 1 and min height to 0.15.
The grass color is lower than grassThreshhold. The color is defined via the red channel of the Splatmap. You can see that I'm setting the texure value to the first element in the alphamapTextures array see hereand here
So it could be and issue with your terrain layers (maybe try change the order) or the grassThreshhold slider value. Also try to increase the instances to something higher. This increases the chance for instances to be created.
Another thing I noticed: the instancer should have the same size as the terrain be placed in the middle of it but from your screenshot it looks like you're using multiple instancers (?). The approach isn't suited for that, so try it with a single one first.
I'm working on publishing a new approach that is able to handle this though.
first of all, thanks for this code!
I got an error: 'Attempting to create a zero length compute buffer' on the line

_trsBuffer = new ComputeBuffer(_trueInstanceCount, sizeof(float) * 4 * 4);
which then breaks and fails to initialize the
_visibleBuffer
maybe I have set the values wrong?
I'm using approach 5: occlusion culling + high performance. Here's my settings.

My terrain size is 512x512.

Unity version: 2022.3.23f1
URP version: 14.0.10
The text was updated successfully, but these errors were encountered: