Skip to content

Add FlipBook functionality to Tint Color for feature parity with Base Color#153

Merged
CA-Tatami merged 17 commits into
mainfrom
feature/tint-color-flipbook
Jul 23, 2025
Merged

Add FlipBook functionality to Tint Color for feature parity with Base Color#153
CA-Tatami merged 17 commits into
mainfrom
feature/tint-color-flipbook

Conversation

@CA-Tatami

@CA-Tatami CA-Tatami commented Jul 18, 2025

Copy link
Copy Markdown
Contributor

概要

Tint ColorにはFilp Bookの機能がなかったため、Base Mapなどと同様のインターフェースで機能を追加しました。
ただし後方互換のためEnumのインデックス順序が異なっています。

主な変更点

  • TintColorMode列挙型にFlipBookモード追加: Texture2DArrayサポートのための新しいFlipBook = 3モード
  • Texture2DからSingleTextureに名前変更: 全シェーダー機能における命名一貫性の向上
  • プログレス計算の統一: 非推奨のTintMapProgressを標準的なFlipBookBlendingProgressに置換
  • シェーダープロパティ追加: FlipBookサポートのための_TintMap2DArray_TintMapProgress_TintMapProgressCoord
  • 全シェーダーパス更新: Forward、ShadowCaster、DepthNormalsパスでTint Color FlipBookをサポート
  • 既存機能との統合: Flow Map、Parallax Map、Emission Mapとの互換性
  • 最適化シェーダーサポート: 最適化除外対象に_TINT_MAP_MODE_2D_ARRAYを追加
  • ドキュメント更新: READMEファイルに新しいFlipBook機能を反映

技術実装

// 新しいFlipBookモードサンプリング
#ifdef _TINT_MAP_MODE_2D_ARRAY
#define SAMPLE_TINT_MAP(uv, progress) SAMPLE_TEXTURE2D_ARRAY(_TintMap2DArray, sampler_TintMap2DArray, uv, progress);
#endif

// 標準FlipBookメソッドを使用したプログレス計算
#ifdef _TINT_MAP_MODE_2D_ARRAY
output.baseMapUVAndProgresses.w = FlipBookProgress(_TintMapProgress + GET_CUSTOM_COORD(_TintMapProgressCoord), _TintMapSliceCount);
#endif

後方互換性

  • マテリアル保持: TintColorMode.Texture2Dを使用する既存マテリアルは自動的にSingleTextureとして動作
  • プロパティ保持: 既存のTint Colorプロパティはすべて機能を維持
  • キーワード管理: MaterialPostProcessorによる自動キーワード設定

含まれるバグ修正

  • シェーダーコンパイルエラー: tint mapなしでemission mapを使用した際のtintEmissionUV定義を修正
  • Flow Map統合: DepthNormalsパスでのFlow Map + Tint Map組み合わせの条件チェック不足を修正
  • 表示名修正: UIParticlesシェーダーの不正な「Base Map Slice Count」ラベルを修正

Tatami and others added 16 commits July 18, 2025 16:52
- Update TintColorMode enum: Texture3D → FlipBookBlending
- Add FlipBook = 3 for new 2DArray functionality
- Update all usage locations to maintain compatibility
- Preserve existing material compatibility (enum value 2 unchanged)

Updated files:
- TintColorMode.cs: Enum definition
- ShaderKeywords.cs: Keyword mapping
- UnusedReferencesRemover.cs: Reference cleanup
- RendererErrorHandler.cs: Error handling
- ParticlesUberCommonGUI.cs: GUI display

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Implement FlipBook functionality for TintColor to achieve feature parity with BaseMap FlipBook implementation.

## Key Features
- **TintColorMode.FlipBook**: New enum value (3) for Texture2DArray support
- **Texture2DArray Support**: Full 2DArray texture sampling with FlipBook animation
- **Progress Control**: Unified "Flip-Book Progress" with Custom Coord integration
- **Auto Slice Count**: Automatic slice count detection from Texture2DArray.depth
- **GUI Integration**: Consistent interface matching BaseMap FlipBook patterns

## Implementation Details
- **Material Properties**: _TintMap2DArray, _TintMapProgress, _TintMapProgressCoord
- **Shader Keywords**: _TINT_MAP_MODE_2D_ARRAY for FlipBook mode
- **HLSL Implementation**: SAMPLE_TEXTURE2D_ARRAY with FlipBookProgress calculation
- **Error Handling**: Custom Coord validation and unused texture cleanup
- **Compatibility**: Full backward compatibility with existing TintColor modes

## Supported Shaders
- ParticlesUberUnlit/Lit: Full support with any Custom Coord
- UIParticlesUberUnlit/Lit: Full support with Custom1.x/y, Custom2.x/y

