- Home /
Question by
gkadamopoulos · Jun 29, 2020 at 10:58 AM ·
webglchromeinstancing
WebGL and Chrome instancing Color Problem
Hello some months ago after updating chrome the colors on instanced materials are meshed up while on firefox for example everything is fine
the DrawMeshInstanced is used to draw all the objects on screen
int total = width * depth;
int batches = (int)Mathf.Ceil(total / BATCH_MAX_FLOAT);
for (int i = 0; i < batches; ++i)
{
int batchCount = Mathf.Min(BATCH_MAX, total - (BATCH_MAX * i));
int start = Mathf.Max(0, (i - 1) * BATCH_MAX);
Matrix4x4[] batchedMatrices = GetBatchedMatrices(start, batchCount);
Vector4[] batchedColorArray = GetBatchedArray(start, batchCount);
propertyBlock.SetVectorArray("_Color", batchedColorArray);
Graphics.DrawMeshInstanced(mMeshFilter.sharedMesh, 0, meshMaterial, batchedMatrices, batchCount, propertyBlock);
}
the expected result is the same n editor and native windows build
the problem exists also in previous itarations of the project so I know it is not my error but rather chrome rendering engine
PS. for some reason I cannot upload photos
Comment
Your answer
Follow this Question
Related Questions
GL build won't run on Chrome 1 Answer
Unity WebGL not playing in Chrome 1 Answer
Unity WebGL Problem 0 Answers