Skip to content

Commit

Permalink
Added gamma correction for vertex colour
Browse files Browse the repository at this point in the history
  • Loading branch information
SolomonBaarda committed Aug 30, 2023
1 parent 9382d92 commit 0865f73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inline half4 get_albedo_and_alpha_discard(const v2f input)
half4 base_color = _BaseColor;

#ifdef _VERTEX_COLOR
base_color.rgb *= input.vertexColor;
base_color.rgb *= pow(input.vertexColor, 2.2);
#endif

half4 albedo = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv) * base_color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ half4 frag(const v2f input) : SV_Target

half4 base_color = _BaseColor;
#ifdef _VERTEX_COLOR
base_color.xyz *= input.vertexColor;
base_color.xyz *= pow(input.vertexColor, 2.2);
#endif
const half3 sample_color = (SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv) * base_color).rgb;

Expand Down

0 comments on commit 0865f73

Please sign in to comment.