## Technical Architecture
- Follows BaseMap FlipBook implementation patterns for consistency
- Reuses existing FlipBookProgress() HLSL function
- Integrates with NOVA's Custom Coord system for animation control
- Maintains enum value order for material file compatibility

This implementation provides complete FlipBook functionality for TintColor while maintaining full compatibility with existing projects.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing _TINT_MAP_MODE_2D_ARRAY keyword to all shader files
- Rename TintColorMode.Texture2D to SingleTexture for consistency with BaseMapMode
- Fix tintColor variable initialization in ParticlesUber.hlsl
- Update all references to use SingleTexture instead of Texture2D
- Add documentation note about enum ordering differences due to backward compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed multiple integration issues that would have prevented FlipBook functionality from working correctly:

• Fixed Flow Map processing: Added missing _TINT_MAP_MODE_2D_ARRAY condition to ensure Flow Map effects apply to FlipBook textures
• Fixed Parallax Map processing: Added missing _TINT_MAP_MODE_2D_ARRAY condition to ensure Parallax Map effects apply to FlipBook textures
• Optimized tintEmissionUV definition: Added proper conditional compilation in DepthNormals to avoid unnecessary TEXCOORD usage
• Optimized progress calculations: Consolidated redundant variable assignments into single-line operations
• Updated TintMapProgress method calls: Replaced deprecated TintMapProgress with FlipBookBlendingProgress for consistency
• Fixed display names: Corrected "Base Map Slice Count" to "Tint Map Slice Count" in UIParticlesUberLit.shader
• Enhanced DepthNormals UV access: Added TintColor keywords to _USE_BASE_MAP_UV to prevent compilation errors

These fixes ensure FlipBook feature works correctly with Flow Map, Parallax Map, and all shader passes while maintaining optimal performance.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updated README.md and README_JA.md to reflect the new Tint Color FlipBook functionality:

• Updated Color Mode options to include Single Texture, Flip Book Blending, and Flip Book
• Added texture type requirements for each mode (Texture2DArray for Flip Book, Texture3D for Flip Book Blending)
• Updated property visibility descriptions to include all applicable modes
• Added Flip-Book Progress property documentation for animation control
• Corrected naming from "Texture 2D/3D" to "Single Texture" for consistency with actual implementation

The documentation now accurately reflects the complete feature parity between Base Map and Tint Color FlipBook functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed the order of Flip Book modes in Tint Color documentation to match Base Map:

• Reordered Color Mode options to: Single Color → Single Texture → Flip Book → Flip Book Blending
• Updated property visibility descriptions to maintain logical order
• Applied same consistency fixes to both English and Japanese READMEs

This ensures consistent documentation throughout, where Flip Book always appears before Flip Book Blending, matching the logical progression from basic to advanced features.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ywords

Fixed shader compilation error "invalid subscript 'tintEmissionUV'" that occurred when emission map features were enabled without tint map features. Updated conditional definition in ParticlesUberDepthNormalsCore.hlsl to include all emission map keywords.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed missing condition check in ParticlesUberDepthNormalsCore.hlsl where Flow Map target for Tint Map was applied without checking if Tint Map features are enabled, ensuring consistency with other shader passes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
PRタイトルは英語、PR説明文とコミットメッセージは日本語で記述するガイドラインを追加しました。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds FlipBook functionality to Tint Color to achieve feature parity with Base Color. The implementation includes new Texture2DArray support and progress control while maintaining backward compatibility through enum ordering considerations.

Key changes include:

  • Addition of new FlipBook modes (FlipBook and FlipBook Blending) to TintColorMode enum
  • Renaming "Texture 2D" to "Single Texture" for consistency across shader features
  • Implementation of unified progress calculation system using standard FlipBookBlendingProgress

Reviewed Changes

Copilot reviewed 248 out of 248 changed files in this pull request and generated no comments.

File Description
README.md / README_JA.md Updated documentation to reflect new FlipBook modes and texture requirements
CLAUDE.md Added design decisions about enum ordering and PR guidelines
Material files (*.mat) Bulk update of material properties to support new TintMap2DArray and Base Map features
Comments suppressed due to low confidence (2)

README.md:519

  • The removal of 'Texture 2D' mode should be documented as a breaking change or migration note, as existing documentation references may become outdated.
</td></tr>

README_JA.md:519

  • 同様に日本語版でも 'Texture 2D' モードの削除について、互換性の注意点を明記すべきです。
<li>Single Texture: テクスチャで指定</li>

@CA-Tatami CA-Tatami merged commit 4e37ee4 into main Jul 23, 2025
1 check passed
@CA-Tatami CA-Tatami deleted the feature/tint-color-flipbook branch July 23, 2025 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants