#How to port Shadertoy shaders to Balatro

1 messages · Page 1 of 1 (latest)

idle ermine
#

I recommend reading this in an app like Obsidian that can view Markdown in a well formatted manner

simple canyon
#

I have GOTTA read this later hehe

#

for now, midday nap, lmao

#

I shall @simple canyon to remind myself, lol

idle ermine
#

oh yeah, forgot to mention, here's a tool i wrote a while ago to create a template shader

open mango
#

reading this layer

clever thicket
#

nvm ill just use wine

idle ermine
#

ye

#

i can

clever thicket
#

alright y

#

thanks

idle ermine
clever thicket
#

lmao alr

#

i’ll compile it when i get time

#

wait could you not do some CI bullshittery

clever thicket
#

can i do it for you and just make a PR

idle ermine
#

sure

clever thicket
#

alr

#

ill get auto windows, linux, and macos builds going

idle ermine
clever thicket
#

no problem

#

lmao

simple canyon
#

I made another cool shader but I have no clue what I'm doing 😭 lmao I could just, like, port this, but idk how to get it to turn into the effect I want anyway, lol, bdjfbsdjfs
like, if I could just, like, translate "how dark is this shader" into "how much alpha does this have" then this'd work amazingly as an edition sndfhbsdjh

#

I'm good at making, like, static shaders, but I don't know how to actually turn them into "overlays" 🥲

#

hmm, maybe I still need to learn more about shaders themselves maybe, like, I'm not even entirely sure how I got it to look the way it does now, you know?

#

like, it'd be nice to get this "border" to go all around, instead of just being in that corner, but I'm not sure what is exactly creating it in the first place

simple canyon
simple canyon
heavy bough
simple canyon
#

thanku, hehehe :3

heavy bough
#

By the way, I know it's a dumb question, but was there any other shader you plan to port?

simple canyon
#

oh, I'm not sure yet, I've been trying to learn how to make shaders so that I could port one of these, I said before, my main issue is that I'm not exactly sure how to translate these into something that, like, takes the already existing values of a sprite? I guess? Idk, I guess it doesn't really make sense, I feel like I'm getting closer to an epiphany there soon, so I might end up adding another shader into my mod soon, hehehe

#

I do have one shader in game already actually, made it for an edition that I couldn't get working effectwise, hehe

#

this right here was my first ever shader I got put into balatro, and currently, is the only one, I like it, hehe

#

here's what all the cards on page 2 would look like :3

#

marble joker is a bit, uhh, hard to see with the shader it seems, lol, hehe

#

omg... I never realized my edition worked on the faces... awesome...

heavy bough
simple canyon
# heavy bough Ah. cause right now I was at some point trying to like make the jpeg shader but ...

hmm, well, I don't know a ton myself, I only just started lol, but um, I would reccomend checking out Shadertoy if you haven't already! it's a site which has been helping me learn, you can see changes you make to shaders in real time and stuff, you can even check out other peoples shaders they've uploaded and see how they were made, granted, a lot of the cooler looking ones there are a tad complex, lol

heavy bough
#

Well I did and of course I did find the shader I was looking for

#

but unforutnately I tried my best to convert it into the balatro code but gave me an error

#

this is the shader.

#

But I understand.

simple canyon
#

I wish I knew more about this stuff, sorry :<
maybe Bearodactyl can help you? she seems to know what she's doing here, I think

heavy bough
#

Also I probably need to learn how GLSL works considering I did learn a little with GLSL ES with Game maekr.

idle ermine
heavy bough
idle ermine
heavy bough
#

I understand.

idle ermine
#

ok yeah it's bc it uses channels which balatro doesn't support as far as I know

heavy bough
#

Then is there a way to get it to work?

heavy bough
#

let me check

#

Yeah I think it's only one channel

idle ermine
heavy bough
#

ooooooh.

#

Now I see.

#

So how do I fix this?

idle ermine
#

send the shadertoy link

heavy bough
#

ok.

#

unless you need a different shader or similar shader

idle ermine
#

oh i didn't see

#

lemme look at it rq

#

oh yeah this is just not gonna work
i don't even know if love2d is capable of using the webcam in the first place 😭

heavy bough
#

I'm not talking about webcam

#

try replacing webcam

#

with an image or video

#

the shader had the webcam as the default channel

#

it works than just the webcam

#

I discovered about this way before.

idle ermine
#

gimme a minute and lemme see if i can find a way to use the texture param on the effect function

heavy bough
#

Yeah, cause you never know that a shader actually had forgot to reset the thing, Heck even shadertoy allows you to edit the shaders.

Just make sure next time when you came across a shader that had a webcam as default make sure to click over to change from webcam to video or image texture.

idle ermine
#

yeah i think you MIGHT be able to find a way to use texture in place of iChannel0 with some tweaks

heavy bough
#

I mean I have 0 idea on how love 2D shaders mostly work but yeah. I think I see where you're coming from.

idle ermine
#

nevermind I've just had a big brain moment and found out I've just not read the love2d docs enough
substitute references to iChannel0 with texture in the effect function

#

lemme try a simpler jpeg one and see if i can replicate it using texture and I'll let you know

heavy bough
#

Huh, well tbh I just kinda wished I had more knowladge with shader work and such. but yeah, documentation is pleasure.

idle ermine
#

i need to read the docs more often

heavy bough
#

Woah.

idle ermine
#

it's definitely not exactly what it should be but that's just bc balatro

clever thicket
#

i was thinking abt making a shader that grayscales something

#

for an edition

#

but i gotta figure out how exactly imma do that

#

maybe i take the color of the pixel and then average out the color

#

to make a gray?

heavy bough
simple canyon
# idle ermine gimme the code for this rq

sorry, I no longer have access to this, because I am a fool who seldom saves these shaders fdbsshbfjhfd I probs should tho, lol, I'll be back with a new one in like, 4 mins, lol

#

not hard to have this issue for me, lmao, as I can only ever seem to make shaders that have this issue lol

#

this all results from me having no idea what my numbers actually do I think, lmao, like, similar thing here, what if I wanted to turn this \ slash effect so that it was an X pattern?

#

so, I managed to get something with an issue close to the one from before here, like, I'd love for whatevers going on in the top left to repeat itself on all edges

clever thicket
#

it might be worth it to note that iChannel can be substituted for texture

#

i would probably take your tutorial and put it into the shaderinit repo as a readme

simple canyon
#

I have various joker sprites I could put in there, just not sure how to actually add them, lol

clever thicket
#

channel is just an input

#

in shadertoy ichannel can be anything

#

i believe if you backread a pinch they figured it out

simple canyon
#

hmmmm

#

how do I use this btw 😭 I managed to grab one of the textures they had already included, but

#

if the texture isn't a vec2 then what is it? and how do I use that in my coding stuffs?

clever thicket
#

i think there’s a special type

#

one sec

#

idrk about this stuff

simple canyon
#

I think I managed to figure it out, took some stuffs from another shader hehe

#

I needed, to, like, convert it, kinda

#

this is what I ended up with

#

also, another example of "my shaders keep picking a corner they like for some reason"

clever thicket
#

??

#

its defined everywhere

#

@idle ermine sorry for ping but would you know anything abt this

simple canyon
#

uploading this here as a means of saving it, sort of, this is gonna be the next shader I try to port to balatro

#

over a "blue noise" background :3

simple canyon
clever thicket
#

use texture2D

#

since texture is already defined you can’t use the texture function

#

texture2D is literally the same function

#

so

#

just do that

simple canyon
clever thicket
#

yes

simple canyon
#

any idea what's happening here?

clever thicket
#

or redefine it to balatro's def of it

simple canyon
#

Oh? I thought that the guide up top said that balatro already added uv on it's own?

clever thicket
#

no

#

its saying that the TEMPLATE has it already

#

i made the same mistake

simple canyon
#

ahhh ok

#

forgot to swap out fragCoord lol

simple canyon
simple canyon
clever thicket
#




extern MY_HIGHP_OR_MEDIUMP number dissolve;
extern MY_HIGHP_OR_MEDIUMP number time;
extern MY_HIGHP_OR_MEDIUMP vec4 texture_details;
extern MY_HIGHP_OR_MEDIUMP vec2 image_details;
extern bool shadow;
extern MY_HIGHP_OR_MEDIUMP vec4 burn_colour_1;
extern MY_HIGHP_OR_MEDIUMP vec4 burn_colour_2;
#

its probably not defined where this stuff is

simple canyon
#

hmm, so I need these put in my shader somewhere?

clever thicket
simple canyon
#

shader precision ?

clever thicket
simple canyon
clever thicket
simple canyon
#

oh?

simple canyon
#

I tried refrencing as much from the guide above as possible, lol asbfhjfbsjf

clever thicket
#

shaderinit hyperwave

#

run that

#

rename it to hyperwave.fs

#

then put your effect function over the one in the file the program made

simple canyon
#

I try opening it and it just instantly closes

clever thicket
#

it should be shaderinit.exe [shadername]

simple canyon
#

hagbhdbsjfs Idk what I'm doing here 😭 😭 😭 do I, uhh, do I need to put it in the same folder or something like that?

clever thicket
#

put it wherever you want

#

okay i need to focus on this fucking shader because im getting angry at it

simple canyon
#

my shader or yours? I don't know what's happening anymore, my parents are trying to talk to me about random stuff while I'm trying to make this work so I got, like, double headache rn lmaooo sorry if I misread things or whatever 😭

simple canyon
#

ok, I understand, lol, I believe in you

idle ermine
clever thicket
#

the compiler doesn’t consider that using the var

idle ermine
clever thicket
#

it made me wonder why i had a fucking mystery crash for 45 minutes

clever thicket
#

how do i make it pull just one

simple canyon
#

I just tried to copy some stuff from my other shader lmaoooo 😭😭😭😭

#

"the Whole Party is Here" edition

clever thicket
idle ermine
clever thicket
#

i think this looks cool on my shader but it’s not what i want

clever thicket
#

and it’s making me angry

idle ermine
#

are you using debugplus's watch shader command or something else

clever thicket
simple canyon
#

what's weird is, I have another shader which works fine that I copied from negative, and I copied the majority of my code for this edition from that one basdjhfbsjd

idle ermine
#

I've been using shaderinit for just about all of my shaders and they've done nothing even close to this

clever thicket
#

hmm

#

could it be a thing with the texture func?

#

let me test smtn

#

im gonna try modifying UV

simple canyon
#

I've managed to decipher one thing here, and thats that the issue resides in the main effect of the shader, as, that is the only difference with my 2 shaders

#

first one here works normally

#

second does not

#

I've also noticed that my shader's time stuff isn't moving

#

like, it's stationary

#

compared to what was a fairly active shader, one that moved often

#

Wha-

#

I just uncovered something facinating here, people

#

one sec, let me grab a video of this

clever thicket
#

okay so something in UV is fucked methinks

simple canyon
simple canyon
clever thicket
#

im gonna go peer at the example shaders

#

see what UV is there

#

maybe try to mess with stuff

simple canyon
#

all I know is-

#

the left one works fine

#

the right one doesn't

#

I've been trying to figure out WHY this is the case

#

replacing stuff bit by bit, trying to uncover what exactly is going on

#

like

#

why is this one working?

clever thicket
#

and by extension texture in general?

#

im checking smtn out

simple canyon
#

ok, I found it out lol... well, slightly anyways-

clever thicket
#

so texture contains every function

simple canyon
#

I think the main issue was that I was missing the "Texture Coord" part in the majority of the code

clever thicket
#

but it’s not defining what coordinate

#

tex makes a texel which defines that cord

simple canyon
#

however, that only solves part of my issue as

clever thicket
#

Got it

#

use tex

simple canyon
#

my shader still is frozen for some reason

clever thicket
#

tex.rgb

#

use tex

#

instead of texture2D(texture,uv)

#

tex provides the coordinate too

simple canyon
#

yeah, tex seems to be working

#

though, I still have a weird issue of being frozen in time, seems like that might be a different issue tho

#

ok, so, fixed this one too it seems

idle ermine
#

@clever thicket accidentally force pushed and the action is gone 💔

clever thicket
idle ermine
#

i never pulled sadly so i can't rebase
lemme make a new one

#

fixed

#

wait nvm

simple canyon
#

how do I tell what direction my shader's going 😭 I wanna just grab a transform tool and flip this 90 degrees and then layer a copy of it that's the opposite direction of it but I know shaders don't work like that 😭 lmao

simple canyon
#

bigger issue actually, lol, uhhm, turns out the way I'm using time here isn't looping completely, it seems as if the lines get thinner and thinner as the shader plays, hmmm

#

ahh, seems this was an issue with the original shader as well, just never noticed as I hadn't reset the shader, the previous recording was probably around 400 secs in, hmmm, well fuck, lmao, how do I fix this one ? 😭

#

I think I fixed it

#

issue was that I was trying to multiply a sin of time by a uv.y, however, it instead was multiplied inside of the sin and, essentally, yeah, the time was grown from that

#

hmmm, a little dark imo

simple canyon
#

so, I increased the alpha, and, I like the green better now, but the purple is still so dark, lol, how would I make them share the same lumonocity? or even just be closer in it?

#

I'mma take a quick nap I think 😔 tired now

heavy bough
simple canyon
#

I mean, I don't really think of that too much when I make editions, not yet anyway, lol, I just kinda go with the flow, this one ended up rather technological, so I was thinking of calling it something like "Polyscreen" or "Retrograph"

simple canyon
heavy bough
#

though for me I just want to like make unique effects like Jpeg or VHS or such.

simple canyon
simple canyon
#

I'd love it if this shader went in all corners instead of just the one corner ashjdbsdjbsh

simple canyon
#

I love making shaders :3

#

now, how would it do this balatrojoker

heavy bough
# simple canyon

I want to do the same too except I coudn't try to make a jpeg shader. But Honestly this is good.

idle ermine
#

(in short, it actually very much does work like that)

simple canyon
#

umm 😭

#

lmao, I think I messed something up, lol

#

I have this though, so I'm not sure why this is happening, lol

simple canyon
simple canyon
sick skiff
simple canyon
fresh dagger
#

writing a message here because discord's ui is garbage and i can't remember how to to pin a thread to the left sidebar

cyan shuttle
#

you can mark a message here as unread and the thread won't go away even after inactivity

fresh dagger
covert stirrup
fresh dagger
shut wigeon
cyan shuttle
dry fern
#

i know this isn't related to shadertoy but im having issues with shaders converted from glsl and importing them to balatro for an edition

#

the problem is the shader needs an effect function and i dont know how to make it and what to do

#

and when using this i get this error

heavy bough
#

was buliding a shader and this... this happened.

#

I had it right but how it didn't work?

heavy bough
#

I tried again to port a jpeg shader into balatro and it gave me this.

#

also I figured out yesterday

#

somehow

#

but yeah was still learning

#

one without the crt

#

let me just share this

heavy bough
#

cause I did try to get it work

#

almost done but yeah.

heavy bough
#

back at trying to do the compression thing again or atleast try to like do something about the shader

heavy bough
#

and some how I got this.

#

dunno if I'm goign in the right path but I think it's progress

heavy bough
#

@idle ermine Hey sorry for the ping but right now I'm so close to getting it to render what I have thought I got to render but it's actually rendering the texture sheet:

#

is there a way to like render a spesific part of the texture?

#

cause right now I've decided to try again to render the compressed and well this is how I've gotten. though right now everything is a blur and well yeah.

heavy bough
#

I think I finally got it

#

or close enough

heavy bough
#

I'm having issues like these now