Skip to content

Latest commit

 

History

History
740 lines (492 loc) · 17.2 KB

File metadata and controls

740 lines (492 loc) · 17.2 KB

Problem B

Perception-Aware Lossless Simplification of Million-Vertex 3D Meshes for Mobile Platforms

Business Background & Competition Overview

Balancing geometric complexity and visual fidelity is a core technical challenge for mobile 3D development, digital twin, and other scenarios with strict real-time rendering performance requirements.

In this competition, participants are required to compress high-complexity original high-poly meshes with millions of vertices as aggressively as possible — using as few vertices as they can — while keeping the result visually faithful to the original and maintaining complete basic topological structure.

Different from traditional geometry-deviation-oriented algorithms, this competition emphasizes perception-driven optimization. Participants shall adopt perceptual metrics, such as pixel-level rendering consistency and visual saliency features, to ensure that the simplified mesh achieves visually indistinguishable effects from the original high-poly model in light-shadow performance, contour edges, and key details.


System Model: Standardized Virtual Photography Evaluator

To quantitatively measure the visual consistency between the simplified mesh $M_s$ and the original high-poly mesh $M_o$, the system integrates an offline rendering pipeline.

Centered on the mesh origin, the evaluator places virtual cameras along six positive/negative axial directions in the 3D Cartesian coordinate system to build a multi-view sampling space.


Camera Placement & View Indexing

For each view $i$, the camera viewpoint $C_i$ is defined as:

$$ C_i = D \cdot a_i $$

where

$$ a_i \in {(1,0,0), (-1,0,0), (0,1,0), (0,-1,0), (0,0,1), (0,0,-1)}. $$

Here:

  • $D$ is the fixed observation distance.
  • $D = 2.5$ model units.
  • Cameras face the mesh origin from the positive/negative directions of the $x$, $y$, and $z$ axes respectively.

The input mesh is given pre-normalized, as described in the Input section: it is centered at the origin and scaled to lie within the unit sphere,

$$ |v|_2 \le 1. $$

The evaluator renders these coordinates directly at distance $D$, with no further scaling or recentering, so the fixed camera always frames the model identically.

From each view, the system renders 3D geometric data into two types of feature images for subsequent similarity scoring.


Multi-dimensional Visual Feature Extraction

The system generates feature maps from light-shadow and geometric morphology dimensions to calculate SSIM, that is, Structural Similarity Index Measure.


Normal Map: Capturing Light-shadow Undulation

Surface normal determines light reflection effect.

The evaluator uses flat shading: each triangular face has a single unit normal, and every pixel covered by that face is assigned this same face normal. Normals are not interpolated across the face, because the input provides no per-vertex normals.

The normal is mapped to RGB color values:

$$ \operatorname{RGB}(p) = 127.5 \cdot \left(n(p) + (1,1,1)\right) $$

where:

  • $n(p)$ is the unit normal of the triangular face covering pixel $p$.
  • $n(p)$ is constant across that face.
  • Each component of $n(p)$ ranges from $-1$ to $1$.
  • Adding $(1,1,1)$ normalizes the range to $[0,2]$.
  • Multiplication by $127.5$ remaps values to $[0,255]$ to generate standard RGB pixel values.

Depth Map: Capturing Contour Morphology

This map records the depth value $z(p)$, namely the distance along the camera’s viewing axis, at each pixel.

For any pixel $p$ inside a triangular face, the depth is obtained by perspective-correct interpolation of the three vertex depth values.

Let the three vertex depths be

$$ z_1, z_2, z_3. $$

Then the reciprocal depth $1/z$ is interpolated linearly in screen space using barycentric coordinates.

The purpose of the depth map is to monitor mesh volume shrinkage and contour aliasing, ensuring consistent occlusion relationships and edge silhouettes between the simplified and original meshes.


Attribute Sampling: Mapping 3D Geometry to 2D Pixels

To generate the above feature maps, the system builds a precise mapping from 3D space to 2D pixel arrays, including two core steps:

  1. Spatial projection.
  2. Attribute interpolation.

Perspective Projection Formula

The camera is placed at the origin facing the negative $z$-axis, following the OpenGL standard.

For any 3D vertex

$$ P_c = (X_c, Y_c, Z_c) $$

of the mesh in camera space, the projected 2D screen pixel coordinate $(u,v)$ is calculated as follows:

$$ u = f \cdot \frac{X_c}{-Z_c} + c_x $$

$$ v = f \cdot \frac{Y_c}{-Z_c} + c_y $$

