How to increase sprite brightness in 2D HDR

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

I followed tutorial for hdr in 2D and it works great until I need to add something brighter than current most bright sprite e.g. sprite on the left have maximum value of modulate, I want to add something brighter

To decrease sprite brightness I can use modulate property but how to increase it?

Wow that looks awesome. Could you share the tutorial you watch to create that effect, please.

sensei_godot | 2018-03-28 04:41

technically It is not tutorial, its example from godot asset library this one

Bartosz | 2018-03-28 19:12

:bust_in_silhouette: Reply From: Löne

Since modulate multiplies the colors, there is no way the render gets brighter than the original sprite. You have two solutions:

  • produce a brighter version of the sprite in any image edition software
  • use a shader

If you want to use a shader, here is a sample shader that should do what you’re thinking of:

shader_type canvas_item;

uniform float bright_amount;

void fragment() {
    vec4 c = texture(TEXTURE, UV);
    c.rgb += vec3(bright_amount);
    COLOR = c;
}

Thansk for answer. I’ve found that shader solution is more flexible in this particular scenario, also to be able to apply material to a packed scene I needed to set Use Parent Material property on every node in chain

Bartosz | 2018-03-18 13:31