Dev pour la beta 1.4

* Changements de la texture des cristaux de Talion dans tous les assets 3D pour correspondre aux assets 2D
* Ajout d'un évenement en fin de région, une résurgence de Talion qui décontamine et fait looter les plantes mature aux alentours
* Ajout d'un path finding sur le mouvement du robot
* Modification du flow des actions à la souris : ajout d'un nouveau son, d'un icône à l'emplacement de l'action
* Modification du nombre et de l'ordre de mutation débloquées
* Augmentation de la valeur maximale de zoom
* Modification des scores à atteindre dans les premières régions
* Modification de l'interface du vaisseau, laissant apparaitre une roadmap plus claire, et laissant inspecter l'inventaire actuel
* Modification de l'icône d'action dans les scènes 3D
* Augmentation de la zone d'écart entre les plantes, et augmentation du taux de zone fertile en conséquence
* La station de recharge devient inutilisable après la fin de la région
* Ajout d'une transparence lors de la sélection d'objets derrières d'autres objets
* Les plantes juvéniles donneront toujours une graine si coupées
* Ajout d'un bouclage sur les couleurs des mutations
* Fix des hitbox des plantes pour l'inspection à la souris
* Fix de plusieurs bugs sur la manipulation de l'inventaire
* Ajout de nombreux screenshots d'utilisation des outils lors du tutoriel
* Amélioration mineure de la traduction/wording
This commit is contained in:
2026-05-17 02:29:55 +02:00
parent 73b0bf2d33
commit 8efe8bce36
126 changed files with 1955 additions and 463 deletions

View File

@@ -0,0 +1,14 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://di0m3uqgi3l08"]
[ext_resource type="Texture2D" uid="uid://dfd72vla6crn4" path="res://common/assets/textures/cristal.png" id="1_m4qy0"]
[resource]
diffuse_mode = 3
specular_mode = 1
disable_fog = true
albedo_texture = ExtResource("1_m4qy0")
metallic_specular = 1.0
rim_tint = 0.48
stencil_flags = 2
stencil_reference = 5
stencil_outline_thickness = 0.626

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View File

