Reduce the number of vertices generated by GenerateFacetedSculptMesh()

Description

The current implementation for GenerateFacetedSculptMesh() itterates the triangle list and generates a new vertices for every point, so you always end up with 3 x more vertices than triangles. For a single face, many of these vertices will be shared and have equal position, UV and normal so inspired by the code in GenerateFacetedMesh() I've added a simple filter to reuse vertices where possible, this drops a test scuplt of mine from 6144 vertices to 1089 vertices. This will have a knock on effect on memory usage etc.

Attached is a patch that appears to work on the sculpts i've tested on, but i can't see why it would fail badly.

Steps to Reproduce

None

Activity

Show:
Latif Khalifa
June 25, 2011, 9:56 PM

Patch applied, thanks!

Assignee

Unassigned

Reporter

Robin Cornelius

Labels

None

Environment

All

Fixed in Revision

None

Components

Fix versions

Priority

Minor
Configure