where:

  • $(X_c,Y_c,Z_c)$ are 3D coordinates in camera space.
  • The camera is treated as the origin.
  • The camera looks along the negative $z$-axis.
  • $f$ is the virtual camera focal length in pixel units.
  • $f = 800.0$ px.
  • $(c_x,c_y)$ is the image principal point offset.
  • $(c_x,c_y)$ equals half the feature map width and height, so that the projected mesh is centered.
  • $(u,v)$ is the floating-point pixel index on the feature map, which is subsequently rasterized to discrete grid pixels.

Attribute Interpolation: Barycentric Coordinate Method

After confirming which triangle contains pixel $p$, the system assigns its attributes.

The normal is the covering face’s flat normal, so it needs no interpolation.

The depth is interpolated from the three vertex depths $z_1,z_2,z_3$ using barycentric coordinates as weights.

For pixel $p$, the weight coefficients $\lambda_1,\lambda_2,\lambda_3$ satisfy:

$$ p = \lambda_1 p_1 + \lambda_2 p_2 + \lambda_3 p_3 $$

$$ \lambda_1 + \lambda_2 + \lambda_3 = 1 $$

where:

  • $p_1,p_2,p_3$ are the 2D screen coordinates of the three projected triangle vertices.
  • $\lambda_i$ represents the contribution of vertex $i$ to pixel $p$.

Based on these barycentric weights, the per-pixel depth is interpolated perspective-correctly. The quantity linear in screen space is the reciprocal $1/z$, not $z$ itself:

$$ \frac{1}{z(p)}

\lambda_1 \frac{1}{z_1} + \lambda_2 \frac{1}{z_2} + \lambda_3 \frac{1}{z_3}. $$

Therefore,

$$ z(p)

\frac{1}{ \lambda_1 / z_1 + \lambda_2 / z_2 + \lambda_3 / z_3 }. $$

The face normal is constant over the triangle and is written directly, with no interpolation.


Definition of Feature Maps

Feature maps are the two types of 3D-rendered 2D images defined above, serving as the direct inputs for SSIM evaluation.

Normal Map

The normal map stores surface normal direction mapped to RGB color, for light-shadow quality evaluation.

Depth Map

The depth map stores linear grayscale depth values, for contour and occlusion evaluation.

Each pixel is sampled once, at its center:

$$ (u + 0.5, v + 0.5). $$

It is covered by the nearest triangle whose projection contains that point and takes that triangle’s flat face normal and its perspective-correct interpolated depth.

Pixels covered by no triangle take the background values described below.


Background Pixel Attributes

Fixed background values are assigned to pixels with no triangular mesh intersection.

Normal Map Background

The background normal is

$$ n_{\mathrm{bg}} = (0,0,0), $$

which is mapped to neutral gray:

$$ \operatorname{RGB}_{\mathrm{bg}} = (127.5,127.5,127.5). $$

Depth Map Background

The background depth is

$$ z_{\mathrm{bg}} = 255. $$

This corresponds to the far plane depth value.


Fixed Evaluator Camera Parameters

Participants do not need to use the following camera parameters. However, they are provided to help in designing algorithms.

Parameter Symbol Value Description
Observation Distance $D$ $2.5$ Distance from camera to mesh origin, in model units
Focal Length $f$ $800.0$ px Controls projection scaling ratio
Background Depth $z_{\mathrm{bg}}$ $255$ Far clipping plane depth value
Background Normal $n_{\mathrm{bg}}$ $(0,0,0)$ Background normal vector mapped to neutral gray

The fixed feature map resolution is

$$ W \times H = \text{TODO}, $$

and the principal point is located at the image center:

$$ (c_x,c_y) = \left(\frac{W}{2}, \frac{H}{2}\right). $$


Constraints

Submitted simplified meshes must satisfy the following constraints. If they do not, the submission will receive Wrong Answer and the violated constraint will be reported.


Mesh Validity Constraint

The simplified mesh must satisfy the following conditions:

  • Vertex count:

$$ 1 \le |V_s| \le |V_o|. $$

A submission with

$$ |V_s| = 0 $$

or

$$ |V_s| > |V_o| $$

is rejected.

  • Manifold mesh: each edge is shared by exactly two triangular faces. The mesh must be a closed, watertight 2-manifold.
  • Non-degenerate faces: all triangular faces have positive area.
  • Valid indices: all face indices are within the vertex array range.

Geometric Deviation Constraint

