Godot: Meshes without index array spam errors

Created on 14 Apr 2018  路  6Comments  路  Source: godotengine/godot

Godot version:

3.0.2

OS/device including version:

Win 7 x64 bit
Radeon 6630M

Issue description:

Getting spammed with drivers\gles3\rasterizer_storage_gles3.cpp:3265 - Condition ' surface->index_array_len == 0 ' is true. returned: PoolVector()

I tracked it down to https://github.com/godotengine/godot/blob/e7445c3d82b60eae2d02e201d21990f0aac096ae/drivers/gles3/rasterizer_storage_gles3.cpp#L3266

(I use procedural meshes and then use node.create_convex_collision() to make collisions. Everything works ok but I get spammed with 200+ errors on game start :( )

Steps to reproduce:
Add a Mesh Instance node containing a Quad Mesh, add a script that does node.create_convex_collision() or node.create_debug_tangents()

Minimal reproduction project:

If really needed, I could add one tomorrow, but given it reproduces easily, well...

bug rendering

Most helpful comment

As mentioned here, this issue goes away if SurfaceTool.index() is called.

Perhaps it would be best if SurfaceTool.commit() also called .index()?

All 6 comments

Note: the collision works, it's even displayed in when collision display is on, the only problem is that the error message shows up. (So I don't think it's a rendering problem - the function works so maybe downgrade the message from error to warning?)

Ok, I take that back - the error is spammed also during game, probably when rendering quads. It's the reason I have a persistent stutter every few seconds (every time the error gets spammed).

I hadn't noticed it earlier because I wasn't looking at the output during gameplay, just during set up.

So even more reason to muzzle this, the functions work, the quads are displayed properly, it's just an annoyance.

I am getting the same error, and as @Zireael07 I get the meshes drawn anyways.

The mesh is generated from a heightmap image, and I subdivide the generation into subsets (usually 4x4 meshes from the heightmap).
I am using SurfaceTool, specifically, for each pixel of the heightmap (it's not the full code, but the main parts, I can provide a simple example):

surf_tool.begin(Mesh.PRIMITIVE_TRIANGLES)
surf_tool.add_color(bl_color)
surf_tool.add_vertex(bottomleft)

surf_tool.add_color(br_color)
surf_tool.add_vertex(bottomright)

surf_tool.add_color(ul_color)
surf_tool.add_vertex(upperleft)

surf_tool.add_color(br_color)
surf_tool.add_vertex(bottomright)

surf_tool.add_color(ur_color)
surf_tool.add_vertex(upperright)

surf_tool.add_color(ul_color)
surf_tool.add_vertex(upperleft)

surf_tool.generate_normals()
var material = ResourceLoader.load("res://materia.tres")
surf_tool.set_material(material)
var mesh = surf_tool.commit()
$TerrainMesh.mesh = mesh

Appearently when generating the last of each row (or maybe just the last of the last row), I get this error message:

drivers\gles3\rasterizer_storage_gles3.cpp:3265`` - Condition ' surface->index_array_len == 0 ' is true. returned: PoolVector<uint8_t>()
 editor\plugins\spatial_editor_plugin.cpp:394 - Bug?
 editor\plugins\spatial_editor_plugin.cpp:394 - Bug?

I am quite sure that there is something wrong in my code, maybe the last column's triangles are not drawn completely (so just a line).

No, your code looks ok and is almost a perfect copy of my code.

As I said, placing a built-in Quad Mesh also triggers the error, so it's not something unique to generating meshes in editor.

Yeah, getting this too. I understand why it was made to warn you, but it'd be better if the error is only thrown when indexes are actively used, rather than in geometry that is only using vertex data directly, and works 100% fine for both mesh rendering, collision, etc.

As mentioned here, this issue goes away if SurfaceTool.index() is called.

Perhaps it would be best if SurfaceTool.commit() also called .index()?

Was this page helpful?
0 / 5 - 0 ratings