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

3D Tilesのアトラス化 #620

Merged
merged 7 commits into from
Aug 22, 2024
Merged

3D Tilesのアトラス化 #620

merged 7 commits into from
Aug 22, 2024

Conversation

nokonoko1203
Copy link
Collaborator

@nokonoko1203 nokonoko1203 commented Aug 22, 2024

Close #303
Close #550
Close #568
Close #569

What I did(変更内容)

  • 3D Tiles Sinkの拡張
    • アトラス化
      • 利用されるテクスチャのサイズに応じて作成するアトラスの大きさを変更
      • ズームレベルに応じてテクスチャの解像度を変更
  • 処理速度は既存のSinkより10倍程度になっていますが、Cesiumでの描画パフォーマンスは大きく向上しています

Notes(連絡事項)

  • 以下のように変換します
cargo run -- <input_path> --sink 3dtiles -o transform=use_texture --output <output_path> --release
image

Copy link

coderabbitai bot commented Aug 22, 2024

Walkthrough

tile_writing_stage関数におけるテクスチャ処理とパッキングの大幅な強化が行われました。テクスチャキャッシュメカニズムが統合され、atlas_packerライブラリを用いたテクスチャパッキングの実装が追加されました。テクスチャのサイズを計算し、必要に応じてダウンサンプリングを行うロジックが整備され、UVマッピングが正確に適用されるようになりました。パッキングされたテクスチャは指定されたディレクトリに書き出されます。

Changes

ファイルパス 変更概要
nusamai/src/sink/cesiumtiles/mod.rs tile_writing_stage関数のテクスチャ処理とパッキングの統合、テクスチャキャッシュとサイズキャッシュの追加、ダウンサンプリングロジックの強化、UVマッピングの改良、テクスチャの書き出し機能の追加。

Poem

うさぎの耳で聞くメロディ、
テクスチャが舞い、色彩の旅。
新たなパッキング、楽しさ満点、
みんなのタイルが輝く瞬間!
さあ、跳ねよう、未来へと、
お祝いしよう、ゆらめく光! ✨🐇


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dfdc544 and ce02093.

Files selected for processing (1)
  • nusamai/src/sink/cesiumtiles/mod.rs (10 hunks)
Additional comments not posted (7)
nusamai/src/sink/cesiumtiles/mod.rs (7)

19-24: インポートの追加が適切です。

atlas_packerライブラリからの新しいインポートは、テクスチャ処理とパッキングの機能強化に必要です。


317-321: テクスチャキャッシュの初期化が適切です。

TextureCacheTextureSizeCacheの初期化は、テクスチャデータの効率的な管理に役立ちます。


322-328: 一時ディレクトリの設定が適切です。

tempdirを使用して一時的なテクスチャストレージを設定するのは適切です。


388-423: テクスチャサイズの計算が適切です。

最大テクスチャサイズを計算し、2の累乗に調整することは、テクスチャアトラスにおいて重要です。


425-436: テクスチャパッカーの初期化が適切です。

GuillotineTexturePlacerを使用したパッカーの初期化は、パッキングプロセスに適しています。


497-568: テクスチャのパッキングとUVマッピングが適切です。

テクスチャのパッキングとUV座標の更新ロジックは複雑ですが、正しく実装されています。


679-685: ダウンサンプルファクターの適用ロジックが適切です。

ズームレベルに基づいてダウンサンプルファクターを決定するロジックは、シンプルで正しいようです。

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 46.49682% with 84 lines in your changes missing coverage. Please review.

Files Patch % Lines
nusamai/src/sink/cesiumtiles/mod.rs 46.49% 84 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
GUI ∅ <ø> (∅)
Backend 75.51% <46.49%> (-0.54%) ⬇️
Libraries 89.82% <ø> (ø)

📢 Thoughts on this report? Let us know!

@nokonoko1203 nokonoko1203 marked this pull request as ready for review August 22, 2024 05:34
@nokonoko1203 nokonoko1203 changed the title Feature/3dtiles-atlas 3D Tilesのアトラス化 Aug 22, 2024
@nokonoko1203 nokonoko1203 marked this pull request as draft August 22, 2024 06:05
@nokonoko1203 nokonoko1203 marked this pull request as ready for review August 22, 2024 06:06
@satoshi7190
Copy link
Contributor

出力データを確認
image

Copy link
Contributor

@satoshi7190 satoshi7190 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@satoshi7190 satoshi7190 merged commit 5931c58 into main Aug 22, 2024
7 of 8 checks passed
@satoshi7190 satoshi7190 deleted the feature/3dtiles-atlas branch August 22, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants