You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
2.1 KiB
58 lines
2.1 KiB
[gd_resource type="ShaderMaterial" load_steps=3 format=2]
|
|
|
|
[ext_resource path="res://effects_shared/bullet/BlastTexture.png" type="Texture" id=1]
|
|
|
|
[sub_resource type="Shader" id=1]
|
|
code = "shader_type spatial;
|
|
render_mode blend_mix,depth_draw_never,cull_back,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 int particles_anim_h_frames;
|
|
uniform int particles_anim_v_frames;
|
|
uniform bool particles_anim_loop;
|
|
uniform vec3 uv1_scale;
|
|
uniform vec3 uv1_offset;
|
|
uniform vec3 uv2_scale;
|
|
uniform vec3 uv2_offset;
|
|
|
|
|
|
void vertex() {
|
|
UV=UV*uv1_scale.xy+uv1_offset.xy;
|
|
mat4 mat_world = mat4(normalize(CAMERA_MATRIX[0])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[1])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[2])*length(WORLD_MATRIX[2]),WORLD_MATRIX[3]);
|
|
mat_world = mat_world * mat4( vec4(cos(INSTANCE_CUSTOM.x),-sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0),vec4(0.0, 0.0, 1.0, 0.0),vec4(0.0, 0.0, 0.0, 1.0));
|
|
MODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat_world;
|
|
}
|
|
|
|
|
|
void fragment() {
|
|
vec2 base_uv = UV;
|
|
vec4 albedo_tex = texture(texture_albedo,base_uv);
|
|
albedo_tex *= COLOR;
|
|
ALBEDO = albedo.rgb * albedo_tex.rgb * COLOR.rgb;
|
|
EMISSION = albedo.rgb * albedo.a * 1.0 * COLOR.rgb * COLOR.a;
|
|
METALLIC = metallic;
|
|
ROUGHNESS = roughness;
|
|
SPECULAR = specular;
|
|
ALPHA = albedo_tex.a * COLOR.a;
|
|
}
|
|
"
|
|
|
|
[resource]
|
|
shader = SubResource( 1 )
|
|
shader_param/albedo = Color( 0, 1, 1, 1 )
|
|
shader_param/specular = 0.0
|
|
shader_param/metallic = 0.0
|
|
shader_param/roughness = 1.0
|
|
shader_param/point_size = 1.0
|
|
shader_param/particles_anim_h_frames = 1
|
|
shader_param/particles_anim_v_frames = 1
|
|
shader_param/particles_anim_loop = false
|
|
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/texture_albedo = ExtResource( 1 )
|
|
|