First work on dialogic, resized guild, and started implementing portraits.

This commit is contained in:
2025-08-14 10:26:24 -04:00
parent 95a7db036b
commit 3aeb3d44e6
959 changed files with 47688 additions and 46 deletions

View File

@@ -0,0 +1,7 @@
extends "res://addons/dialogic/Modules/Background/Transitions/simple_push_transitions.gd"
func _fade() -> void:
var shader := setup_push_shader()
shader.set_shader_parameter('final_offset', Vector2.DOWN)
tween_shader_progress().set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT)

View File

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

View File

@@ -0,0 +1,7 @@
extends "res://addons/dialogic/Modules/Background/Transitions/simple_push_transitions.gd"
func _fade() -> void:
var shader := setup_push_shader()
shader.set_shader_parameter('final_offset', Vector2.LEFT)
tween_shader_progress().set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT)

View File

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

View File

@@ -0,0 +1,7 @@
extends "res://addons/dialogic/Modules/Background/Transitions/simple_push_transitions.gd"
func _fade() -> void:
var shader := setup_push_shader()
shader.set_shader_parameter('final_offset', Vector2.RIGHT)
tween_shader_progress().set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT)

View File

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

View File

@@ -0,0 +1,7 @@
extends "res://addons/dialogic/Modules/Background/Transitions/simple_push_transitions.gd"
func _fade() -> void:
var shader := setup_push_shader()
shader.set_shader_parameter('final_offset', Vector2.UP)
tween_shader_progress().set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT)

View File

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

View File

@@ -0,0 +1,13 @@
extends DialogicBackgroundTransition
func _fade() -> void:
var shader := set_shader()
shader.set_shader_parameter("wipe_texture", load(this_folder.path_join("simple_fade.tres")))
shader.set_shader_parameter("feather", 1)
shader.set_shader_parameter("previous_background", prev_texture)
shader.set_shader_parameter("next_background", next_texture)
tween_shader_progress()

View File

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

View File

@@ -0,0 +1,8 @@
[gd_resource type="GradientTexture2D" load_steps=2 format=3 uid="uid://qak7mr560k0i"]
[sub_resource type="Gradient" id="Gradient_skd6w"]
offsets = PackedFloat32Array(1)
colors = PackedColorArray(0.423651, 0.423651, 0.423651, 1)
[resource]
gradient = SubResource("Gradient_skd6w")

View File

@@ -0,0 +1,8 @@
extends "res://addons/dialogic/Modules/Background/Transitions/simple_swipe_transitions.gd"
func _fade() -> void:
var shader := setup_swipe_shader()
var texture: GradientTexture2D = shader.get_shader_parameter('wipe_texture')
texture.fill_from = Vector2.DOWN
texture.fill_to = Vector2.RIGHT
tween_shader_progress()

View File

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

View File

@@ -0,0 +1,10 @@
extends "res://addons/dialogic/Modules/Background/Transitions/simple_swipe_transitions.gd"
func _fade() -> void:
var shader := setup_swipe_shader()
var texture: GradientTexture2D = shader.get_shader_parameter('wipe_texture')
texture.fill_from = Vector2.ZERO
texture.fill_to = Vector2.RIGHT
tween_shader_progress()

View File

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

View File

@@ -0,0 +1,8 @@
extends "res://addons/dialogic/Modules/Background/Transitions/simple_swipe_transitions.gd"
func _fade() -> void:
var shader := setup_swipe_shader()
var texture: GradientTexture2D = shader.get_shader_parameter('wipe_texture')
texture.fill_from = Vector2.RIGHT
texture.fill_to = Vector2.ZERO
tween_shader_progress()

View File

@@ -0,0 +1 @@
uid://7e4qyyr6wnuo

View File

@@ -0,0 +1,56 @@
class_name DialogicBackgroundTransition
extends Node
## Helper
var this_folder: String = get_script().resource_path.get_base_dir()
## Set before _fade() is called, will be the root node of the previous bg scene.
var prev_scene: Node
## Set before _fade() is called, will be the viewport texture of the previous bg scene.
var prev_texture: ViewportTexture
## Set before _fade() is called, will be the root node of the upcoming bg scene.
var next_scene: Node
## Set before _fade() is called, will be the viewport texture of the upcoming bg scene.
var next_texture: ViewportTexture
## Set before _fade() is called, will be the requested time for the fade
var time: float
## Set before _fade() is called, will be the background holder (TextureRect)
var bg_holder: DialogicNode_BackgroundHolder
signal transition_finished
## To be overridden by transitions
func _fade() -> void:
pass
func set_shader(path_to_shader:String=DialogicUtil.get_module_path('Background').path_join("Transitions/default_transition_shader.gdshader")) -> ShaderMaterial:
if bg_holder:
if path_to_shader.is_empty():
bg_holder.material = null
bg_holder.color = Color.TRANSPARENT
return null
bg_holder.material = ShaderMaterial.new()
bg_holder.material.shader = load(path_to_shader)
return bg_holder.material
return null
func tween_shader_progress(_progress_parameter:="progress") -> PropertyTweener:
if !bg_holder:
return
if !bg_holder.material is ShaderMaterial:
return
bg_holder.material.set_shader_parameter("progress", 0.0)
var tween := create_tween()
var tweener := tween.tween_property(bg_holder, "material:shader_parameter/progress", 1.0, time).from(0.0)
tween.tween_callback(emit_signal.bind('transition_finished'))
return tweener

View File

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

View File

@@ -0,0 +1,36 @@
shader_type canvas_item;
// Indicates how far the transition is (0 start, 1 end).
uniform float progress : hint_range(0.0, 1.0);
// The previous background, transparent if there was none.
uniform sampler2D previous_background : source_color, hint_default_transparent;
// The next background, transparent if there is none.
uniform sampler2D next_background : source_color, hint_default_transparent;
// The texture used to determine how far along the progress has to be for bending in the new background.
uniform sampler2D wipe_texture : source_color;
// The size of the trailing smear of the transition.
uniform float feather : hint_range(0.0, 1.0, 0.0001) = 0.1;
// Determines if the wipe texture should keep it's aspect ratio when scaled to the screen's size.
uniform bool keep_aspect_ratio = false;
void fragment() {
vec2 frag_coord = UV;
if(keep_aspect_ratio) {
vec2 ratio = (SCREEN_PIXEL_SIZE.x > SCREEN_PIXEL_SIZE.y) // determine how to scale
? vec2(SCREEN_PIXEL_SIZE.y / SCREEN_PIXEL_SIZE.x, 1) // fit to width
: vec2(1, SCREEN_PIXEL_SIZE.x / SCREEN_PIXEL_SIZE.y); // fit to height
frag_coord *= ratio;
frag_coord += ((vec2(1,1) - ratio) / 2.0);
}
// get the blend factor between the previous and next background.
float alpha = (texture(wipe_texture, frag_coord).r) - progress;
float blend_factor = 1. - smoothstep(0., feather, alpha + (feather * (1. -progress)));
vec4 old_frag = texture(previous_background, UV);
vec4 new_frag = texture(next_background, UV);
COLOR = mix(old_frag, new_frag, blend_factor);
}

View File

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

View File

@@ -0,0 +1,17 @@
shader_type canvas_item;
uniform vec2 final_offset = vec2(0,-1);
uniform float progress: hint_range(0.0, 1.0);
uniform sampler2D previous_background: source_color, hint_default_transparent;
uniform sampler2D next_background: source_color, hint_default_transparent;
void fragment() {
vec2 uv = UV + final_offset * progress*vec2(-1, -1);
if (uv.x < 1.0 && uv.x > 0.0 && uv.y < 1.0 && uv.y > 0.0){
COLOR = texture(previous_background, uv, 1);
} else {
COLOR = texture(next_background, uv-final_offset*vec2(-1,-1));
}
}

View File

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

View File

@@ -0,0 +1,9 @@
extends DialogicBackgroundTransition
func setup_push_shader() -> ShaderMaterial:
var shader := set_shader(DialogicUtil.get_module_path('Background').path_join("Transitions/push_transition_shader.gdshader"))
shader.set_shader_parameter("previous_background", prev_texture)
shader.set_shader_parameter("next_background", next_texture)
return shader

View File

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

View File

@@ -0,0 +1,7 @@
[gd_resource type="GradientTexture2D" load_steps=2 format=3 uid="uid://cweb3y3xc4uw0"]
[sub_resource type="Gradient" id="Gradient_skd6w"]
colors = PackedColorArray(0, 0, 0, 1, 0.991164, 0.991164, 0.991164, 1)
[resource]
gradient = SubResource("Gradient_skd6w")

View File

@@ -0,0 +1,14 @@
extends DialogicBackgroundTransition
func setup_swipe_shader() -> ShaderMaterial:
var shader := set_shader()
shader.set_shader_parameter("wipe_texture", load(
DialogicUtil.get_module_path('Background').path_join("Transitions/simple_swipe_gradient.tres")
))
shader.set_shader_parameter("feather", 0.3)
shader.set_shader_parameter("previous_background", prev_texture)
shader.set_shader_parameter("next_background", next_texture)
return shader

View File

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