Skip to content

Triangulate causing missing triangles?  #18

@blitz-research

Description

@blitz-research

Hi,

Trianglulate used on this file appears to be causing triangles to go missing:

https://murena.io/s/Z6MSrKkCf2Mr72Y

Screenshot showing some of the missing triangles outlined in red here:

triangulate_bug

If I skip the triangulate step and do my own simple triangulate while loading (which effectively just treats all faces like a triangle fan), everything loads correctly.

[edit]
Ok, it looks like triangulate is flipping some triangles. If I force the material to be double sided, the missing triangles re-appear.

Changing lines 6983-ish to this (which basically just duplicates my loader code) fixes the problem with this model:

		dst->indices[idst + 0] = index0;
		dst->indices[idst + 1] = index1;
		dst->indices[idst + 2] = index2; // d02_is_less ? index2 : index3;
		dst->indices[idst + 3] = index0; // d02_is_less ? index0 : index1;
		dst->indices[idst + 4] = index2;
		dst->indices[idst + 5] = index3;

Not sure what d02_is_less is supposed to do though so probably not that simple.
[/edit]

Bye,
Mark

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions