Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Size of vertex data provided (*) does not match expected (*) #83083

Closed
theraot opened this issue Oct 10, 2023 · 1 comment · Fixed by #83100
Closed

Error: Size of vertex data provided (*) does not match expected (*) #83083

theraot opened this issue Oct 10, 2023 · 1 comment · Fixed by #83100

Comments

@theraot
Copy link
Contributor

theraot commented Oct 10, 2023

Godot version

v4.2.dev.custom_build [6b727eb] (master at the time of writing)

System information

Godot v4.2.dev (6b727eb) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (NVIDIA; 31.0.15.3742) - Intel(R) Core(TM) i3-6100 CPU @ 3.70GHz (4 Threads)

Issue description

Using an ImmediateMesh, and setting normals with surface_set_normal, results in error of the form:

Size of vertex data provided (#) does not match expected (##)

Where the # symbols represent numbers, such that # is lower than ##, the actual numbers depend on what other information is being passed about the vertex.

Examples of errors:

  • The error where I discovered it:

    Size of vertex data provided (72) does not match expected (120)

  • The error on the minimal reproduction project:

    Size of vertex data provided (36) does not match expected (48)

Note: v4.2.dev6.official [57a6813] is not affected.

Steps to reproduce

Add the following code to a MeshInstance and execute the scene:

extends MeshInstance3D


var _immediate_mesh:ImmediateMesh


func _ready() -> void:
	_immediate_mesh = ImmediateMesh.new()
	mesh = _immediate_mesh



func _process(_delta: float) -> void:
	_immediate_mesh.clear_surfaces()
	_immediate_mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLES)
	_immediate_mesh.surface_set_normal(Vector3(0, 1, 0))
	_immediate_mesh.surface_add_vertex(Vector3(0, 0, 0))
	_immediate_mesh.surface_add_vertex(Vector3(0, 0, 1))
	_immediate_mesh.surface_add_vertex(Vector3(1, 0, 1))
	_immediate_mesh.surface_end()

Minimal reproduction project

TesIMesh.zip

@theraot
Copy link
Contributor Author

theraot commented Oct 10, 2023

This happens in Forward +, Mobile, and Compatibility, which suggest it is an issue on the mesh creation side, not the rendering side. And looking at git blame suggest this might have been introduced by #81138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants