This commit is contained in:
2026-10-13 18:42:20 +08:00
parent f296b643d4
commit ed1a9949c8
10 changed files with 159 additions and 1 deletions
+8
View File
@@ -0,0 +1,8 @@
[gd_resource type="GradientTexture1D" format=3 uid="uid://b3fs6dwpeg753"]
[sub_resource type="Gradient" id="Gradient_67fj6"]
offsets = PackedFloat32Array(0, 0.25754884, 0.6015394)
colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1)
[resource]
gradient = SubResource("Gradient_67fj6")
+20
View File
@@ -0,0 +1,20 @@
[gd_resource type="ShaderMaterial" format=3 uid="uid://ps5swh44egxb"]
[ext_resource type="Shader" uid="uid://bbs8x8ygec4lo" path="res://shader/outline.gdshader" id="1_vdkh7"]
[ext_resource type="Shader" uid="uid://wepsb3f7nni" path="res://shader/cel-shader-base.gdshader" id="2_63a2j"]
[ext_resource type="Texture2D" uid="uid://b353hjk53b3ob" path="res://assets/Food Pack - Low Poly Assets/Can_PaletteAssets.png" id="3_63a2j"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_m5gih"]
render_priority = 0
shader = ExtResource("1_vdkh7")
[resource]
render_priority = 0
next_pass = SubResource("ShaderMaterial_m5gih")
shader = ExtResource("2_63a2j")
shader_parameter/color = Color(0.7, 0.12, 0.86, 1)
shader_parameter/base_texture = ExtResource("3_63a2j")
shader_parameter/specular = Color(0.3, 0.3, 0.3, 0.5)
shader_parameter/fresnel = Color(0.2, 0.2, 0.2, 0.3)
shader_parameter/uv_scale = Vector2(1, 1)
shader_parameter/uv_offset = Vector2(0, 0)
+25
View File
@@ -0,0 +1,25 @@
@tool
extends Node3D
const ToonApply = preload("res://shader/toon_apply.gd")
@export var cartoon_material: ShaderMaterial:
set(value):
cartoon_material = value
_apply_materials()
func _ready() -> void:
_apply_materials()
func _apply_materials():
if not is_inside_tree():
return
# 未指定时默认使用 ToonApply
var mat: Material = cartoon_material if cartoon_material != null else ToonApply as Material
for node in find_children("*", "MeshInstance3D", true, false):
if node is MeshInstance3D:
node.material_override = mat
+1
View File
@@ -0,0 +1 @@
uid://cyabo07rc0216