Skip to content

Commit

Permalink
✨ Replace CIELAB with Oklab
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Oct 9, 2023
1 parent 5112914 commit f9e49f2
Show file tree
Hide file tree
Showing 31 changed files with 80 additions and 1,669 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

float main(CIELAB Color)
float main(Oklab Color)
{
return Color.x;
}
2 changes: 1 addition & 1 deletion Nodes/11 Image Modifier (Post Process)/Color Ramp.clbnode
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

INPUT Gradient 'Color Gradient';

CIELAB_PremultipliedA main(float Greyscale)
Oklab_PremultipliedA main(float Greyscale)
{
return 'Color Gradient'(Greyscale);
}
4 changes: 2 additions & 2 deletions Nodes/11 Image Modifier (Post Process)/Film Grain.clbnode
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro
// Inspired by https://youtube.com/shorts/mQp_Klk2gJs?feature=share

INPUT UV->CIELAB 'Image';
INPUT UV->Oklab 'Image';
INPUT float 'Intensity';

CIELAB main(UV uv)
Oklab main(UV uv)
{
vec2 noise_uv = to_view_space(uv);

Expand Down
2 changes: 1 addition & 1 deletion Nodes/11 Image Modifier (Post Process)/Mask Image.clbnode
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

INPUT float 'Mask';

CIELAB_StraightA main(CIELAB_StraightA Image)
Oklab_StraightA main(Oklab_StraightA Image)
{
Image.a *= 'Mask';
return Image;
Expand Down
6 changes: 3 additions & 3 deletions Nodes/11 Image Modifier (Post Process)/Render N Times.clbnode
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

INPUT UV->CIELAB_PremultipliedA 'Image';
INPUT UV->Oklab_PremultipliedA 'Image';
INPUT int 'N';
INPUT(CIELAB_PremultipliedA, CIELAB_PremultipliedA)->CIELAB_PremultipliedA 'Blend Mode';
INPUT(Oklab_PremultipliedA, Oklab_PremultipliedA)->Oklab_PremultipliedA 'Blend Mode';

OUTPUT float 'Index';

CIELAB_PremultipliedA main(UV uv)
Oklab_PremultipliedA main(UV uv)
{
vec4 color = vec4(0.);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

INPUT float 'Opacity';

CIELAB_StraightA main(CIELAB_StraightA Image)
Oklab_StraightA main(Oklab_StraightA Image)
{
Image.a = 'Opacity';
return Image;
Expand Down
6 changes: 3 additions & 3 deletions Nodes/11 Image Modifier (Post Process)/Vignetting.clbnode
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
INPUT float 'Strength';
INPUT float 'Radius';
INPUT UV->CIELAB 'Image';
INPUT CIELAB 'Color';
INPUT UV->Oklab 'Image';
INPUT Oklab 'Color';
INPUT float 'Mask';

CIELAB main(UV uv)
Oklab main(UV uv)
{
vec3 in_color = 'Image'(uv);

Expand Down
4 changes: 2 additions & 2 deletions Nodes/12 Image Blend/Over.clbnode
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// To learn how to write nodes, see https://coollab-art.com/Tutorials/Writing%20Nodes/Intro

INPUT CIELAB_PremultipliedA 'Background';
INPUT Oklab_PremultipliedA 'Background';

CIELAB_PremultipliedA main(CIELAB_PremultipliedA Foreground)
Oklab_PremultipliedA main(Oklab_PremultipliedA Foreground)
{
return Foreground + (1. - Foreground.a) * 'Background';
}
6 changes: 3 additions & 3 deletions Nodes/12 Image Blend/Switcher.clbnode
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
INPUT UV->CIELAB_PremultipliedA 'Image 1';
INPUT UV->CIELAB_PremultipliedA 'Image 2';
INPUT UV->Oklab_PremultipliedA 'Image 1';
INPUT UV->Oklab_PremultipliedA 'Image 2';
INPUT float 'Duration of one image';
INPUT float 'Transition duration';
INPUT float 'Time';

CIELAB_PremultipliedA main(UV uv)
Oklab_PremultipliedA main(UV uv)
{
float t = 'Time' / 'Duration of one image';
int index = int(floor(t));
Expand Down
8 changes: 4 additions & 4 deletions Nodes/33 Shape Renderer/Debug.clbnode
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
INPUT CIELAB 'Shape Color';
INPUT CIELAB 'Background Color';
INPUT CIELAB 'Border Color';
INPUT Oklab 'Shape Color';
INPUT Oklab 'Background Color';
INPUT Oklab 'Border Color';

// IQ's SDF debug view https://www.shadertoy.com/view/3ltSW2
CIELAB main(SignedDistance Shape)
Oklab main(SignedDistance Shape)
{
vec3 col = (Shape > 0.0) ? 'Background Color' : 'Shape Color';
col *= 1.0 - exp(-4.0 * abs(Shape)); // Darken border
Expand Down
4 changes: 2 additions & 2 deletions Nodes/70 Input/Sample Image.clbnode
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
INPUT UV->CIELAB_PremultipliedA 'Image';
INPUT UV->Oklab_PremultipliedA 'Image';
INPUT Point2D 'Position';

CIELAB_PremultipliedA main()
Oklab_PremultipliedA main()
{
return 'Image'('Position');
}
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
- ✨ Added an Output window that you can project during live shows, while still having your View window on your screen to move the camera and the widgets. To open this window, go in the `Commands` menu and select `Open output window`.
- ✨ Added "Load Backup" in case you accidentally refused to save your unsaved changes.
- 🐛 Fix: the transparency information was sometimes getting lost between nodes.
- 👩‍💻 Replaced CIELAB with Oklab
- 👩‍💻 Replaced HSLuv with Okhsl

## 🐣beta-8

Expand Down
4 changes: 2 additions & 2 deletions src/Module_Nodes/CodeGen_default_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static auto maybe_generate_default(FunctionSignature current_signature, std::str
auto gen_default_function(FunctionSignature signature, CodeGenContext& context)
-> ExpectedFunctionName
{
using fmt::literals:: operator""_a;
using fmt::literals::operator""_a;
static constexpr std::string_view signed_to_float = "antialised_step(sd)";
{
auto const func = maybe_generate_default(
Expand Down Expand Up @@ -213,7 +213,7 @@ vec2 default_curve/*coollabdef*/(float t)

{
auto const func = maybe_generate_default(
FunctionSignature{.from = PrimitiveType::CIELAB_PremultipliedA, .to = PrimitiveType::CIELAB_PremultipliedA, .arity = 2},
FunctionSignature{.from = PrimitiveType::Oklab_PremultipliedA, .to = PrimitiveType::Oklab_PremultipliedA, .arity = 2},
"default_blend_mode", R"STR(
vec4 default_blend_mode/*coollabdef*/(vec4 over, vec4 under)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Module_Nodes/generated/cpp_type_as_string_cases.inl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ case PrimitiveType::Direction2D: return "Direction2D";
case PrimitiveType::Void: return "Void";
case PrimitiveType::Any: return "Any";
case PrimitiveType::RayMarchRes: return "RayMarchRes";
case PrimitiveType::CIELAB: return "CIELAB";
case PrimitiveType::CIELAB_PremultipliedA: return "CIELAB_PremultipliedA";
case PrimitiveType::CIELAB_StraightA: return "CIELAB_StraightA";
case PrimitiveType::Oklab: return "Oklab";
case PrimitiveType::Oklab_PremultipliedA: return "Oklab_PremultipliedA";
case PrimitiveType::Oklab_StraightA: return "Oklab_StraightA";
Expand Down
3 changes: 0 additions & 3 deletions src/Module_Nodes/generated/glsl_type_as_string_cases.inl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ case PrimitiveType::Direction2D: return "/*Direction2D*/ vec2";
case PrimitiveType::Void: return "/*Void*/ void";
case PrimitiveType::Any: return "/*Any*/ ERROR the Any type should have been converted earlier in the compilation process.";
case PrimitiveType::RayMarchRes: return "/*RayMarchRes*/ RayMarchRes";
case PrimitiveType::CIELAB: return "/*CIELAB*/ vec3";
case PrimitiveType::CIELAB_PremultipliedA: return "/*CIELAB_PremultipliedA*/ vec4";
case PrimitiveType::CIELAB_StraightA: return "/*CIELAB_StraightA*/ vec4";
case PrimitiveType::Oklab: return "/*Oklab*/ vec3";
case PrimitiveType::Oklab_PremultipliedA: return "/*Oklab_PremultipliedA*/ vec4";
case PrimitiveType::Oklab_StraightA: return "/*Oklab_StraightA*/ vec4";
Expand Down
2 changes: 0 additions & 2 deletions src/Module_Nodes/generated/has_an_alpha_channel.inl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* Instead, go to "gen_primitive_types.py" and edit the "has_an_alpha_channel" function there.
* -----------------------------------------------------------------------------
*/
case PrimitiveType::CIELAB_StraightA:
case PrimitiveType::CIELAB_PremultipliedA:
case PrimitiveType::Oklab_StraightA:
case PrimitiveType::Oklab_PremultipliedA:
case PrimitiveType::LinearRGB_StraightA:
Expand Down
1 change: 0 additions & 1 deletion src/Module_Nodes/generated/has_straight_alpha_channel.inl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Instead, go to "gen_primitive_types.py" and edit the "has_straight_alpha_channel" function there.
* -----------------------------------------------------------------------------
*/
case PrimitiveType::CIELAB_StraightA:
case PrimitiveType::Oklab_StraightA:
case PrimitiveType::LinearRGB_StraightA:
case PrimitiveType::sRGB_StraightA:
Expand Down
Loading

0 comments on commit f9e49f2

Please sign in to comment.