mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-13 07:47:06 +01:00
Raise gradient key limit
This commit is contained in:
parent
409ff0f49a
commit
be9dc15065
10 changed files with 39 additions and 29 deletions
|
@ -83,10 +83,6 @@ function gradientObject(color = c_black) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static draw = function(_x, _y, _w, _h, _a = 1) {
|
static draw = function(_x, _y, _w, _h, _a = 1) {
|
||||||
static RES = 48;
|
|
||||||
var _step = _w / RES;
|
|
||||||
var _ox, _oc;
|
|
||||||
|
|
||||||
var uniform_grad_blend = shader_get_uniform(sh_gradient_display, "gradient_blend");
|
var uniform_grad_blend = shader_get_uniform(sh_gradient_display, "gradient_blend");
|
||||||
var uniform_grad = shader_get_uniform(sh_gradient_display, "gradient_color");
|
var uniform_grad = shader_get_uniform(sh_gradient_display, "gradient_color");
|
||||||
var uniform_grad_time = shader_get_uniform(sh_gradient_display, "gradient_time");
|
var uniform_grad_time = shader_get_uniform(sh_gradient_display, "gradient_time");
|
||||||
|
|
|
@ -547,7 +547,8 @@ function Panel_Inspector() : PanelContent() constructor {
|
||||||
draw_text_add(w / 2, ui(76), inspecting.internalName);
|
draw_text_add(w / 2, ui(76), inspecting.internalName);
|
||||||
draw_set_alpha(1);
|
draw_set_alpha(1);
|
||||||
|
|
||||||
var lx = w / 2 - string_width(inspecting.name) / 2 - ui(16);
|
draw_set_font(f_p1);
|
||||||
|
var lx = w / 2 - string_width(inspecting.name) / 2 - ui(10);
|
||||||
var ly = ui(56 - 8);
|
var ly = ui(56 - 8);
|
||||||
if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, "Lock", THEME.lock, !locked, locked? COLORS._main_icon_light : COLORS._main_icon,, 0.5) == 2)
|
if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, "Lock", THEME.lock, !locked, locked? COLORS._main_icon_light : COLORS._main_icon,, 0.5) == 2)
|
||||||
locked = !locked;
|
locked = !locked;
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
#define GRADIENT_LIMIT 128
|
||||||
|
|
||||||
uniform int gradient_blend;
|
uniform int gradient_blend;
|
||||||
uniform vec4 gradient_color[16];
|
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||||
uniform float gradient_time[16];
|
uniform float gradient_time[GRADIENT_LIMIT];
|
||||||
uniform int gradient_keys;
|
uniform int gradient_keys;
|
||||||
uniform float gradient_shift;
|
uniform float gradient_shift;
|
||||||
uniform int multiply_alpha;
|
uniform int multiply_alpha;
|
||||||
|
@ -48,7 +50,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
||||||
vec4 gradientEval(in float prog) {
|
vec4 gradientEval(in float prog) {
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||||
if(gradient_time[i] == prog) {
|
if(gradient_time[i] == prog) {
|
||||||
col = gradient_color[i];
|
col = gradient_color[i];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -5,10 +5,11 @@ varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
#define TAU 6.283185307179586
|
#define TAU 6.283185307179586
|
||||||
|
#define GRADIENT_LIMIT 128
|
||||||
|
|
||||||
uniform int gradient_blend;
|
uniform int gradient_blend;
|
||||||
uniform vec4 gradient_color[16];
|
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||||
uniform float gradient_time[16];
|
uniform float gradient_time[GRADIENT_LIMIT];
|
||||||
uniform int gradient_keys;
|
uniform int gradient_keys;
|
||||||
uniform int gradient_loop;
|
uniform int gradient_loop;
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
||||||
vec4 gradientEval(in float prog) {
|
vec4 gradientEval(in float prog) {
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||||
if(gradient_time[i] == prog) {
|
if(gradient_time[i] == prog) {
|
||||||
col = gradient_color[i];
|
col = gradient_color[i];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -5,10 +5,11 @@ varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
#define TAU 6.283185307179586
|
#define TAU 6.283185307179586
|
||||||
|
#define GRADIENT_LIMIT 128
|
||||||
|
|
||||||
uniform int gradient_blend;
|
uniform int gradient_blend;
|
||||||
uniform vec4 gradient_color[16];
|
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||||
uniform float gradient_time[16];
|
uniform float gradient_time[GRADIENT_LIMIT];
|
||||||
uniform int gradient_keys;
|
uniform int gradient_keys;
|
||||||
|
|
||||||
vec3 rgb2hsv(vec3 c) {
|
vec3 rgb2hsv(vec3 c) {
|
||||||
|
@ -48,7 +49,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
||||||
vec3 gradientEval(in float prog) {
|
vec3 gradientEval(in float prog) {
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||||
if(gradient_time[i] == prog) {
|
if(gradient_time[i] == prog) {
|
||||||
col = gradient_color[i];
|
col = gradient_color[i];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
#define GRADIENT_LIMIT 128
|
||||||
|
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform vec2 dimension;
|
uniform vec2 dimension;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
@ -18,8 +20,8 @@ uniform int mode;
|
||||||
uniform vec4 gapCol;
|
uniform vec4 gapCol;
|
||||||
uniform int gradient_use;
|
uniform int gradient_use;
|
||||||
uniform int gradient_blend;
|
uniform int gradient_blend;
|
||||||
uniform vec4 gradient_color[16];
|
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||||
uniform float gradient_time[16];
|
uniform float gradient_time[GRADIENT_LIMIT];
|
||||||
uniform int gradient_keys;
|
uniform int gradient_keys;
|
||||||
|
|
||||||
float random (in vec2 st) {
|
float random (in vec2 st) {
|
||||||
|
@ -63,7 +65,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
||||||
vec4 gradientEval(in float prog) {
|
vec4 gradientEval(in float prog) {
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||||
if(gradient_time[i] == prog) {
|
if(gradient_time[i] == prog) {
|
||||||
col = gradient_color[i];
|
col = gradient_color[i];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
#define GRADIENT_LIMIT 128
|
||||||
|
|
||||||
uniform vec2 dimension;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
@ -13,8 +15,8 @@ uniform int mode;
|
||||||
uniform vec4 gapCol;
|
uniform vec4 gapCol;
|
||||||
uniform int gradient_use;
|
uniform int gradient_use;
|
||||||
uniform int gradient_blend;
|
uniform int gradient_blend;
|
||||||
uniform vec4 gradient_color[16];
|
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||||
uniform float gradient_time[16];
|
uniform float gradient_time[GRADIENT_LIMIT];
|
||||||
uniform int gradient_keys;
|
uniform int gradient_keys;
|
||||||
|
|
||||||
#define PI 3.14159265359
|
#define PI 3.14159265359
|
||||||
|
@ -60,7 +62,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
||||||
vec4 gradientEval(in float prog) {
|
vec4 gradientEval(in float prog) {
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||||
if(gradient_time[i] == prog) {
|
if(gradient_time[i] == prog) {
|
||||||
col = gradient_color[i];
|
col = gradient_color[i];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -6,6 +6,7 @@ varying vec4 v_vColour;
|
||||||
|
|
||||||
#define c30 (1.0 / 0.86602540378)
|
#define c30 (1.0 / 0.86602540378)
|
||||||
#define PI 3.14159265359
|
#define PI 3.14159265359
|
||||||
|
#define GRADIENT_LIMIT 128
|
||||||
|
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform vec2 dimension;
|
uniform vec2 dimension;
|
||||||
|
@ -19,8 +20,8 @@ uniform int mode;
|
||||||
uniform vec4 gapCol;
|
uniform vec4 gapCol;
|
||||||
uniform int gradient_use;
|
uniform int gradient_use;
|
||||||
uniform int gradient_blend;
|
uniform int gradient_blend;
|
||||||
uniform vec4 gradient_color[16];
|
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||||
uniform float gradient_time[16];
|
uniform float gradient_time[GRADIENT_LIMIT];
|
||||||
uniform int gradient_keys;
|
uniform int gradient_keys;
|
||||||
|
|
||||||
float random (in vec2 st) {
|
float random (in vec2 st) {
|
||||||
|
@ -64,7 +65,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
||||||
vec4 gradientEval(in float prog) {
|
vec4 gradientEval(in float prog) {
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||||
if(gradient_time[i] == prog) {
|
if(gradient_time[i] == prog) {
|
||||||
col = gradient_color[i];
|
col = gradient_color[i];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
#define GRADIENT_LIMIT 128
|
||||||
|
|
||||||
uniform float seed;
|
uniform float seed;
|
||||||
uniform float strength;
|
uniform float strength;
|
||||||
uniform float dist;
|
uniform float dist;
|
||||||
|
@ -11,8 +13,8 @@ uniform int useMap;
|
||||||
uniform sampler2D strengthMap;
|
uniform sampler2D strengthMap;
|
||||||
|
|
||||||
uniform int gradient_blend;
|
uniform int gradient_blend;
|
||||||
uniform vec4 gradient_color[16];
|
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||||
uniform float gradient_time[16];
|
uniform float gradient_time[GRADIENT_LIMIT];
|
||||||
uniform int gradient_keys;
|
uniform int gradient_keys;
|
||||||
|
|
||||||
uniform float alpha_curve[64];
|
uniform float alpha_curve[64];
|
||||||
|
@ -139,7 +141,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
||||||
vec4 gradientEval(in float prog) {
|
vec4 gradientEval(in float prog) {
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||||
if(gradient_time[i] == prog) {
|
if(gradient_time[i] == prog) {
|
||||||
col = gradient_color[i];
|
col = gradient_color[i];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
#define GRADIENT_LIMIT 128
|
||||||
|
|
||||||
uniform int gradient_use;
|
uniform int gradient_use;
|
||||||
uniform int gradient_blend;
|
uniform int gradient_blend;
|
||||||
uniform vec4 gradient_color[16];
|
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||||
uniform float gradient_time[16];
|
uniform float gradient_time[GRADIENT_LIMIT];
|
||||||
uniform int gradient_keys;
|
uniform int gradient_keys;
|
||||||
|
|
||||||
uniform vec4 color0;
|
uniform vec4 color0;
|
||||||
|
@ -63,7 +65,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
||||||
vec4 gradientEval(in float prog) {
|
vec4 gradientEval(in float prog) {
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||||
if(gradient_time[i] == prog) {
|
if(gradient_time[i] == prog) {
|
||||||
col = gradient_color[i];
|
col = gradient_color[i];
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue