- Home /
My meshes arent loading properly.
I have a script that puts meshes onto chunks of blocks, it works perfectly fine until I increase the number of chunks or the height variation. Then the meshes disappear in lines, turn black, or large chunks of meshes just disappear. I have checked my RAM and it works fine, I have a 2080 ti and ryzen 3700x so my problem isn't hardware.
https://cdn.discordapp.com/attachments/642141918532337702/960047367904702494/unknown.png https://cdn.discordapp.com/attachments/642141918532337702/960054054199906344/unknown.png https://cdn.discordapp.com/attachments/642141918532337702/960054140002775060/unknown.png
edit: I have done some extra testing, and this bug occurs only when the height variation of the terrain is set to a large number, even on smaller scales, I tested it on one chunk and it still did this.
https://cdn.discordapp.com/attachments/642141918532337702/960207111978106970/unknown.png
edit: I have added a few videos.
Answer by Bunny83 · Apr 03 at 04:23 PM
Well we can barely see anything in those images and what the issue actually is. Though if you're just missing triangles you may have missed to set the indexbuffer format.
By default Unity uses a 16 bit index buffer and in the past this was the only index format it supported. Though you can now set the index buffer to 32 bit. A 16 bit index buffer only supports vertex indices up to 65k (so you can only have 65k vertices). You can have as many triangles you like as long as you don't have more than 65k vertices. With a 32 bit index buffer you can now address indices up to 2 billion.
Make sure you set the indexFormat before you start filling any mesh data.
I will try this but I have just created another generation, this one is 2500 chunks. Each chunk being 16*16. I would assume this would trigger it as well, but it looks just find and works perfectly. The other one only has one chunk.
Your answer
Follow this Question
Related Questions
Why zero height mesh gets black independent of shader 1 Answer
Bounds of dynamic mesh not updating 1 Answer
Apply Generated Texture to Mesh 1 Answer
Color not being applied properly to mesh 0 Answers
Getting mesh material length 1 Answer