OPTIMIZE_KEEP_UV / OPTIMIZE_PROTECT_UV / OPTIMIZE_EXCLUDE_UV meaning

Question and answer about Polygon Cruncher SDK
Post Reply
mootools
Site Admin
Posts: 282
Joined: Thu Jul 05, 2007 11:06 am
Contact:

OPTIMIZE_KEEP_UV / OPTIMIZE_PROTECT_UV / OPTIMIZE_EXCLUDE_UV meaning

Post by mootools » Mon Nov 06, 2017 12:15 pm

The optimizer proposes different ways to handle the CUVWChannel sets you might provide with you mesh.
These different methods are the following:

Code: Select all

       // Keep uv is on. If not defined, UV are removed
       // OPTIMIZE_PROTECT_UV/OPTIMIZE_KEEP_UV are optional, if none used then
       // UV are optimized with minimal take care of them (something like OPTIMIZE_PRESERVE_UV)
       OPTIMIZE_KEEP_UV = 0x400,
       OPTIMIZE_PROTECT_UV = 0x800,
       OPTIMIZE_EXCLUDE_UV = 0x1000,
       OPTIMIZE_UV_MASK = (OPTIMIZE_PROTECT_UV|OPTIMIZE_EXCLUDE_UV),
First of all, If you want to keep the uv provided with your mesh (through CUVWChannel) you have to specify OPTIMIZE_KEEP_UV.
Without that flag, UVs are ignored during optimization process.

if your mesh does not have UVs seams, there is no real difference between these modes.
Note that an UV seams exists when you have different UVs value falling at the same geometric point.
This might occur when you have a break between different texture along an edge for example.

Saying that:

OPTIMIZE_KEEP_UV used alone keeps the UVs along the optimization process.
There is a minimal care of UV seams, and the flag is perfect if your mesh does not have such seams.

OPTIMIZE_PROTECT_UV will protect UV seams as long as it is possible.
If the specified required optimization ratio is too high, there might be seam losses.

OPTIMIZE_EXCLUDE_UV freezes UV seams, meaning that a point that has seams cannot be optimized.

One more important thing to know is that you can define a tolerance for detecting UV seams.
This is done through CSceneOptimizer::SetUVWTolerance.

Let's say you set the UVW tolerance to 0.0001. This means:

- the point has an an UV seams if the difference between 2 of its UVs is greater than 0.0001
- the point is not a seam if the difference between 2 of its UVs is lower than 0.0001

Only point that are on a seams are affected by OPTIMIZE_PROTECT_UV or OPTIMIZE_KEEP_UV

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest