Item Highlight Shader

I been writing a lot of shaders just forgot share here, so here i am. Made this item highlight shader for my game. 

To use it, Just increasee the highlight intensity and it will work

Shader code
shader_type spatial;

uniform vec4 highlight_color : source_color = vec4(1.0, 1.0, 0.0, 1.0);
uniform float highlight_power : hint_range(0.0, 10.0) = 3.0;
uniform float highlight_intensity : hint_range(0.0, 1.0) = 0.0;
uniform float rim_power : hint_range(1.0, 10.0) = 3.0;
uniform sampler2D texture_albedo : source_color;

void fragment() {
    vec4 albedo_tex = texture(texture_albedo, UV);

    float rim = 1.0 - dot(NORMAL, VIEW);
    rim = pow(rim, rim_power);

    vec4 final_color = albedo_tex;
    final_color.rgb = mix(final_color.rgb, highlight_color.rgb, rim * highlight_intensity);

    ALBEDO = final_color.rgb;
    EMISSION = highlight_color.rgb * rim * highlight_intensity * highlight_power;}
Tags
#item_highlight #item #highlight
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from Miisannn

Bush Shader Code

Ripple Gradient Shader

Ripple Gradient Shaderww

Related shaders

3D Item Highlighter (with Angle Adjustment!)

Item Highlighter

Shield Shader with Intersection Highlight

Subscribe
Notify of
guest

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Olivier
Olivier
2 months ago

nice shader! where did u learn to code shaders tho? i cant find any tutorials for glsl anywhere

snibidiSnab
snibidiSnab
23 days ago

forgot the } tho 🙂