I created this for smooth curves with a small bake interval. The shader will interpolate the forward direction, so this is not suited for curves that are not smooth.
This file contains 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
extends Node | |
var mouse_direction_sensitivity := 0.004 | |
var mouse_direction_deadzone := 0.05 | |
var mouse_direction_raw := Vector2() | |
var direction := Vector2() | |
func _input(event: InputEvent): | |
if event is InputEventMouseMotion: |
This file contains 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
extends Node | |
# Based on this tweet by Clay John: | |
# https://twitter.com/john_clayjohn/status/1306447928932753408 | |
func _ready() -> void: | |
# Create a local rendering device. | |
var rd := RenderingServer.create_local_rendering_device() | |