-
Notifications
You must be signed in to change notification settings - Fork 10
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
OBJ Sinkにアトラス化を付与したobj_atlas sink
の作成
#612
Conversation
Walkthroughこの変更は、画像の読み込み機能を削除し、テクスチャパッキング機能を強化したことに焦点を当てています。 Changes
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (1)
nusamai/src/sink/obj_atlas/mod.rs (1)
378-380
: テクスチャキャッシュの導入を確認しました。
TextureCache
が導入され、効率的なテクスチャ管理が可能になりました。キャッシュサイズが大きいため、メモリ使用量に注意が必要です。
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- nusamai/src/sink/obj_atlas/material.rs (2 hunks)
- nusamai/src/sink/obj_atlas/mod.rs (5 hunks)
- nusamai/src/sink/obj_atlas/obj_writer.rs (4 hunks)
Additional comments not posted (5)
nusamai/src/sink/obj_atlas/material.rs (1)
3-3
: 不要なコードとインポートの削除を確認しました。
load_image
関数の削除により、コードが簡素化され、未使用のインポートが削除されました。これにより、コードの可読性とメンテナンス性が向上しています。nusamai/src/sink/obj_atlas/obj_writer.rs (2)
100-103
: テクスチャファイル名の取り扱いが改善されました。テクスチャのファイル名が直接キャッシュに記録されるようになり、ファイルI/O操作が削減されました。これにより、効率が向上しています。
18-18
:write_obj
関数のインターフェースが簡素化されました。
materials
パラメータが削除され、material_cache
に依存するようになりました。これにより、関数のインターフェースが簡素化されましたが、材料が見つからない場合のエラーハンドリングが簡略化されているため、情報が失われる可能性があります。Verification successful
write_obj
関数のインターフェースの確認
write_obj
関数は2つの異なる場所で定義されています。nusamai/src/sink/obj_atlas/obj_writer.rs
の関数は、レビューコメントで指摘された新しいシグネチャに沿っていますが、nusamai/src/sink/obj/mod.rs
の関数は異なるシグネチャを使用しています。このため、レビューコメントはobj_atlas
バージョンにのみ適用されることを確認しました。
nusamai/src/sink/obj_atlas/obj_writer.rs
でのwrite_obj
は新しいシグネチャに沿っています。nusamai/src/sink/obj/mod.rs
でのwrite_obj
は異なるシグネチャを使用しています。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify usage of `write_obj` to ensure all calls align with the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type rust -A 5 $'write_obj'Length of output: 1854
nusamai/src/sink/obj_atlas/mod.rs (2)
399-409
: テクスチャパッカーの初期化が追加されました。
TexturePacker
の初期化により、テクスチャのアトラス化が可能になり、処理が効率化されています。ただし、パッキングのパフォーマンスを監視することをお勧めします。
568-570
: アトラスのエクスポート処理が追加されました。
packer.finalize()
とpacker.export()
が追加され、すべてのテクスチャが適切にパックされ、保存されるようになりました。これにより、アトラス化のプロセスが完結しています。
// todo: Add error handling | ||
println!("Material not found: {}", material_key); | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
エラーハンドリングの改善を検討してください。
材料が見つからない場合に単にエラーメッセージを出力するだけではなく、詳細なエラーハンドリングを追加することを検討してください。これにより、デバッグが容易になります。
// 提案: ログに詳細な情報を追加し、エラーを処理する
eprintln!("Error: Material '{}' not found in cache. Please check the material definitions.", material_key);
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
📢 Thoughts on this report? Let us know! |
@nokonoko1203 thread 'pipeline-sink' panicked at /Users/hoge/.cargo/git/checkouts/atlas-packer-0eceddb6ce829bab/c2c3e78/src/texture.rs:161:44:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ERROR nusamai::pipeline::runner > Sink thread panicked with message: attempt to subtract with overflow
ERROR nusamai > Pipeline thread panicked: "Sink thread panicked with message: attempt to subtract with overflow"
INFO nusamai > Total processing time: 146.0530415s |
@nokonoko1203 |
Pull request was converted to draft
<!-- Close or Related Issues --> Close #593 #311 #448 #303 ### Description(変更内容) <!-- Please describe the motivation behind this PR and the changes it introduces. --> <!-- 何のために、どのような変更をしますか? --> - #612 を修正 - 以下の事象に対応し、アトラス化されたテクスチャの出力と対応するOBJファイルを出力するように変更 - UV座標をアトラスの座標に差し替え - mtlに書き込むテクスチャのパスと、アトラスの出力パスが不整合を修正 - 不要なcrop処理を入れないように修正 - 全体的にマルチスレッド処理に変更 - 画像のキャッシュサイズを増加 - 一度切り出した`atlas-packer`を一旦nusamaiに戻す - 開発効率の問題 ### Notes(連絡事項) <!-- If manual testing is required, please describe the procedure. --> <!-- 手動の動作確認が必要なら、手順を簡単に伝えてください。その他連絡事項など。 --> ```bash cargo run -- <input_path> --sink obj -o transform=use_texture -o split=true --output <output_path> ```
Description(変更内容)
Notes(連絡事項)