Created
March 6, 2025 13:47
-
-
Save laurentsenta/f31f1570c55713a9776cfbcdc7b4bb92 to your computer and use it in GitHub Desktop.
terrain 3d blend value checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tool | |
extends RayCast3D | |
@export var terrain: Terrain3D | |
@export var debug: bool = false | |
@export var base_texture_id: int | |
@export var overlay_id: int | |
@export var blend_value: float | |
func _ready() -> void: | |
if Engine.is_editor_hint(): | |
pass | |
else: | |
queue_free() | |
func _process(delta: float) -> void: | |
if !terrain or !debug: | |
return | |
var t := terrain.data.get_texture_id(global_position) | |
base_texture_id = int(t.x) if not is_nan(t.x) else NAN | |
overlay_id = int(t.y) if not is_nan(t.y) else NAN | |
blend_value = t.z | |
#print_debug(t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment