rj-action-library/Runtime/Shading/Shaders/Effects/RainbowGlow/RainbowGlow.gdshader

49 lines
1.5 KiB
Plaintext
Raw Normal View History

2025-01-19 20:35:51 +00:00
// NOTE: Shader automatically converted from Godot Engine 4.3.stable.mono's StandardMaterial3D.
shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_burley, specular_schlick_ggx, unshaded;
#include "res://addons/rokojori_action_library/Runtime/Shading/Library/Math.gdshaderinc"
#include "res://addons/rokojori_action_library/Runtime/Shading/Library/Transform.gdshaderinc"
#include "res://addons/rokojori_action_library/Runtime/Shading/Library/Noise.gdshaderinc"
uniform vec4 albedo : source_color;
uniform sampler2D texture_albedo : source_color, filter_linear_mipmap, repeat_enable;
uniform float colorScale = 1;
uniform float normalWrap = 1;
uniform float normalShift = 0;
uniform float weight = 1;
uniform float normalWrap2 = 1;
uniform float normalShift2 = 0;
uniform float weight2 = 1;
uniform float normalWrap3 = 1;
uniform float normalShift3 = 0;
uniform float weight3 = 1;
varying vec3 worldNormal;
void vertex()
{
worldNormal = NORMAL * MODEL_NORMAL_MATRIX;
}
void fragment()
{
float dotP = mod( dot( worldNormal, VIEW ) * normalWrap + normalShift, 1 );
float dotP2 = mod( dot( -NORMAL, -VIEW ) * normalWrap2 + normalShift2, 1 );
float dotP3 = mod( dot( -NORMAL, -VIEW ) * normalWrap3 + normalShift3, 1 );
vec4 albedo_tex = texture( texture_albedo, vec2( dotP, 0 ) ) * weight
+ texture( texture_albedo, vec2( dotP2, 0 ) ) * weight2
+ texture( texture_albedo, vec2( dotP3, 0 ) ) * weight3;
ALBEDO = albedo.rgb * albedo_tex.rgb * colorScale;
}