Skip to content

Conversation

@lokejonatan
Copy link

This PR is currently a DRAFT and is intended for design review ONLY. Please do not merge.

This branch introduces non-destructive layer system for Terrain3D. The system supports multiple layer types, blending modes, and user-defined coverage areas, all composited in real-time.

Work In Progress Status
Please note that this is a prototype, and there are currently many known bugs and performance issues. Reviewers should focus solely on the architecture and code structure rather than testing for final stability.

Key Architectural Changes (Review Focus)
Given the feedback on infrastructure changes, I've prioritized an architecture that is flexible and performant. Your review of these core structural decisions is critical:

Layer Architecture: Introduces a Terrain3DLayer base class and specialized types (Stamp, Curve, LocalNode). This is the primary architectural change—review is needed on how this class structure integrates with the existing Terrain3D node.

Data Organization: The MapType enum has been refactored into a standalone terrain_3d_map.h to improve code organization and support the new layer logic.

Performance & Dirty-Tracking: Implemented a new layer compositing system with aggressive caching and dirty-tracking. This is essential for real-time performance—I'd appreciate feedback on the caching strategy.

Editor Integration: Basic UI elements have been added for layer management and active layer selection within the editor.

Next Steps (Pending Design Approval): Once the core design is approved, I will focus on bug fixing, performance stabilization, and breaking this into smaller, production-ready PRs for merge.

- Introduced Terrain3DLayer class with properties for map type, intensity, feather radius, and blend mode.
- Implemented Terrain3DCurveLayer for handling curves with width, depth, and dual groove options.
- Added methods for managing layers in Terrain3DRegion, including adding, removing, and clearing layers.
- Enhanced Terrain3DRegion to support multiple layer types (height, control, color) and their respective operations.
- Updated methods to mark layers as dirty when changes occur, ensuring proper updates to baked maps.
- Created utility functions for managing map types and their corresponding formats and colors.
- Added bindings for new methods in the Godot scripting API.
…d updating active layer handling in Terrain3D editor
- Introduced falloff_curve property to Terrain3DCurveLayerPath for cross-section profile shaping.
- Updated Terrain3DCurveLayer methods to handle falloff_curve for enhanced sculpting control.
…esh queue and clamping logic for dirty regions
@TokisanGames TokisanGames added this to the 1.2 milestone Dec 16, 2025
@lokejonatan lokejonatan force-pushed the feat/non-destructive-layers branch from 529cfc0 to 5d04d56 Compare January 10, 2026 00:53
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