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

TestFailure: TestMergePositionsMultipleGeometries - Index was outside the bounds of the array. #8140

Open
2 tasks done
SimonDarksideJ opened this issue Jan 28, 2024 · 1 comment

Comments

@SimonDarksideJ
Copy link
Contributor

Prerequisites

  • I have verified this issue is present in the develop branch
  • I have searched open and closed issues to ensure it has not already been reported.

MonoGame Version

Develop

Which MonoGame platform are you using?

N/A

Operating System

ALl

Description

The function MeshHelper.CalculateNormals has an issue in generating the Normals for models, resulting in a failed Unit Test in the MonoGame.Tools solution.

image

The issue relates in to the creation of a VertextChannel array for the Geometry normals (Line 130 - MeshHelper)

Steps to Reproduce

  • Clone the MonoGame repository - develop
  • Open the MonoGame.Tools. solution
  • Run the Unit Tests
  • Observe the failure of the TestMergePositionsMultipleGeometries test
    (Run in Bebug to see the specific failure)

Minimal Example Repo

No response

Expected Behavior

MeshHelper.CalculateNormals should complete successfully

Resulting Behavior

TestMergePositionsMultipleGeometries test failure

Files

No response

@SimonDarksideJ SimonDarksideJ changed the title TestFailutr: TestMergePositionsMultipleGeometries - Index was outside the bounds of the array. TestFailure: TestMergePositionsMultipleGeometries - Index was outside the bounds of the array. Jan 28, 2024
@SimonDarksideJ
Copy link
Contributor Author

SimonDarksideJ commented Jan 29, 2024

You can test further by updating the MathHelper.CalculateTangentFrames and changing the Normals check from a Return (skip processing missing normals) to the commented-out line MeshHelper.CalculateNormals(geom, true); (Generate missing normals)

//MeshHelper.CalculateNormals(geom, true);

This is then tested by the newer MissingNormalsTestCustom test, which has a model that includes Normals and is missing normals on some geometry.

public void MissingNormalsTestCustom()

The test fails if you attempt to use the CalculateNormals method to regenerate the missing ones.

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

No branches or pull requests

2 participants