Move GLSL's current fixed 8-colour gradient system to temporary sampler1D texture generated at runtime.#756
Conversation
…system over to a sampler1D texture for efficient and expandable gradient support in our GLSL shaders. An example conversion is done in bar_spectrum.frag. This is done by temp generation of a gradient colour which is then cleaned up after program doesn't need it any further.
|
sorry for the extremely late follow up, but I saw the pr was marked as a draft and I assumed it wasn't really ready. The plan sounds legit, I can test it and merge it if it is good to go? |
|
ok tested it now with the default bar spectrum shader, does not work at all it seems. bars are all black. |
|
Yeah sorry I haven't actually completed this one, I ran the shader generation but I don't think I wrote in the actual shader usage to it yet! I'm food-poisoned right now, but feel free to either edit on this PR or if you'd rather, I can write it up once I'm back up, likely tomorrow! |
Signed-off-by: Toria <ninetailedtori@uwu.gal>
|
@karlstav finished, test this! |
|
you also added lots of other stuff, touched files and functions not related to the change and added ide type build files. Not sure if this is a symptom of the agentic coding thing going on. I will not even bother testing this until it it stripped back to only the changes related to the topic. |
|
Oh nah this is just my coding hyperfixation leading to me accidentally working on it like it was my own codebase 😭😭😭 I'll strip it back in a bit :3 |
Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
Signed-off-by: Toria <ninetailedtori@uwu.gal>
989806d to
bcdef4c
Compare
and suppress linter. Signed-off-by: Toria <ninetailedtori@uwu.gal>
bcdef4c to
83306b0
Compare
|
Alright! I've tried to keep it as minimal here, no changes outside of IDE and formatter hits, outside of the spec of this PR, which does include updating the shaders to use the new gradient texture based on settings (which if disabled, falls back to the same settings that were used initially). |
|
Errr, works on mine, is this without gradient enabled? I might've goofed up that shader dammit! Lemme patch that |
|
@karlstav what's your machine? It works fine on mine, I'm going to try to push a fix which might work on yours? |
Signed-off-by: Toria <ninetailedtori@uwu.gal>
|
|
|
nope. i am on intel/nvidia ubuntu 26.04 so the bar_spectrum.frag shader with two colors in the gradient works on your end? |
|
ah, let me test that. one sec. |
Signed-off-by: Toria <ninetailedtori@uwu.gal>
This reverts commit baaff8d.
|
It was working for me, but it loaded the entire gradient irrespective of the count specified! I've changed the config loading to properly validate colors and load based on count now :3 lemme know if you spot more bugs, I hope not but it is really hot here and I totes am gonna miss smth prolly 😭 |
|
Alright, this is...probably as good as it's gonna get for me rn. Gotta take a break for a bit. |
Signed-off-by: Toria <ninetailedtori@uwu.gal>
d5938a9 to
642a60b
Compare
309c827 to
346162a
Compare
Signed-off-by: Toria <ninetailedtori@uwu.gal>
346162a to
9dd6b13
Compare


Working on moving the GLSL shader method itself to generate a temp texture based on the current config structure of setting the gradient_count, then listing the colours as gradient_color_n.
This is then efficiently polled for its 1D coordinate against 0.0–1.0, which then gives us our accurate colour to use in gradient. This works a lot better when using it in shaders as well, but more usefully, allows us to expand the hard-coded 8 colours of gradient to something variable. I welcome any testing on this! Still working on the moving all shaders over, so I can test them all :]