-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🟦 [Nodes] Handle alpha in some nodes + added LED Screen
- Loading branch information
1 parent
5a30304
commit 537de8a
Showing
5 changed files
with
104 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
INPUT UV->sRGB_StraightA 'Image'; | ||
INPUT float 'BOB'; | ||
INPUT float 'BAB'; | ||
INPUT float 'Off'; | ||
|
||
float sat(float x) | ||
{ | ||
return clamp(x, 0., 1.); | ||
} | ||
vec3 sat(vec3 v) | ||
{ | ||
return vec3(sat(v.x), sat(v.y), sat(v.z)); | ||
} | ||
|
||
vec3 pow3(vec3 v, float p) | ||
{ | ||
return vec3(pow(v.x, p), pow(v.y, p), pow(v.z, p)); | ||
} | ||
|
||
sRGB_StraightA main(UV uv) | ||
{ | ||
vec2 r = vec2(_aspect_ratio, 1.); | ||
|
||
float x = cos(uv.x * PI * 'BOB' * r.x); | ||
float y = cos(uv.x * PI * 'BOB' * r.x + 'Off'); | ||
float z = cos(uv.x * PI * 'BOB' * r.x + 'Off' * 2); | ||
vec3 grid = sat(vec3(x, y, z)); | ||
grid = pow3(grid, 'BAB'); | ||
// grid = sat(grid - .3); | ||
// grid = pow3(grid, .5); | ||
float g = pow(abs(cos(uv.y * PI * 'BOB' * r.y)), .3); | ||
grid *= g; | ||
grid *= 1.5; | ||
|
||
uv = round(uv * 'BOB' * r) / ('BOB' * r); | ||
|
||
vec3 c = 'Image'(uv).rgb; | ||
|
||
vec3 col = grid * c; | ||
|
||
return vec4(col, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
INPUT float 'Levels'; | ||
INPUT UV->sRGB 'Image'; | ||
INPUT UV->sRGB_StraightA 'Image'; | ||
|
||
sRGB main(UV uv) | ||
sRGB_StraightA main(UV uv) | ||
{ | ||
if ('Levels' == 1.f) | ||
return vec3(0.f); | ||
return vec4(vec3(0.f), 'Image'(uv).a); | ||
|
||
return vec3(floor('Image'(uv) * 'Levels') / ('Levels' - 1.)); | ||
vec4 color = 'Image'(uv); | ||
return vec4(vec3(floor(color.rgb * 'Levels') / ('Levels' - 1.)), color.a); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Nodes/11 Image Modifier (Post Process)/Set Opacity (Alpha).clbnode.presets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"Presets": { | ||
"Underlying container": [ | ||
{ | ||
"first": "73c034ed-8075-46ef-a8a4-bc8a3bc1542d", | ||
"second": { | ||
"Name": "Default", | ||
"Values": [ | ||
{ | ||
"index": 2, | ||
"data": { | ||
"Name": "Opacity", | ||
"Value": 0.5, | ||
"Metadata": { | ||
"Bounds": { | ||
"Has min bound": true, | ||
"Min": 0.0, | ||
"Has max bound": true, | ||
"Max": 1.0, | ||
"Drag speed": 0.009999999776482582, | ||
"Use slider": true | ||
} | ||
}, | ||
"Default Value": 0.0, | ||
"Default Metadata": { | ||
"Bounds": { | ||
"Has min bound": false, | ||
"Min": 0.0, | ||
"Has max bound": false, | ||
"Max": 1.0, | ||
"Drag speed": 0.009999999776482582, | ||
"Use slider": false | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} |