0 votes

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:
shadertype spatial;
render
mode blendmix,depthdrawopaque,cullback,diffuseburley,specularschlickggx;
uniform vec4 albedo : hint
color;
uniform sampler2D texturealbedo : hintalbedo;
uniform float specular: hintrange(0,1);
uniform float metallic: hint
range(0,1);
uniform float roughness : hintrange(0,1);
uniform float point
size : hintrange(0,128);
uniform sampler2D texture
roughness : hintwhite;
uniform vec4 roughness
texturechannel;
uniform vec3 uv1
scale;
uniform vec3 uv1offset;
uniform vec3 uv2
scale;
uniform vec3 uv2_offset;

//waves
uniform vec2 wavestrengh = 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 (wavestrengh.y * sin(pos.y * wavefrequency.y + time * timefactor.y)) + (wavestrengh.x * sin(pos.x * wavefrequency.x + time * timefactor.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;

}

Godot version 3.2.3
in Engine by (12 points)
edited by

Please add your shader code in your question :)

I put my shader in to my question.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.