They are actually already some literals with the `f` suffix that are in our shader codebase and we never had problem in the past 5 years (or even 8 years). So I think it is safe to do and improves convergence of codestyles. Pull Request: https://projects.blender.org/blender/blender/pulls/137352
10 lines
230 B
GLSL
10 lines
230 B
GLSL
/* SPDX-FileCopyrightText: 2019 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
void invert(float fac, vec4 col, out vec4 outcol)
|
|
{
|
|
outcol.xyz = mix(col.xyz, vec3(1.0f) - col.xyz, fac);
|
|
outcol.w = col.w;
|
|
}
|