@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dfd72vla6crn4"
path.s3tc="res://.godot/imported/cristal.png-542ce388785d47ebc69b0d8cd0728915.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/assets/textures/cristal.png"
dest_files=["res://.godot/imported/cristal.png-542ce388785d47ebc69b0d8cd0728915.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://dnqq2sy3dxrb2"
path="res://.godot/imported/freesound_community-wine-glass-clink-36036.mp3-bc462b7f4a73f6e9bc3696ca5c63bc97.mp3str"
[deps]
source_file="res://common/audio_manager/assets/sfx/cristal/freesound_community-wine-glass-clink-36036.mp3"
dest_files=["res://.godot/imported/freesound_community-wine-glass-clink-36036.mp3-bc462b7f4a73f6e9bc3696ca5c63bc97.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://di6id2kyfy2e1"
path="res://.godot/imported/sslc2022-earth-rumble-128880.mp3-cbdb82e7630ba8aed62692404d0e45e0.mp3str"
[deps]
source_file="res://common/audio_manager/assets/sfx/earth_rumble/sslc2022-earth-rumble-128880.mp3"
dest_files=["res://.godot/imported/sslc2022-earth-rumble-128880.mp3-cbdb82e7630ba8aed62692404d0e45e0.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://rf7hachl3042"
path="res://.godot/imported/universfield-bubble-pop-07-487896.mp3-9674fcc5b43af938e0c8845e16ca6bfd.mp3str"
[deps]
source_file="res://common/audio_manager/assets/sfx/signal/universfield-bubble-pop-07-487896.mp3"
dest_files=["res://.godot/imported/universfield-bubble-pop-07-487896.mp3-9674fcc5b43af938e0c8845e16ca6bfd.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@@ -39,6 +39,11 @@ materials/extract_format=0
materials/extract_path=""
_subresources={
"materials": {
"Cristal": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/cristal.tres",
"use_external/path": "uid://di0m3uqgi3l08"
},
"Material": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",

View File

@@ -39,6 +39,11 @@ materials/extract_format=0
materials/extract_path=""
_subresources={
"materials": {
"Cristal": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/cristal.tres",
"use_external/path": "uid://di0m3uqgi3l08"
},
"Material": {
"use_external/enabled": true,
"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",

View File

@@ -3,7 +3,7 @@ class_name ProgressionData
@export var planted_mutation_ids: Array[String] = []
@export var story_step_i := 0
@export var mutations_unlocked = 5
@export var mutations_unlocked = 8
var all_mutations: Array[PlantMutation] : get = get_all_mutations
var available_mutations: Array[PlantMutation] : get = get_available_mutations
@@ -28,16 +28,16 @@ func get_all_mutations() -> Array[PlantMutation]:
ProlificMutation.new(),
PrecociousMutation.new(),
PurificationMutation.new(),
VivaciousMutation.new(),
QuickMutation.new(),
RobustMutation.new(),
SocialMutation.new(),
FertileMutation.new(),
QuickMutation.new(),
HurriedMutation.new(),
GenerousMutation.new(),
ProtectiveMutation.new(),
PureMutation.new(),
RobustMutation.new(),
ToughMutation.new(),
VivaciousMutation.new(),
]
func get_all_artifacts() -> Array[Artefact]:

View File

@@ -70,17 +70,9 @@ func generate_next_run_point(last_modifiers : Array[String] = []) -> RunPoint:
] as Array[RegionModifier]
var first_vending = story_step.get_first_vending_machine_occurence(next_level)
var vending_occurence = story_step.get_vending_machine_occurence(next_level)
if vending_occurence > 0 and level >= first_vending:
if (level - first_vending)%vending_occurence == 0:
region_parameter.modifiers.append(VendingMachineModifier.new())
var first_cave = story_step.get_first_cave_occurence(next_level)
var cave_occurence = story_step.get_cave_occurence(next_level)
if cave_occurence > 0 and level >= first_cave:
if (level - first_cave)%cave_occurence == 0:
region_parameter.modifiers.append(CaveModifier.new())
region_parameter.modifiers.append_array(
story_step.get_gameplay_modifiers_for_region(next_level)
)
region_parameter.modifiers.append_array(
story_step.get_story_modifiers_for_region(next_level)

View File

@@ -57,8 +57,8 @@ const AVAILABLE_LANGUAGES_LABEL = [
#region ------------------ Game ------------------
const MAX_ZOOM = 1.8
const MIN_ZOOM = 0.8
const MAX_ZOOM = 2.
const MIN_ZOOM = 0.5
# Not in settings pannel
@export var zoom : float = 1. :

View File

@@ -16,8 +16,20 @@ func get_destination_scene() -> Scene:
"001"
)
func get_cave_occurence(_level : int) -> int:
return 2
func get_region_sequence_length() -> int:
return 5
return 4
func get_objective_for_region(level : int) -> int:
match level:
1: return 6
2: return 10
3: return 16
4: return 24
5: return 34
_: return get_objective_for_region(level-1) + (level-2) * 5
func get_first_vending_machine_occurence(_level : int) -> int:
return 0
@@ -29,8 +41,8 @@ func get_challenge_chance(_level : int) -> float:
return 0.
func get_ship_dialog_path(level : int, ship_in_space := true) -> String:
if ship_in_space and level == get_cave_occurence(level):
if ship_in_space and level == get_cave_occurence(level) - 1:
return CAVE_DIALOG_PATH
if ship_in_space and level == get_region_sequence_length() - 1:
if ship_in_space and is_run_finished(level + 1):
return MERCURY_ARRIVAL_DIALOG_PATH
return ""

View File

@@ -22,11 +22,11 @@ func get_destination_scene() -> Scene:
)
func get_first_vending_machine_occurence(_level : int) -> int:
return 0
return 1
func get_ship_dialog_path(level : int, ship_in_space := true) -> String:
if level == 0:
return MERCURY_DEPARTURE_DIALOG_PATH
if ship_in_space and level == get_region_sequence_length() - 1:
if ship_in_space and is_run_finished(level + 1):
return VENUS_ARRIVAL_DIALOG_PATH
return ""

View File

@@ -19,7 +19,7 @@ func get_ship_dialog_path(_level : int, _ship_in_space := true) -> String:
#region ------------------ Run ------------------
func is_run_finished(level : int) -> bool:
return level == get_region_sequence_length()
return level == get_region_sequence_length() - 1
func get_region_sequence_length() -> int:
return 6
@@ -28,7 +28,7 @@ func get_first_vending_machine_occurence(_level : int) -> int:
return 2
func get_vending_machine_occurence(_level : int) -> int:
return 4
return 3
func get_first_cave_occurence(level : int) -> int:
return get_cave_occurence(level)
@@ -62,6 +62,25 @@ func get_story_modifiers_for_region(level : int) -> Array[RegionModifier]:
var dest_mod = DestinationModifier.new()
dest_mod.destination_scene = get_destination_scene()
modifiers.append(dest_mod)
var first_cave = get_first_cave_occurence(level)
var cave_occurence = get_cave_occurence(level)
if cave_occurence > 0 and level >= first_cave:
if (level - first_cave)%cave_occurence == 0:
modifiers.append(CaveModifier.new())
return modifiers
func get_gameplay_modifiers_for_region(level : int) -> Array[RegionModifier]:
var modifiers : Array[RegionModifier] = []
if need_gameplay_modifier(level):
var first_vending = get_first_vending_machine_occurence(level)
var vending_occurence = get_vending_machine_occurence(level)
if vending_occurence > 0 and level >= first_vending:
if (level - first_vending)%vending_occurence == 0:
modifiers.append(VendingMachineModifier.new())
return modifiers
func need_gameplay_modifier(level : int):

View File

@@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cqdyykjx6hdrr"
path="res://.godot/imported/cristal.svg-7e9a919e9dbc36092f14a8401b5f4888.ctex"
path.s3tc="res://.godot/imported/cristal.svg-7e9a919e9dbc36092f14a8401b5f4888.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/cristal.svg"
dest_files=["res://.godot/imported/cristal.svg-7e9a919e9dbc36092f14a8401b5f4888.ctex"]
dest_files=["res://.godot/imported/cristal.svg-7e9a919e9dbc36092f14a8401b5f4888.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,7 +38,7 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

23
common/icons/flag-2.svg Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="currentColor"
class="icon icon-tabler icons-tabler-filled icon-tabler-flag-2"
version="1.1"
id="svg2"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs2" />
<path
stroke="none"
d="M 0,0 H 24 V 24 H 0 Z"
fill="none"
id="path1" />
<path
d="m 19,4 a 1,1 0 0 1 0.993,0.883 L 20,5 v 9 a 1,1 0 0 1 -0.883,0.993 L 19,15 H 6 v 6 A 1,1 0 0 1 5.117,21.993 L 5,22 A 1,1 0 0 1 4.007,21.117 L 4,21 V 5 A 1,1 0 0 1 4.883,4.007 L 5,4 Z"
id="path2"
style="fill:#fefefe;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 701 B

View File

@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://uckrw5fan88k"
path="res://.godot/imported/flag-2.svg-b4658bfe95b153ec543e0e6f4d1176cb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://common/icons/flag-2.svg"
dest_files=["res://.godot/imported/flag-2.svg-b4658bfe95b153ec543e0e6f4d1176cb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

39
common/icons/hand-finger Normal file
View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="18.474695"
height="20.999998"
viewBox="0 0 18.474695 20.999998"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="icon icon-tabler icons-tabler-outline icon-tabler-hand-finger"
version="1.1"
id="svg5"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs5" />
<path
stroke="none"
d="m -2.525305,-2.0000007 h 24 V 21.999999 h -24 z"
fill="none"
id="path1" />
<path
d="M 5.474695,10.999999 V 2.4999993 a 1.5,1.5 0 0 1 3,0 v 7.5"
id="path2"
style="stroke:#ffffff;stroke-opacity:1" />
<path
d="m 8.474695,9.4999993 v -2 a 1.5,1.5 0 1 1 3,0 v 2.5"
id="path3"
style="stroke:#ffffff;stroke-opacity:1" />
<path
d="m 11.474695,8.4999993 a 1.5,1.5 0 0 1 3,0 v 1.5"
id="path4"
style="stroke:#ffffff;stroke-opacity:1" />
<path
d="m 14.474695,9.4999993 a 1.5,1.5 0 0 1 3,0 v 4.4999997 a 6,6 0 0 1 -6,6 h -2 0.208 a 6,6 0 0 1 -5.012,-2.7 69.74,69.74 0 0 1 -0.196,-0.3 c -0.312,-0.479 -1.407,-2.388 -3.286,-5.728 a 1.5,1.5 0 0 1 0.536,-2.0219997 1.867,1.867 0 0 1 2.28,0.28 l 1.47,1.4699997"
id="path5"
style="stroke:#ffffff;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="18.474695"
height="20.999998"
viewBox="0 0 18.474695 20.999998"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="icon icon-tabler icons-tabler-outline icon-tabler-hand-finger"
version="1.1"
id="svg5"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs5" />
<path
stroke="none"
d="m -2.525305,-2.0000007 h 24 V 21.999999 h -24 z"
fill="none"
id="path1" />
<path
d="M 5.474695,10.999999 V 2.4999993 a 1.5,1.5 0 0 1 3,0 v 7.5"
id="path2"
style="stroke:#ffffff;stroke-opacity:1" />
<path
d="m 8.474695,9.4999993 v -2 a 1.5,1.5 0 1 1 3,0 v 2.5"
id="path3"
style="stroke:#ffffff;stroke-opacity:1" />
<path
d="m 11.474695,8.4999993 a 1.5,1.5 0 0 1 3,0 v 1.5"
id="path4"
style="stroke:#ffffff;stroke-opacity:1" />
<path
d="m 14.474695,9.4999993 a 1.5,1.5 0 0 1 3,0 v 4.4999997 a 6,6 0 0 1 -6,6 h -2 0.208 a 6,6 0 0 1 -5.012,-2.7 69.74,69.74 0 0 1 -0.196,-0.3 c -0.312,-0.479 -1.407,-2.388 -3.286,-5.728 a 1.5,1.5 0 0 1 0.536,-2.0219997 1.867,1.867 0 0 1 2.28,0.28 l 1.47,1.4699997"
id="path5"
style="stroke:#ffffff;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b3vg3tipd4boh"
path="res://.godot/imported/hand-finger.svg-4b9fa57a07066292554e8fd7f7ad9dac.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://common/icons/hand-finger.svg"
dest_files=["res://.godot/imported/hand-finger.svg-4b9fa57a07066292554e8fd7f7ad9dac.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -12,16 +12,18 @@ static func get_tile_from_pos(coord) -> Vector2i:
floori(coord.y / (Region.TILE_SIZE)),
)
static func get_tiles_in_circle(center: Vector2, radius : float) -> Array[Vector2i]:
static func get_tiles_in_circle(center: Vector2,radius : float) -> Array[Vector2i]:
var tiles : Array[Vector2i] = []
var margin = ceili(radius * 0.5)
for x in range(
floori((center.x - radius/2.) / Region.TILE_SIZE),
ceili((center.x + radius/2.) / Region.TILE_SIZE),
floori((center.x - radius/2.) / Region.TILE_SIZE) - margin,
ceili((center.x + radius/2.) / Region.TILE_SIZE) + margin,
):
for y in range(
floori((center.y - radius/2.) / Region.TILE_SIZE),
ceili((center.y + radius/2.) / Region.TILE_SIZE),
floori((center.y - radius/2.) / Region.TILE_SIZE) - margin,
ceili((center.y + radius/2.) / Region.TILE_SIZE) + margin,
):
if is_tile_on_circle(Vector2i(x,y), center, radius):
tiles.append(Vector2i(x,y))
@@ -30,24 +32,29 @@ static func get_tiles_in_circle(center: Vector2, radius : float) -> Array[Vector
static func is_tile_on_circle(tile_coord : Vector2i, circle_center: Vector2, circle_radius : float) -> bool:
var absolute_tile_pos : Vector2 = tile_coord * Region.TILE_SIZE
# Loop over tile corners to know if the area collide
var corners : Array[Vector2] = []
for x in [0,1]:
for y in [0,1]:
corners.append(
absolute_tile_pos
+ Vector2.RIGHT * x * Region.TILE_SIZE
+ Vector2.DOWN * y * Region.TILE_SIZE
)
# Check if segment touch area
for i in range(4):
var a = corners[i%4]
var b = corners[(i+1)%4]
if segment_intersect_circle(a,b,circle_center,circle_radius):
return true
var tile_center = absolute_tile_pos + Vector2.ONE * Region.TILE_SIZE / 2
var tile_radius = roundf(Region.TILE_SIZE/2.)
return false
return pow(tile_center.x - circle_center.x, 2) + pow(tile_center.y - circle_center.y, 2) <= pow(tile_radius + circle_radius, 2)
# Loop over tile corners to know if the area collide
# var corners : Array[Vector2] = []
# for x in [0,1]:
# for y in [0,1]:
# corners.append(
# absolute_tile_pos
# + Vector2.RIGHT * x * Region.TILE_SIZE
# + Vector2.DOWN * y * Region.TILE_SIZE
# )
# # Check if segment touch area
# for i in range(4):
# var a = corners[i%4]
# var b = corners[(i+1)%4]
# if segment_intersect_circle(a,b,circle_center,circle_radius):
# return true
# return false
# Stolen here https://stackoverflow.com/questions/1073336/circle-line-segment-collision-detection-algorithm

View File

@@ -0,0 +1,3 @@

View File

@@ -0,0 +1 @@
uid://bebwor5r5nnov

View File

@@ -0,0 +1,9 @@
[gd_scene format=3 uid="uid://6or2rnjt5ixv"]
[ext_resource type="Script" uid="uid://bebwor5r5nnov" path="res://common/tools/scripts/test_tiles.gd" id="1_44t07"]
[node name="TestTiles" type="Node2D" unique_id=949540000]
script = ExtResource("1_44t07")
[node name="Grid" type="Node2D" parent="." unique_id=2109744474]
unique_name_in_owner = true

View File

@@ -0,0 +1,40 @@
shader_type canvas_item;
uniform float line_number = 6;
uniform vec4 line_color : source_color = vec4(1.);
uniform float line_thickness : hint_range(0.0, 0.01) = 0.001;
const mat3 sobel_x = mat3(
vec3( 1.0, 2.0, 1.0),
vec3( 0.0, 0.0, 0.0),
vec3(-1.0, -2.0, -1.0)
);
const mat3 sobel_y = mat3(
vec3(1.0, 0.0, -1.0),
vec3(2.0, 0.0, -2.0),
vec3(1.0, 0.0, -1.0)
);
float sample_quantized(sampler2D text, vec2 uv) {
return ceil(texture(text, uv).r * line_number) / line_number;
}
void fragment() {
float gx = 0.0;
float gy = 0.0;
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 3; y++) {
vec2 offset = vec2(float(x) - 1.0, float(y) - 1.0) * line_thickness;
float s = sample_quantized(TEXTURE, UV + offset);
gx += s * sobel_x[x][y];
gy += s * sobel_y[x][y];
}
}
float edge = length(vec2(gx, gy));
float line = step(0.0001, edge);
COLOR = vec4(line_color.rgb, line * line_color.a * COLOR.r);
}

View File

@@ -0,0 +1 @@
uid://bklafn6ulmkij