80 lines
2.4 KiB
Plaintext
80 lines
2.4 KiB
Plaintext
[gd_resource type="ShaderMaterial" load_steps=5 format=2]
|
||
|
||
[ext_resource path="res://assets/meat_creek/meat_platform_texture.tres" type="Texture" id=1]
|
||
|
||
[sub_resource type="Shader" id=1]
|
||
code = "// NOTE: Shader automatically converted from Godot Engine 3.5.1.stable.mono's SpatialMaterial.
|
||
|
||
shader_type spatial;
|
||
render_mode world_vertex_coords,async_visible,blend_mix,depth_draw_opaque,cull_disabled,diffuse_burley,specular_schlick_ggx;
|
||
uniform vec4 albedo : hint_color;
|
||
uniform sampler2D texture_albedo : hint_albedo;
|
||
uniform float specular;
|
||
uniform float metallic;
|
||
uniform float roughness : hint_range(0,1);
|
||
uniform float point_size : hint_range(0,128);
|
||
uniform vec3 uv1_scale;
|
||
uniform vec3 uv1_offset;
|
||
uniform vec3 uv2_scale;
|
||
uniform vec3 uv2_offset;
|
||
|
||
uniform sampler2D bubble_curve;
|
||
uniform float bubble_speed : hint_range(0.0, 20.0, 0.1);
|
||
uniform float seed;
|
||
|
||
float random( vec2 p )
|
||
{
|
||
// e^pi (Gelfond's constant)
|
||
// 2^sqrt(2) (Gelfond–Schneider constant)
|
||
vec2 K1 = vec2( 23.14069263277926, 2.665144142690225 );
|
||
|
||
//return fract( cos( mod( 12345678., 256. * dot(p,K1) ) ) ); // ver1
|
||
//return fract(cos(dot(p,K1)) * 123456.); // ver2
|
||
return fract(cos(dot(p,K1)) * 12345.6789); // ver3
|
||
}
|
||
|
||
void vertex() {
|
||
UV=UV*uv1_scale.xy+uv1_offset.xy;
|
||
float x = mod(TIME+seed, bubble_speed) / bubble_speed;
|
||
float w = texture(bubble_curve, vec2(x, 0.0)).r;
|
||
VERTEX.y -= w;
|
||
}
|
||
|
||
|
||
|
||
|
||
void fragment() {
|
||
vec2 base_uv = UV;
|
||
vec4 albedo_tex = texture(texture_albedo,base_uv);
|
||
albedo_tex *= COLOR;
|
||
ALBEDO = albedo.rgb * albedo_tex.rgb;
|
||
METALLIC = metallic;
|
||
ROUGHNESS = roughness;
|
||
SPECULAR = specular;
|
||
}
|
||
"
|
||
|
||
[sub_resource type="Curve" id=2]
|
||
max_value = 0.3
|
||
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.505236, 0.0821591 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ]
|
||
|
||
[sub_resource type="CurveTexture" id=3]
|
||
curve = SubResource( 2 )
|
||
|
||
[resource]
|
||
resource_name = "creek_platform_material"
|
||
shader = SubResource( 1 )
|
||
shader_param/albedo = Color( 1, 1, 1, 1 )
|
||
shader_param/specular = 0.5
|
||
shader_param/metallic = 0.0
|
||
shader_param/roughness = 0.0
|
||
shader_param/point_size = 1.0
|
||
shader_param/uv1_scale = Vector3( 1, 1, 1 )
|
||
shader_param/uv1_offset = Vector3( 0, 0, 0 )
|
||
shader_param/uv2_scale = Vector3( 1, 1, 1 )
|
||
shader_param/uv2_offset = Vector3( 0, 0, 0 )
|
||
shader_param/bubble_speed = 3.0
|
||
shader_param/seed = null
|
||
shader_param/texture_albedo = ExtResource( 1 )
|
||
shader_param/bubble_curve = SubResource( 3 )
|