My first 3D game with Godot 4.4

This commit is contained in:
2025-08-18 18:48:02 -04:00
commit aef6af1eca
89 changed files with 10495 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
shader_type spatial;
render_mode shadows_disabled, cull_back;
uniform vec3 albedo : source_color;
varying float voronoi_value;
uniform float progress = 0.0;
uniform float smoothness = 0.01;
uniform float ease = 2.0;
uniform float base_scale = 1.0;
uniform float deformation_scale = 1.0;
uniform float texture_offset = 0.0;
uniform float fresnel_offset = 1.0;
uniform float global_alpha = 1.0;
// Voronoi method credit:
// The MIT License
// Copyright © 2013 Inigo Quilez
// https://www.shadertoy.com/view/ldl3Dl
vec3 hash( vec3 x ){
x = vec3( dot(x,vec3(127.1,311.7, 74.7)),
dot(x,vec3(269.5,183.3,246.1)),
dot(x,vec3(113.5,271.9,124.6)));
return fract(sin(x)*43758.5453123);
}
vec3 voronoi( in vec3 x ){
vec3 p = floor( x );
vec3 f = fract( x );
float id = 0.0;
vec2 res = vec2( 100.0 );
for( int k=-1; k<=1; k++ )
for( int j=-1; j<=1; j++ )
for( int i=-1; i<=1; i++ ) {
vec3 b = vec3( float(i), float(j), float(k) );
vec3 r = vec3( b ) - f + hash( p + b );
float d = dot( r, r );
if( d < res.x ) {
id = dot( p+b, vec3(1.0,57.0,113.0 ) );
res = vec2( d, res.x );
} else if( d < res.y ) {
res.y = d;
}
}
return vec3( sqrt( res ), abs(id) );
}
float fresnel(vec3 normal, vec3 view, float amount){
return pow(1.0 - clamp(dot(normal, view), 0.0, 1.0), amount);
}
void vertex() {
float smooth_df = deformation_scale;
voronoi_value = voronoi(VERTEX + texture_offset).x;
VERTEX += NORMAL * (1.0 - pow(voronoi_value, ease)) * smooth_df;
VERTEX *= base_scale;
}
void fragment(){
ALBEDO = albedo;
EMISSION = albedo * 0.5;
ALPHA = 1.0 - fresnel(NORMAL, VIEW, 2.0 * fresnel_offset);
ALPHA *= global_alpha;
}

View File

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

View File

@@ -0,0 +1,17 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://dr7gyunhpjiwf"]
[ext_resource type="Shader" path="res://mob/smoke_puff/material/inner_smoke.gdshader" id="1_6ucfb"]
[resource]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("1_6ucfb")
shader_parameter/albedo = Color(1, 0.537255, 0.792157, 1)
shader_parameter/progress = 0.0
shader_parameter/smoothness = 0.01
shader_parameter/ease = 2.0
shader_parameter/base_scale = 1.1
shader_parameter/deformation_scale = 1.0
shader_parameter/texture_offset = 0.1
shader_parameter/fresnel_offset = 0.5
shader_parameter/global_alpha = 0.0

View File

@@ -0,0 +1,64 @@
shader_type spatial;
render_mode shadows_disabled, cull_disabled;
uniform vec3 albedo : source_color;
varying float voronoi_value;
uniform float progress = 0.0;
uniform float smoothness = 0.01;
uniform float ease = 2.0;
uniform float base_scale = 1.0;
uniform float deformation_scale = 1.0;
uniform float texture_offset = 0.0;
// Voronoi method credit:
// The MIT License
// Copyright © 2013 Inigo Quilez
// https://www.shadertoy.com/view/ldl3Dl
vec3 hash( vec3 x ){
x = vec3( dot(x,vec3(127.1,311.7, 74.7)),
dot(x,vec3(269.5,183.3,246.1)),
dot(x,vec3(113.5,271.9,124.6)));
return fract(sin(x)*43758.5453123);
}
vec3 voronoi( in vec3 x ){
vec3 p = floor( x );
vec3 f = fract( x );
float id = 0.0;
vec2 res = vec2( 100.0 );
for( int k=-1; k<=1; k++ )
for( int j=-1; j<=1; j++ )
for( int i=-1; i<=1; i++ ) {
vec3 b = vec3( float(i), float(j), float(k) );
vec3 r = vec3( b ) - f + hash( p + b );
float d = dot( r, r );
if( d < res.x ) {
id = dot( p+b, vec3(1.0,57.0,113.0 ) );
res = vec2( d, res.x );
} else if( d < res.y ) {
res.y = d;
}
}
return vec3( sqrt( res ), abs(id) );
}
void vertex() {
float smooth_df = deformation_scale;
voronoi_value = voronoi(VERTEX + texture_offset).x;
VERTEX += NORMAL * (1.0 - pow(voronoi_value, ease)) * smooth_df;
VERTEX *= base_scale;
}
void fragment(){
ALBEDO = albedo;
EMISSION = albedo * 0.5;
ALPHA = smoothstep(progress - smoothness, progress + smoothness, voronoi_value);
ALPHA_SCISSOR_THRESHOLD = 0.5;
}

View File

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

View File

@@ -0,0 +1,15 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://ctnipgxo3l72h"]
[ext_resource type="Shader" path="res://mob/smoke_puff/material/outer_smoke.gdshader" id="1_0emiy"]
[resource]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("1_0emiy")
shader_parameter/albedo = Color(0.937255, 0.698039, 1, 1)
shader_parameter/progress = 1.8
shader_parameter/smoothness = 0.1
shader_parameter/ease = 3.0
shader_parameter/base_scale = 1.2
shader_parameter/deformation_scale = 1.5
shader_parameter/texture_offset = -0.5