The symmetric Hausdorff distance between the original mesh $M_o$ and the simplified mesh $M_s$ must satisfy:

$$ d_H(M_o,M_s) \le 0.05 \cdot L_{\mathrm{AABB}}. $$

The symmetric Hausdorff distance is defined as:

$$ d_H(M_o,M_s) = \max{ d(M_o,M_s), d(M_s,M_o) }, $$

where $d(A,B)$ is the one-way distance from mesh $A$ to mesh $B$.

The first direction requires every original vertex to remain covered by the simplification. The second direction forbids simplified vertices from straying away from the original surface.

Let the original vertex bounds be

$$ p_{\min} = (x_{\min},y_{\min},z_{\min}) $$

and

$$ p_{\max} = (x_{\max},y_{\max},z_{\max}). $$

The AABB edge lengths are:

$$ \Delta x = x_{\max} - x_{\min}, $$

$$ \Delta y = y_{\max} - y_{\min}, $$

$$ \Delta z = z_{\max} - z_{\min}. $$

The diagonal length is defined as:

$$ L_{\mathrm{AABB}}=

\sqrt{ (\Delta x)^2 + (\Delta y)^2 + (\Delta z)^2 }. $$

This normalization limits Hausdorff tolerance to 5% of mesh size, independent of original mesh scale.


Optimization Objective

Subject to the constraints above, participants shall minimize the vertex count of the simplified mesh, equivalently maximizing the compression rate defined in the ranking rules.

A submission is valid only if its multi-view perceptual score stays at or above the threshold $T$:

$$ \mathrm{Score}(M_o,M_s) \ge T. $$

The score is defined as:

$$ \mathrm{Score}(M_o,M_s)=

\frac{1}{6} \sum_{i=1}^{6} \left( w_N \cdot \operatorname{SSIM} \left( N_i^{o}, N_i^{s} \right) + w_D \cdot \operatorname{SSIM} \left( D_i^{o}, D_i^{s} \right) \right). $$

where:

  • $i$ is the view index, with a total of 6 axial views.
  • $N_i^{o}$ and $D_i^{o}$ are the normal map and depth map of the original mesh at view $i$.
  • $N_i^{s}$ and $D_i^{s}$ are the normal map and depth map of the simplified mesh at view $i$.
  • $\operatorname{SSIM}$ is the Structural Similarity Index function, with output range $[0,1]$.
  • A value of 1 represents full visual consistency.
  • $w_N$ is the weight coefficient of the normal map.
  • $w_D$ is the weight coefficient of the depth map.
  • The final score is the arithmetic mean score of six views.

SSIM Calculation Formula

For two input images $X$ and $Y$, SSIM is defined as:

$$ \operatorname{SSIM}(X,Y)

\frac{ (2\mu_X\mu_Y + C_1) (2\sigma_{XY} + C_2) }{ (\mu_X^2 + \mu_Y^2 + C_1) (\sigma_X^2 + \sigma_Y^2 + C_2) }. $$

where:

  • $\mu_X$ and $\mu_Y$ are mean pixel values inside a local sliding window.
  • $\sigma_X^2$ and $\sigma_Y^2$ are local pixel variances.
  • $\sigma_{XY}$ is local cross-covariance.
  • $C_1$ and $C_2$ are stabilization constants.

The constants are:

$$ C_1 = (K_1 L)^2, $$

$$ C_2 = (K_2 L)^2, $$

where:

$$ K_1 = 0.01, $$

$$ K_2 = 0.03, $$

and the 8-bit pixel dynamic range is

$$ L = 255. $$

The final image SSIM is the mean of the per-window SSIM values taken over the rendered foreground only.

A window is included when the original and/or simplified rendering is non-background at the window’s center pixel. Windows whose center pixel is the background value in both the original and the simplified rendering are excluded.

The same foreground-only averaging is applied to each channel of the normal map and to the depth map.

For RGB normal maps, SSIM is calculated on the three color channels respectively, then averaged for the final result.


Evaluation & Ranking Rules

Validity Threshold

A submission is valid only if its total score satisfies:

$$ \mathrm{Score}(M_o,M_s) \ge T. $$

Submissions below the threshold get 0 points and are excluded from ranking.


Ranking Criteria

The compression rate is defined as:

$$ \mathrm{CompressionRate}

1 - \frac{|V_s|}{|V_o|}, $$

where:

  • $|V_s|$ is the vertex count of the simplified mesh.
  • $|V_o|$ is the vertex count of the original mesh.

For all valid submissions, ranking priority is determined by simplified vertex count.

Filter valid meshes with:

$$ |V_s| < |V_o|. $$

If

$$ |V_s| = |V_o|, $$

then the score of this test case is 0.

For each test case, the score is the compression rate.

For all test cases, the final score is the average of the test-case scores.

Across all test cases, the vertex count is at most TODO, and the face count is at most TODO.

Per-test-case size bounds are listed in the table below.

Test Case Vertex Count Bound Face Count Bound
1, sample 10 15
2 5000 10000
3 25000 50000
4 40000 80000
5 50000 100000
6 400000 800000
7 1100000 2100000

Input

Input is read using standard input, stdin.

The input is a slightly modified version of the OBJ file format.

The first line of input contains the integers $n$ and $m$:

$$ n \quad m $$

where:

  • $n$ is the number of vertices.
  • $m$ is the number of faces.

The following $n$ lines each begin with the character v, followed by the real numbers $x$, $y$, $z$, the coordinates of a vertex:

v x y z

Each coordinate satisfies:

$$ -1 \le x,y,z \le 1, $$

and is given with at most TODO digits after the decimal point.

The mesh is pre-normalized:

  • Its axis-aligned bounding box is centered at the origin.
  • Therefore,

$$ x_{\min} + x_{\max} = 0, $$

and likewise for $y$ and $z$.

  • Every vertex lies within the unit sphere:

$$ x^2 + y^2 + z^2 \le 1. $$

The final $m$ lines each begin with the character f, followed by the integers $a$, $b$, $c$:

f a b c

where:

$$ 1 \le a,b,c \le n. $$

This means that there is a triangular face connecting the vertices numbered $a$, $b$, and $c$.

The input mesh is guaranteed to be a closed, watertight 2-manifold:

  • Every edge is shared by exactly two faces.
  • The surface is connected.
  • Every face is non-degenerate.
  • The three vertices of every face are distinct and span a positive area.
  • There are no duplicate vertices or duplicate faces.

Check the sample input file below for a precise example of the format.


Output

Write your simplified polygon to standard output, stdout, in the same format as the input.

The output mesh must be manifold. Additionally, it may not have any zero-area degenerate triangular faces.

The output may be at most TODO MiB in total. Thus, you should take care not to print an excessive amount of decimals if your mesh is large.

The baseline solutions described below respect this bound.


Writing Your Solution

Because this problem has a large amount of input, C++ and Python code for quickly reading and writing input/output are provided in the attachments section at the bottom of the page.

These files are provided as-is. You may modify them in any way you see fit, and you may of course choose not to use them.

Additionally, for C++, the library Eigen is available.

The Eigen files will be placed in the same directory as your solution when compiled, and can be included using, for example:

#include "Eigen/Dense"

The version provided is Eigen 5.0.0.

You do not need to submit any Eigen files. It may be beneficial to download Eigen for local debugging and development if you choose to use it.


Explanation of Sample

In the sample shown below, the simplified mesh removes a redundant vertex from the right face of the original mesh without changing the face normal and depth.

Therefore,

$$ |V_o| = 9, $$

$$ |V_s| = 8, $$

and the compression rate is:

$$ 1 - \frac{8}{9} = \frac{1}{9}. $$

You are not awarded any points for solving the sample case, but you can use it to debug your solution.


Sample Input 1

9 14
v 0.5 0.5 0.5
v 0.5 0.5 -0.5
v 0.5 -0.5 0.5
v 0.5 -0.5 -0.5
v -0.5 0.5 0.5
v -0.5 0.5 -0.5
v -0.5 -0.5 0.5
v -0.5 -0.5 -0.5
v 0.5 0.49 0.49
f 1 3 9
f 1 9 2
f 9 3 4
f 9 4 2
f 5 6 8
f 5 8 7
f 1 2 6
f 1 6 5
f 3 7 8
f 3 8 4
f 1 5 7
f 1 7 3
f 2 4 8
f 2 8 6

Sample Output 1

8 12
v 0.5 0.5 0.5
v 0.5 0.5 -0.5
v 0.5 -0.5 0.5
v 0.5 -0.5 -0.5
v -0.5 0.5 0.5
v -0.5 0.5 -0.5
v -0.5 -0.5 0.5
v -0.5 -0.5 -0.5
f 1 3 4
f 1 4 2
f 5 6 8
f 5 8 7
f 1 2 6
f 1 6 5
f 3 7 8
f 3 8 4
f 1 5 7
f 1 7 3
f 2 4 8
f 2 8 6