#How to port Shadertoy shaders to Balatro
1 messages · Page 1 of 1 (latest)
I recommend reading this in an app like Obsidian that can view Markdown in a well formatted manner
I have GOTTA read this later hehe
for now, midday nap, lmao
I shall @simple canyon to remind myself, lol
oh yeah, forgot to mention, here's a tool i wrote a while ago to create a template shader
reading this layer
hey could you mayb compile this for linux? sorry for ping
nvm ill just use wine
https://github.com/TheBearodactyl/shaderinit
ok so
i'm lazy
lmao alr
i’ll compile it when i get time
wait could you not do some CI bullshittery
sure
thanks 😭
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
the laser of calamity which appears for 2 seconds then dissapears, lmao
ok, this one's gotta be my fav one so far I think
I've made a couple cool things shader wise today, but like, I still don't know how I would flip this horizontally, lmao
Woah! that looks very cool!
thanku, hehehe :3
By the way, I know it's a dumb question, but was there any other shader you plan to port?
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...
Ah. cause right now I was at some point trying to like make the jpeg shader but yeah I'm not experineced and of course held back from it
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
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.
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
Well if she can then that's great
Also I probably need to learn how GLSL works considering I did learn a little with GLSL ES with Game maekr.
that seems to use channels
I'm not really aware of a way to use them for balatro shaders which is why my guide says "shaders with channels won't work"
gimme the code for this rq
OKay sorry for my delay but Ill give you the shader code.
This is the shader code I have.
nah you're good, if anything i should be the one saying sorry since it's been 2 days since you sent that 😭
I understand.
ok yeah it's bc it uses channels which balatro doesn't support as far as I know
Then is there a way to get it to work?
I mean even though this shader I found doen't have multiple channels
let me check
Yeah I think it's only one channel
it's the fact that it uses channels at all
you're trying to use iChannel0 which does not exist according to love2d
send the shadertoy link
ok.
wait. I think I already did that. https://www.shadertoy.com/view/McdSzl
unless you need a different shader or similar shader
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 😭
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.
gimme a minute and lemme see if i can find a way to use the texture param on the effect function
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.
yeah i think you MIGHT be able to find a way to use texture in place of iChannel0 with some tweaks
I mean I have 0 idea on how love 2D shaders mostly work but yeah. I think I see where you're coming from.
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
Huh, well tbh I just kinda wished I had more knowladge with shader work and such. but yeah, documentation is pleasure.
Okeydokey!
i need to read the docs more often
Woah.
it's definitely not exactly what it should be but that's just bc balatro
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?
Late response but I understand.
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
before I forget, here's this last one as a txt file
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
mhhh, how would I do this? sorry, new to this, not sure how to use the channel stuff yet
I have various joker sprites I could put in there, just not sure how to actually add them, lol
channel is just an input
in shadertoy ichannel can be anything
i believe if you backread a pinch they figured it out
here
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?
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"
I attempted to change that to no avail, lol
??
its defined everywhere
@idle ermine sorry for ping but would you know anything abt this
uploading this here as a means of saving it, sort of, this is gonna be the next shader I try to port to balatro
this is the shader in action :3
over a "blue noise" background :3
so, this isn't working, it's erroring at line 8, any tips?
use texture2D
since texture is already defined you can’t use the texture function
texture2D is literally the same function
so
just do that
ahh, ok, so, replace "texture(texture,uv)" with "texture2D(texture,uv)"?
yes
hmmm still getting errors here :<
any idea what's happening here?
did you ever define uv?
or redefine it to balatro's def of it
Oh? I thought that the guide up top said that balatro already added uv on it's own?
its erroring on line 5 😭 everything up to there other than the commet was litteraly just copied fgxcfdxf
what error
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
hmm, so I need these put in my shader somewhere?
right after you define shader precision preferably
shader precision ?
what does your file look like
this is my file atm
you are missing so much
oh?
use this
I tried refrencing as much from the guide above as possible, lol asbfhjfbsjf
shaderinit hyperwave
run that
rename it to hyperwave.fs
then put your effect function over the one in the file the program made
uuuhm, how do I do this 😭 I got the exe downloaded, but running it does nothing for me
I try opening it and it just instantly closes
run it in terminal
it should be shaderinit.exe [shadername]
hagbhdbsjfs Idk what I'm doing here 😭 😭 😭 do I, uhh, do I need to put it in the same folder or something like that?
put it wherever you want
okay i need to focus on this fucking shader because im getting angry at it
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 😭
my shader
ok, I understand, lol, I believe in you
I'll make it a flag instead of a positional later and I'll make it so that you don't have to rename it
btw clamping 1.0 to 1.0 doesn’t work i dont think
the compiler doesn’t consider that using the var
it does actually, try it
i did
it made me wonder why i had a fucking mystery crash for 45 minutes
well i fixed it, but new issue, my shader pulls every texture in the joker atlas and that isn’t exactly good news
how do i make it pull just one
I just tried to copy some stuff from my other shader lmaoooo 😭😭😭😭
"the Whole Party is Here" edition
yeah this happens to mine
this actually looks pretty cool
i think this looks cool on my shader but it’s not what i want
that... what the fuck
and it’s making me angry
are you using debugplus's watch shader command or something else
i’m using it as an edition in the game
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
that is very, very, very weird
I've been using shaderinit for just about all of my shaders and they've done nothing even close to this
hmm
could it be a thing with the texture func?
let me test smtn
im gonna try modifying UV
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
every time I reload the shader, the colors change
okay so something in UV is fucked methinks
reminder of what my shader is supposed to look like
oh?
im gonna go peer at the example shaders
see what UV is there
maybe try to mess with stuff
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?
i think its an issue with the texture2D function
and by extension texture in general?
im checking smtn out
ok, I found it out lol... well, slightly anyways-
so texture contains every function
I think the main issue was that I was missing the "Texture Coord" part in the majority of the code
however, that only solves part of my issue as
my shader still is frozen for some reason
tex.rgb
use tex
instead of texture2D(texture,uv)
tex provides the coordinate too
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
issue was this #1358951163474481445 message
@clever thicket accidentally force pushed and the action is gone 💔
well you better go back a commit or 2 and get it
i never pulled sadly so i can't rebase
lemme make a new one
fixed
https://github.com/TheBearodactyl/shaderinit/actions/runs/15091705572
you no longer have to rename the output file + it's a flag instead of a positional
wait nvm
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
I've got a new shader here, and
it's so wobbly in game 😭
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
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?
this is it, btw
I'mma take a quick nap I think 😔 tired now
by the way what is this shader supposed to be?
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"
I kind of just mess with the values, lol, hehehe
I see.
though for me I just want to like make unique effects like Jpeg or VHS or such.
dear epic shader peoples, how would I make my edition here only apply to parts of the texture/sprite which have a high enough brightness?
I'd love it if this shader went in all corners instead of just the one corner ashjdbsdjbsh
I want to do the same too except I coudn't try to make a jpeg shader. But Honestly this is good.
vec2 rotate_uv(vec2 uv, float rotation)
{
float mid = 0.5;
return vec2(
cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,
cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid
);
}
// then in effect
vec4 effect(...) {
...
uv = rotate_uv(uv, 90.0);
...
}
(in short, it actually very much does work like that)
oh wow, neat! I'll test this
umm 😭
lmao, I think I messed something up, lol
this is so funny lol
I have this though, so I'm not sure why this is happening, lol
with all this in mind tho, how would I make this happen? 🤔
only way I can think of would involve having 4 copies of, well, everything, lol, and something tells me there's an easier way, lmao
still need to figure this out lol sdbnhfbsjh
uv = abs(2.*uv - 1.); or something similar right after declaring uv should work
u are a wizard, omg, thankuuu hehehehe
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
you can mark a message here as unread and the thread won't go away even after inactivity
and even after i read it then?
you reply pinged someone who literally has do not reply ping in their name 💔
sorry, i ignore stuff like that, no offense but i don't feel like checking every username and/or bio for pinging preferences and feel like they should fix their notification settings instead
do it again
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
was buliding a shader and this... this happened.
I had it right but how it didn't work?
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
and take a look.
Bear if you here can you tell me what's wrong with this?
cause I did try to get it work
almost done but yeah.
back at trying to do the compression thing again or atleast try to like do something about the shader
and some how I got this.
dunno if I'm goign in the right path but I think it's progress
@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.
I'm having issues like these now
