Shader reflections problem when alpha.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sylbur81PL

Hi, I made a shader for water. It is reflective and made reflections from another objects. Problem is when I try to make an alpha channel then reflections are gone. How to fix it?

Shader:
shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular: hint_range(0,1);
uniform float metallic: hint_range(0,1);
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform sampler2D texture_roughness : hint_white;
uniform vec4 roughness_texture_channel;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;

//waves
uniform vec2 wave_strengh = vec2(0.5, 0.25);
uniform vec2 wave_frequency = vec2(12.0, 12.0);
uniform vec2 time_factor = vec2(1.0, 2.0);

float waves(vec2 pos, float time){
return (wave_strengh.y * sin(pos.y * wave_frequency.y + time * time_factor.y)) + (wave_strengh.x * sin(pos.x * wave_frequency.x + time * time_factor.x));
}

void vertex(){
VERTEX.y += waves(VERTEX.xy, TIME);
}

//void vertex() {
//UV=UV*uv1_scale.xy+uv1_offset.xy;}

void fragment() {


vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
ALBEDO = albedo.rgb * albedo_tex.rgb ;
//ALPHA = albedo.a;
METALLIC = metallic;
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
SPECULAR = specular;

}

Please add your shader code in your question :slight_smile:

clemens.tolboom | 2021-03-25 09:34

I put my shader in to my question.

Sylbur81PL | 2021-03-25 15:46