Skip to content

Add Rotation properties to Flow Map, Alpha Transition, Emission, and Tint Color#180

Merged
sakumanaoki merged 7 commits intomainfrom
feature/add_map_rotation
Dec 24, 2025
Merged

Add Rotation properties to Flow Map, Alpha Transition, Emission, and Tint Color#180
sakumanaoki merged 7 commits intomainfrom
feature/add_map_rotation

Conversation

@sakumanaoki
Copy link
Contributor

概要

BaseMap にある回転のパラメータを追加しました。

追加したものは以下になります。

  • Lit/Unlit
    • Tint Color
    • Flow Map
    • Alpha Transition
    • Alpha Transition 2枚目
    • Emission
  • Distortion
    • Flow Map
    • Alpha Transition

また、追加したロジック側に合わせて既存の BaseMap の回転処理でシェーダーバリアントを使用していたのをif文へと変更しました。

動作確認

ロジック、挙動がほぼ同じなので一部抜粋します。

Lit/Unlit

Unlit で動作確認をしています。

TintColor

TintRotate.mov

FlowMap

FlowRotate.mov

Distortion FlowMap

DistRotate.mov

確認したこと

  • Rotationの項目により、回転およびオフセットができること
  • 2022.3環境でテストが通ること

sakumanaoki and others added 7 commits December 24, 2025 12:23
各マップに以下のプロパティを追加:
- FlowMap: _FlowMapRotation, _FlowMapRotationCoord, _FlowMapRotationOffsets
- AlphaTransitionMap: _AlphaTransitionMapRotation, _AlphaTransitionMapRotationCoord, _AlphaTransitionMapRotationOffsets
- AlphaTransitionMap SecondTexture: _AlphaTransitionMapSecondTextureRotation, _AlphaTransitionMapSecondTextureRotationCoord, _AlphaTransitionMapSecondTextureRotationOffsets
- EmissionMap: _EmissionMapRotation, _EmissionMapRotationCoord, _EmissionMapRotationOffsets

実装内容:
- UV回転処理を実装(処理順序: Rotation → Transform → Offset)
- Custom Coordシステムと統合し、パーティクルごとの回転角度制御に対応
- ParticlesUberUnlit/Lit、UIParticlesUberUnlit/Litの全シェーダーに対応
- エディタGUIに各マップの回転角度とオフセット設定UIを追加
- RendererErrorHandlerに各マップのCustomCoord使用検証を追加
- 冗長なコメントを削除してコードを整理

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

Co-Authored-By: Claude <noreply@anthropic.com>
変更内容:
- HLSLファイルで #ifdef _BASE_MAP_ROTATION_ENABLED を if文に変更
  - ParticlesUberUnlit.hlsl
  - ParticlesUberShadowCaster.hlsl
  - ParticlesUberDepthNormalsCore.hlsl
  - ParticlesDistortionForward.hlsl
- MaterialPostProcessorからキーワード設定コードを削除
- ShaderKeywords.csからBaseMapRotationEnabled定数を削除

効果:
- シェーダーバリアント数削減(コンパイル時間短縮、メモリ削減)
- TintMap/FlowMap/AlphaTransitionMap/EmissionMapと実装を統一
- 既存マテリアルとの完全な互換性を維持

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

Co-Authored-By: Claude <noreply@anthropic.com>
変更内容:
- ParticlesUberUnlit.shader から #pragma shader_feature_local_vertex _BASE_MAP_ROTATION_ENABLED を削除(6箇所)
- ParticlesUberLit.shader から削除(6箇所)
- UIParticlesUberUnlit.shader から削除(1箇所)
- UIParticlesUberLit.shader から削除(1箇所)
- ParticlesDistortion.shader から削除(3箇所)
- OptimizedShaderGenerator.cs の保護キーワードリストから削除

効果:
- シェーダーバリアント数の実際の削減を実現
- コンパイル時間とメモリ使用量の改善
- BaseMapRotationは引き続きif文で動作

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

Co-Authored-By: Claude <noreply@anthropic.com>
@sakumanaoki sakumanaoki merged commit 49e49e0 into main Dec 24, 2025
1 check passed
@sakumanaoki sakumanaoki deleted the feature/add_map_rotation branch December 24, 2025 08:08
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.

2 participants