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

Feat: CatmullClark subdivision surface for sphere in primitive mesh #1628

Merged
merged 68 commits into from
Dec 29, 2023

Conversation

JujieX
Copy link
Contributor

@JujieX JujieX commented Jul 2, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

CatmullClark subdivision surface for sphere generation in primitive mesh
fix https://github.com/galacean/editor/issues/1628

@JujieX JujieX added the enhancement New feature or request label Jul 2, 2023
@JujieX JujieX added this to the 1.1 milestone Jul 2, 2023
@JujieX JujieX self-assigned this Jul 2, 2023
@JujieX JujieX requested a review from zhuxudong July 3, 2023 02:40
@JujieX JujieX changed the base branch from main to dev/1.1 July 3, 2023 02:40
@zhuxudong
Copy link
Member

  1. uv has some problems
    image

  2. when the new algorithm takes 4 and the old algorithm takes 64, it can almost get a smooth spherical shape, but the number of faces is more
    createSphere(engine ,1, 64) vs createSphere(engine, 1, 4)
    image
    image

  3. may skyProcedural's bug, when the step is set to 5, the skyline is almost clear, but the number of faces is more than before, and there is a blue anomaly
    image

@JujieX
Copy link
Contributor Author

JujieX commented Jul 3, 2023

  1. uv has some problems
    image
  2. when the new algorithm takes 4 and the old algorithm takes 64, it can almost get a smooth spherical shape, but the number of faces is more
    createSphere(engine ,1, 64) vs createSphere(engine, 1, 4)
    image
    image
  3. may skyProcedural's bug, when the step is set to 5, the skyline is almost clear, but the number of faces is more than before, and there is a blue anomaly
    image
  1. this algo itself needs to solve vertex sharing problem case by case. Here's how unity sphere looks like with same texture:
    image

  2. clearly Spector shows the the indices length sent to the model mesh as triangle counts, real triangle counts is 3 times less i.e. Spector triangle counts/3. So when step =3, we would get the same triangle counts 768 as in unity

packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
packages/core/src/mesh/PrimitiveMesh.ts Outdated Show resolved Hide resolved
@GuoLei1990 GuoLei1990 changed the base branch from dev/1.1 to main September 15, 2023 09:34
@GuoLei1990 GuoLei1990 modified the milestones: 1.1, 1.2 Oct 7, 2023
@GuoLei1990 GuoLei1990 assigned JujieX and unassigned JujieX Oct 7, 2023
@GuoLei1990 GuoLei1990 added high priority High priority issue mesh labels Oct 7, 2023
@GuoLei1990 GuoLei1990 merged commit 5dcf51e into galacean:main Dec 29, 2023
6 checks passed
@JujieX JujieX linked an issue Dec 29, 2023 that may be closed by this pull request
GuoLei1990 added a commit that referenced this pull request Jan 1, 2024
* main:
  Feat: CatmullClark subdivision surface for sphere in primitive mesh (#1628)
  "v1.1.0-beta.32"
  Fix text black border render error (#1932)
  Add material tests for e2e (#1918)
  "v1.1.0-beta.31"
  Use texture if the atlas fails to load (#1931)

# Conflicts:
#	packages/core/package.json
#	packages/design/package.json
#	packages/draco/package.json
#	packages/galacean/package.json
#	packages/loader/package.json
#	packages/math/package.json
#	packages/physics-lite/package.json
#	packages/physics-physx/package.json
#	packages/rhi-webgl/package.json
#	packages/shader-lab/package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority High priority issue mesh
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Optimize seam uv and pole uv generation for SubdivisionSurfaceSphere
3 participants