mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 14:36:13 +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 RES = 48;
|
||||
var _step = _w / RES;
|
||||
var _ox, _oc;
|
||||
|
||||
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_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_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);
|
||||
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;
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[16];
|
||||
uniform float gradient_time[16];
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
uniform float gradient_shift;
|
||||
uniform int multiply_alpha;
|
||||
|
@ -48,7 +50,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
vec4 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
|
|
|
@ -5,10 +5,11 @@ varying vec2 v_vTexcoord;
|
|||
varying vec4 v_vColour;
|
||||
|
||||
#define TAU 6.283185307179586
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[16];
|
||||
uniform float gradient_time[16];
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
uniform int gradient_loop;
|
||||
|
||||
|
@ -55,7 +56,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
vec4 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
|
|
|
@ -5,10 +5,11 @@ varying vec2 v_vTexcoord;
|
|||
varying vec4 v_vColour;
|
||||
|
||||
#define TAU 6.283185307179586
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[16];
|
||||
uniform float gradient_time[16];
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
|
||||
vec3 rgb2hsv(vec3 c) {
|
||||
|
@ -48,7 +49,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
vec3 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform vec2 position;
|
||||
uniform vec2 dimension;
|
||||
uniform vec2 scale;
|
||||
|
@ -18,8 +20,8 @@ uniform int mode;
|
|||
uniform vec4 gapCol;
|
||||
uniform int gradient_use;
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[16];
|
||||
uniform float gradient_time[16];
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
|
||||
float random (in vec2 st) {
|
||||
|
@ -63,7 +65,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
vec4 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform vec2 dimension;
|
||||
uniform vec2 position;
|
||||
uniform vec2 scale;
|
||||
|
@ -13,8 +15,8 @@ uniform int mode;
|
|||
uniform vec4 gapCol;
|
||||
uniform int gradient_use;
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[16];
|
||||
uniform float gradient_time[16];
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
|
||||
#define PI 3.14159265359
|
||||
|
@ -60,7 +62,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
vec4 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
|
|
|
@ -6,6 +6,7 @@ varying vec4 v_vColour;
|
|||
|
||||
#define c30 (1.0 / 0.86602540378)
|
||||
#define PI 3.14159265359
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform vec2 position;
|
||||
uniform vec2 dimension;
|
||||
|
@ -19,8 +20,8 @@ uniform int mode;
|
|||
uniform vec4 gapCol;
|
||||
uniform int gradient_use;
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[16];
|
||||
uniform float gradient_time[16];
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
|
||||
float random (in vec2 st) {
|
||||
|
@ -64,7 +65,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
vec4 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform float seed;
|
||||
uniform float strength;
|
||||
uniform float dist;
|
||||
|
@ -11,8 +13,8 @@ uniform int useMap;
|
|||
uniform sampler2D strengthMap;
|
||||
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[16];
|
||||
uniform float gradient_time[16];
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
|
||||
uniform float alpha_curve[64];
|
||||
|
@ -139,7 +141,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
vec4 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform int gradient_use;
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[16];
|
||||
uniform float gradient_time[16];
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
|
||||
uniform vec4 color0;
|
||||
|
@ -63,7 +65,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
vec4 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue