#🪅-progaming
1 messages · Page 120 of 1
sorry
This would not happen if you just used Jetpack Compose
:)
swift ui is not a serious framework
i should look into this
yop
rosie forking her own repo
god swiftui actually sucks
rewriting parts of my app with UIKit because swiftui is too slow
true and factual
it was for a totally normal UI bug though
nothing complex
Nope, it was for a toolbar and I forgot to put Spacer inside a ToolbarItem
Vibe Coding Enthusiasts
@valid jetty
husk
transalted by chatgcpt
task is in german
u can translate it if u wanna red it
read
transalted
@deep mulch
NO
no
@87flowers hi ii
import math
print(chr(sum(range(int(''.join(reversed(str(int(math.sqrt(2025))))), 0x10)))))
/run
import math
print(chr(sum(range(int(''.join(reversed(str(int(math.sqrt(2025))))), 0x10)))))
amog
this
yes
many languages
do
```py
code
https://www.youtube.com/watch?v=8M0QfLUDaaA great video which told me nothiung i didn't already know
We go to some strange places in the computer...
- A rough model of the stack and heap.
- Copy and Cloning values
- The three rules of ownership
- Immutable and mutable borrows
- Slice borrowing
The Rust book: https://doc.rust-lang.org/book/second-edition/
List of Copy types: https://stackoverflow.com/a/41413595
End song:
Track: LF...
i don't care do it in #🤖-bot-commands or get banned
that too
@frosty obsidian wingyyy
was trying to debug why iwlwifi (the wifi module for the linux kernel) was failing on startup and looked it up and eventually figured out that a WINDOWS 11 SETTING is to blame for broken linux drivers, apparently if you enter hibernate windows 11 interjects some stupid fast startup thing that prevents your wifi adapter from starting up correctly
and that happens on all future boots from then on until you disable the setting
you love
nearly all of desktop firmwares are designed and made for windows 11
No wonder why it explodes
@valid jetty @deep mulch my uni uses Go
as the entry language
i was gonna ask if i can submit my homework in a diff language
but ig this is a good reason to learn go
lmao oh god
go good
yet another reason to use nvim
Some people need to grow a spine
Is that jetbrains
And i dont think nvim works best on windows
I do wonder why the politically corrects went for blocklist and allowlist rather than the obvious redlist and greenlist
it doesn't
whitelist literally means being allowed to do something

blocklist and allowlist is more logic
i don't really understand what's meant to be wrong with blacklist/whitelist though
i've never seen an actual... explanation lol
Some people thing everything involving monochrome colors is inherently racist
or like master branch? wheres the evidence to suggest there's something wrong with that?
I do agree that master/slave terminology is pretty sus
feels like some things got caught in the crossfire of master/slave language
Yeah
master/slave is
, yes but sometimes there's just a master
Main is a better name than master, but changing the default after several decades is just dumb
but who ever talks about the term "master recording" being offensive in music
its not master as in "in charge", it's more like master as in original
Or remastering a game
yeah that doesn't mean... reownering
nobody really has any strong arguments its all really odd
jetbrains has another thing where it recommends that you use neutral words like Mx instead of Ms/Mr
Ew
i think its a little silly to make things always gender neutral tbh
like if you're talking about an actual policeman
I think gender neutral terms are fine if you do -folk
Policefolk, firefolk, chairfolk
Chair officer
my code is always so inclusive! 😊
It is, yes
Also like 95% of firefighter are men
if you want to be inclusive maybe work on getting more women interested in the job than policing people's language 
My code isn't particularly inclusive, I have <string> and <vector> in pch so that I don't have to #include them
tables have turned
you will be most successful from creating a "non-woke, dei free" ide
What's dei
[x] correct gender neutral/female language
change all pronouns to he/him
[X] Keep politics out of open source - Prefer he/him over woke pronouns like they/them

ctrl+alt+a Insert ableist language
probably the sort of thing people like these days...
I don't mind they/them, that one's been used for centuries
i'm not "anti-woke"
i do find some stuff a bit silly though lol
sometimes
allowlist is a more logical word arguably
[X] Keep politics out of open source - Prefer nonwoke maintainers over woke maintainers like @royal nymph
the wokes are trying to ruin our standards
most useless thing
everything/everyone is male for me unless they specify otherwise
can it stop fucking glazing me
everything/everyone is male.
change personality in chatgpt settings
ty
Why would you ever use svelte though?
should i switch to sqlite
i guess probably not (because i'm too far into this project)... but is sqlite fine even if you have multiple processes accessing the same db
@valid jetty is this actually bad
let a = &self.something;
do_stuff(a.read_stuff());
let mut b = self.borrow_mut();
b.do_stuff();
chatgpt told me this is ub because a is still alive while self is mutably borrowed in b
@fleet cedar
even tho a isnt used after b is mutably borrowed
chat says itll work now but it might break with a different compiler
???
why are you listening to chatgpt
Excellent! You're thinking like a true vibe coder now. Here is the correct solution:
if i was listening to it i wouldnt have asked you
im just confused
as to why it thinks theres an issue here
You can’t have a shared (&T) and mutable (&mut T) reference to the same data at the same time.
Even if you don’t use the shared one after creating the mutable one, both exist concurrently, which breaks Rust’s aliasing rules.
The compiler and optimizer assume a &mut T is the only reference to that memory.
If an old &T still exists, the optimizer may reorder or remove reads/writes, producing wrong results.
So code like:
let a = &self.field;
let b = self.borrow_mut(); // mutable borrow of all `self`
is undefined behavior because a and b could alias.
Rust forbids this to keep memory safety and compiler optimizations valid.
specifically when you borrow some field of self immutably before then mutably borrowing all of self
No, NLL was added many years ago
References are tracked by liveness, not just lexical scope
i am aware
and so is he
Hi all, quick question! I love using the pinned DMs plugin, but I was wondering if there's a way to hide this section here? I'm trying to clean up my view a bit. Thanks in advance. Also if anyone has a code for hiding the sicker button that be awesome too.
Is pindms different from favoriting a chat in vanilla?
this is what i am using if you are talking to me
@fleet cedar can you help me understand this The update would be a compiler optimization that fully trusts the noalias guarantee on &mut references.
It would allow LLVM (or a MIR pass) to reuse or reorder memory reads and writes across function calls that take &mut, assuming no other reference can see the same data.
Once that optimization lands, code that still keeps an &T alive while calling a &mut self function could start reading stale values—a silent miscompile—because the compiler now skips reloading memory it believes cannot change.
or why it is wrong
cause i dont
That sounds like complete poop
If you wanna discuss questions that's fine, but discussing ai poop answers is nonproductive
it does, its saying because there is another reader it will skip the write
or something
It's writing words in plausible-looking sequences
Let’s be exact.
If your immutable reference is never used after the mutable borrow, then in practice there is no observable problem.
The compiled code will behave the same no matter how the optimizer reorders things, because nothing reads through that old reference again.
The formal UB label only exists because Rust’s aliasing model has to forbid all overlap so it can safely mark every &mut as noalias without analysing each case.
That’s a conservative rule for correctness proofs, not a statement that your specific code will miscompile today or tomorrow.
So:
- Real-world effect: nothing bad happens, because the old reference is never used.
- Language-lawyer view: still outside the defined model, because the compiler isn’t required to keep it working.
Both statements are true. The “UB” flag is about what Rust guarantees, not about an actual runtime hazard in your exact program.
If you want to discuss nuances of borrow checking, a human is much better than a word poop machine
ok thats what i thought
its writing 'your code is ub according to the spec but it will never actually matter' but in many complicated words
and i dont even know if its right about it being """ub"""
And it's wrong, because if it was ub then borrowck wouldn't accept it
If you ask your questions here I can answer them
I do not waste my time arguing against word poop
i was moreso trying to convince the llm that im right
A futile endeavor
well i did it
im right 😎
i shouldve just gone to sleep instead
yea kinda
but not really
Yep it's still claiming there's ub
its also saying the code is safe
It's literally saying "the code is ub but compiler lets it slide"
well
yes
lol
it feels like its instructed to make the code it generates as verbose as possible
so even if you use it as a typing assistant you still have to refactor what it spits out
Most likely yes
you can't debate something that literally has no capacity for reason
in this project i have theres a massive workflow with building and testing and release
would it be better to split the release into its own?
but then i would have to copy/paste like 200 lines of jobs
@jade stone help
build a matrix
That's what I did
what about the duplicate jobs

does that workflow also run for non-release things?
yes
https://github.com/dawidd6/action-download-artifact i found this
could run build workflow, then release workflow would be able to take those artifacts
idk
I would split it off
there's subtle differences that don't make putting them together good
like for example you shouldn't be using cache for release builds
yeah
i willd o that 
why not use the official one https://github.com/actions/download-artifact
Let's suppose you have a workflow with a job in it that at the end uploads an artifact using actions/upload-artifact action and you want to download this artifact in another workflow that is run after the first one. Official actions/download-artifact does not allow this.
vee blindd
that's across multiple workflows, not jobs
why would you need cross-workflow artifacts
oh you sent that a long time ago
gh so brokey recently
had this happen to me a few days ago
should detec google chrome/ms teams/minecraft/oracle (so any java)/any cisco soft instead
who cares what vaxrys opinions are
nothing in the world changes because of vaxrys opinions
whats wrong with google chrome and minecraft/java
I support blocking omarchy/arch and hyprland
fell for the bait award
they are usa software
and host genocide
minecraft specifically just because its microsoft owned
java because of oracle
can say same about windows, discord and literally most of x86 hardware you have
yes
doesn't make sense at all
neither does the tool from the post
i just didnt feel like listing everything remotely related to fascism
i would bundle some code from it to my programs tbh
have to block linux users
🦅ly @hoary sluice
😡
@valid jetty
i just did some progaming for like 15 minutes and then realized my mouse was disconnected the whole time
i think ive achieved perfection
I prefer supporting predictable and stable platforms (linux isnt one of them), sorry
not ragebait unfortunately
windows being predictable and stable is one of the things ive heard of all time
true
ok am running into this issue now 😭 where can I find that proxy wrapper u were talking about
just maka the target of the proxy a function
instead an object
new Proxy(function(){}, {....})
olrite
i didn’t? i’m just posting because it’s funny especially the maintainer review
and then if u run into an issue with making Object.keys or similar work let me know
there's another thing in particular of when you make the target a function

I meant lunduke
oh mb
https://cdn.discordapp.com/attachments/542264318465671170/1427668253752168579/Screen_Recording_2025-10-14_at_15.39.31.mov?ex=68efb32c&is=68ee61ac&hm=39df94a519d765eb1d380eb18ac1a61fcf950ff8549cc04e7fd571e0b1319eb0& https://cdn.discordapp.com/attachments/542264318465671170/1427669054201790604/Screen_Recording_2025-10-14_at_15.36.34.mov?ex=68efb3eb&is=68ee626b&hm=9246ec83d3acbe46ef78df51c291c4d57824d37f103a6660c1e23bd67c171096&
@hoary sluice @deep mulch i plotted a julia set
basically you iteratively call f(z) = z^2 + C
and then shade the point based on whether the resulting curve diverges (goes off to infinity) or converges (approaches a limit point), and if diverges how fast it does so
and with my mouse i'm controlling the value of C
and if you render that you get this very beautiful fractal
is that in elle
yes
oh
this is the elle code that renders it
whats fs
this is actually simpler than I expected
evil
well yeah
^^^
it's like surprisingly simple
I should do in my compose fractal thing
the test for divergence is basically whether it exits the unit circle lol
that's the cplx_abs(z) > 2
Compose using Kotlin scripting. Contribute to zt64/compose-scripts development by creating an account on GitHub.
I mostly just used AI cause I literally could not find anything that did mandelbrot programmatically that wasn't single letter variables
you didnt have to explain what diverging and converging means, i dont understand what youre trying to say either way
what is z
julia seems easier
what makes this different from a Mandelbrot
@hoary sluice you love my compose scripts project
just kang from vencord
julia and mandelbrot sets are dual
in mandelbrot C is kept the same and you plot differently based on the starting position
in julia you keep starting position the same and change C
yes
the values of C that converge are actually defined by the mandelbrot set
oh so z is constant
you wrote f(x)
oh
do u work in mobile dev
so what is z
https://youtu.be/Ed1gsyxxwM0 (not the julia set but he ends up making it at some point)
MUSIC BY 6884! Check him out here: https://6884.bandcamp.com/
The soundtrack from this video will be available on his bandcamp soon, so go follow him to make sure you don’t miss it!
I know I promised you a lambda calculus video- In fact, the video is done, but 6884 is having a field day on the sound effects as we speak, and they are coming out...
f(z) = z^2 + C
function!!
start with some z, typically the position of the pixel you're calculating
then you just apply f(z) = z^2 + C some amount of times
if the output point is within the unit circle (|z| < 2), then it converges, otherwise it diverges
and you control the value of C
what is z
the more iterations, the higher resolution your fractal
usually the position of the pixel as a complex number
the initial z*
how many dimensions are julia sets
@valid jetty https://youtu.be/aLR4YpTnM6c
Rendering a 6D Mandelbrot using experimental GLSL shaders.
“Mandelbrot’s Evil Twin” by 2swap:
https://youtu.be/Ed1gsyxxwM0
All my links:
https://heledron.com/links/
Web app:
https://heledron.com/misc/mandelbrot/
World Download:
Mandelbrot (No additional installation required): https://www.planetminecraft.com/project/6d-mandelbrot/
Spid...
the guy in the video explained it
that's what i said lol
depending on the value of C, between 1 and 2
yeah this was partially what started my obsession with fractals
oh i didnt read this message
@valid jetty make it so you can step through the iterations
@valid jetty make elle compile to spir-v
well specifically i start with
float x = mix(x_min, x_max, fragTexCoord.x);
float y = mix(y_min, y_max, fragTexCoord.y);
vec2 z = vec2(x, y);
``` which basically maps the pixel coord into a value from x_min to x_max and the same for y
that's like definitely doable
world to screen or something
you can just control the value of max_iterations
evil
i have a good idea
kode tode
I could
is implementing get enough
'cause I tried that but it always returns undefined
like this should be returning a rejected promise
i don't think my idea will work
i wanted to make iostream in kotlin :(
there's no <<
and you can't even overload shl
oop
make elle run on embedded devices when
I wanna run elle on my esp32
it alreado can
compile to x86, decompile to c, compile to esp32 
look guys I made it so u can search and sort playlists in the browser
racchole
kmoe spotted
thought this was my Spotify activity for a second
i just realised i'm kind of not prioritising getting hello world working in my language
hello world is hard...
idk maybe strings can just be another primitive type
They should be
my value.h header is already bloated
but yeah i guess they probably should be lol
why did i think this would be hard
I mean optimizing strings if they were primitives would be easier
if they were objects that'd mean two levels of indirection to the data ig
i had to remind myself that strings are immutable in gc languages so that would be pointless
unless i want to be weird and make strings mutable
Make another string primitive then
i like the way the compile command i made doesn't tell you off for passing no files lol
Mutable string primitive purely for optimization/performance purposes
horror
trying print hello world
that's what i like to see
seems my lexer doesn't like strings
what could i possibly be doing wrong LOL

average c code of somebody who doesn't normally code in c, probably
idk
probably pretty typical c code
&***&*(void **)memcpy(x1, ++++++x2)
how do you not have /bin/bash????
i ate it
i turned the message action sheets into context menus
it's actually way nicer than the action sheet i love it
tho i have to find a way to bring reacting back
how did u do this
client mods
i have this patch ```ts
Patcher.before(ActionSheet, 'openLazy', (self, [component, type, message]) => {
if (type !== "MessageLongPressActionSheet" || !message) return;
component.then(instance => {
const unpatch = Patcher.after(instance, 'default', (_, __, res) => {
unpatch();
const buttons = findInReactTree(res, x => x?.[0]?.type?.name === 'ButtonRow');
if (!buttons) return res;
const state = ContextMenu.useContextMenuState();
const items = React.useMemo(() => buttons.map(({ props: { message, onPressRow, IconComponent } }) => ({
IconComponent,
action: onPressRow,
label: message
})), []);
React.useEffect(() => {
ActionSheet.hideActionSheet();
ContextMenu.showContextMenu({
key: `uid_${message.id}`,
x: 33,
y: 250,
position: 'below',
align: 'left',
height: 126,
width: 102.33332824707031,
state,
items,
title: "Manage Message",
requestClose: () => {
ContextMenu.hideContextMenu();
const active = state?.activeIndex?.value;
active >= 0 && items[active].action();
},
onClose: () => {}
})
}, []);
return res;
});
});
})
that ive been working on since last night
i finally got it to work this morning
discord uses react native??
on mobile yes
I thought they did kotlin
we're now on discord 300-ish
oh
i heard they were switching to react native like a year ago
they're using the last version before discord switched to RN
i'm also running an old version, the last one that has tabsv2
discord 213
is there deobfuscated source code for discord
which is from about feb 2024
whats tabsv2
no, but you can disassemble the bundle into some sort of assembly-like soup
i think i remember that layout
rosie are you allowed to work at 17 in the uk
uhhh probably
you can open a company at 16
and do b2b contracting
so there are no restrictions on working hours
you should look for part time contracting
to build experience on a resume
(or just lie on ur resume after ur done with school)
The children yearn for the mines
speaking of children
i will raise my children as software devs from a young age
then outsource my work to them
and when theyre adults i will apply to jobs for them with my resume and let them do the work and take all the money
i should name my eldest son after myself so this is easier to do
you should submit this to expressjs itd be funny
i square to god i will kms
the quickshell systemd service doesn't correctly load singletons when u reload your config so you have to stop and then start the service
It's finally here. Zed is available on Windows.
Built from scratch, and rendering at 1 million pixels/millisecond.
wtf is that unit
fps except it’s dependent on resolution lol
no its fpms
so it runs at 101fps at 4k
thats not that impressive
marketting
@robust jackal ignore how it's so slow but i did it.. (it turns out making a pop out component here is really hard)
i had to go 4 patches deep lmao
hell.
thanks discord!
yay
does the mobile app not have hashed intl keys
I see
average react native moment
not really
usually its 1-2 max
this is just ultra bad
well i should probably do a findInReactTree for that
but i just took it straight from my repl
its fineeeeeee
@cinder egret can you give me brainrot for a sec i wanna see if it explodes
no obviously not lol
im on 213
oh
212
you don’t deserve that ❤️
ignore that lmao
its from a really old plugin i made
import { get, set } from '../common/store';
export abstract class Patch {
static key: string;
static title: string;
static subtitle: string;
static icon: string;
static get(key: string, def?: any) {
return get(`${this.key}.${key}`) ?? def
}
static set(key: string, value: any) {
return set(`${this.key}.${key}`, value);
}
static get enabled() {
return this.get('enabled');
}
static patch(Patcher) { };
static render({ disabled }) { };
}
i made the chat menu thing as part of utilitypatches
which i havent touched in at least 2 years
@hoary sluice @deep mulch
this one isnt interactive because its a very particular fractal
its (|Re(z)| + i|Im(z)|)^2 + c where c is the pixel coordinate
burning ship so cool
show shader code
where did you learn how
wikipedia
is there any guides that isn't just plain math
that's plain math
it literally just tells you
a complex number is z = a + bi
Re(z) = a
Im(z) = b
real and imaginary parts of z
the pixel coord
basically, its like the mandelbrot set
but instead of just z^2 you take the absolute value of the components
min and max are just the bounds of the graph
I hate single variable letter names like that
c.x == Re(c)
c.y == Im(c)
just call it pos
its not pos
@valid jetty im ready
teach me
@valid jetty
rosie either died or is typing an essay
i hate silent typing
im heree
hii
what do you want me to do
can you get a red screen shader
okiee
@valid jetty
ok awesome
rosinga
now define a vec2 for min_x, max_x, and another for min_y, max_y
define a number of max iterations and send it to the gpu
now in the gpu, get these functions so you can perform complex arithmetic
// (a + bi)(c + di) = (ac−bd) + (ad+bc)i
vec2 cplx_mul(vec2 a, vec2 b) {
return vec2(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
}
// |a + bi| = sqrt(a^2 + b^2)
float cplx_abs(vec2 a) {
return sqrt(a.x * a.x + a.y * a.y);
}
you dont really have to know how they work, just that youll be using them
now in your main shader
convert your pixel coordinate into a coordinate from min_x to max_x and same for y
float x = mix(x_min, x_max, fragTexCoord.x);
float y = mix(y_min, y_max, fragTexCoord.y);
vec2 c = vec2(x, y);
that is your value of c
z starts at 0, as defined by the formula
now perform the iterative process the number of times you specified
vec2 z = vec2(0.0, 0.0);
int i = 0;
for (; i < max_iter; ++i) {
// z = (|Re(z)| + |Im(z)|i)^2 + c
z = vec2(abs(z.x), abs(z.y));
z = cplx_mul(z, z) + c;
// if the distance from the center is more than a circle with radius 1, then it diverges
if (cplx_abs(z) > 2.0) break;
}
now, color this pixel however you like
i chose to shade it smoothly but im sure you can figure out how to color it
if not, i did it like this
float t = float(i) / float(max_iter);
t = sqrt(t);
t = smoothstep(0.0, 1.0, t);
t = 1 - t;
float k = t * 4.0;
int l = int(floor(k));
int m = min(l + 1, 4);
float f = fract(k);
vec3 col = mix(colors[l], colors[m], f);
finalColor = vec4(col, 1.0);
where colors is passed from the cpu
and then after, define in compose some way to change min_x, min_y, max_x, max_y using the mouse
this is how i do it in raylib you can use it as reference
funny thing i could theroetically run this in a discord bot
user sends it compose code and it returns rendered image
lmao horror
sorry
This is smaller than my brain
i guess people use vscode because it just works
my whole shader is here if you wanna use it as reference
its very similar to the other fractals i made
now define a vec2 for min_x, max_x, and another for min_y, max_y
on the cpu side?
Try catch is not supported around composable function invocations. guh!
oh i just deleted the stuff i added to my config and it works
also i forgot to install tsx treesitter parser
yes
and pass it to the gpu
Caused by: java.lang.RuntimeException: error: 4: symbol 'min' was already defined if i dont catch it i get this error
because youll be changing it on the cpu side
if i do catch it i get java.lang.Exception: ERROR Unresolved reference 'makeShader'. (script.composable.kts:204:38)
same reason why people use windows
why husk
insane statement
should i be worried by the fact that an import call is taking 100ms
i'm probably doing too much stuff with global initialisation
or idk i guess node.js automatically runs swc for all ts files
that might be a bit slow
how it's insane
comments still showing white in tsx
@valid jetty ar the min and max literally just the bounds of the canvas
yes
something like this
float t = float(i) / float(max_iter);
vec3 col = vec3(t, t * t, t * 0.5);
finalColor = vec4(col, 1.0);
funny thing
apparently sksl doesnt let me use a non-const in for loops
so i have to hardcode max_iter
idk if theres a way around
where would i place that? before the break statement?
nono afterwards
is there a reason finalColor is camelCase
thats just what glsl expects
typically the
i could maybe even return from insie the for loop
uhhh yeah probably
i think i did something wrong
half4 main(vec2 fragCoord) {
float x = mix(x_min, x_max, fragCoord.x);
float y = mix(y_max, y_max, fragCoord.y);
vec2 c = vec2(x, y);
vec2 z = vec2(0.0, 0.0);
half4 final_color = vec4(1.0, 1.0, 1.0, 1.0);
for(int i=0; i < max_iter; i++) {
z = vec2(abs(z.x), abs(z.y));
z = cplx_mul(z, z) + c;
if (cplx_abs(z) > 2.0) break;
float t = float(i) / float(max_iter);
vec3 col = vec3(t, t * t, t * 0.5);
final_color = half4(col, 1.0);
}
return final_color;
}
its solid white
half4 main(vec2 fragCoord) {
float x = mix(x_min, x_max, fragCoord.x);
float y = mix(y_max, y_max, fragCoord.y);
vec2 c = vec2(x, y);
vec2 z = vec2(0.0, 0.0);
half4 final_color = vec4(1.0, 1.0, 1.0, 1.0);
for(int i=0; i < max_iter; i++) {
z = vec2(abs(z.x), abs(z.y));
z = cplx_mul(z, z) + c;
if (cplx_abs(z) > 2.0) {
float t = float(i) / float(max_iter);
vec3 col = vec3(t, t * t, t * 0.5);
final_color = half4(col, 1.0);
break;
}
}
return final_color;
}
solid black now
suspicious
is -2f/2f fine for min/max
i think its working youre just looking at the wrong region or something
this is what youre supposed to see
o
can i see the full code
BURNING_SHIP(
shader = """
uniform float x_min, x_max, y_min, y_max;
const int max_iter = 256;
// (a + bi)(c + di) = (ac−bd) + (ad+bc)i
vec2 cplx_mul(vec2 a, vec2 b) {
return vec2(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
}
// |a + bi| = sqrt(a^2 + b^2)
float cplx_abs(vec2 a) {
return sqrt(a.x * a.x + a.y * a.y);
}
vec4 main(vec2 fragCoord) {
float x = mix(x_min, x_max, fragCoord.x);
float y = mix(y_max, y_max, fragCoord.y);
vec2 c = vec2(x, y);
vec2 z = vec2(0.0, 0.0);
vec4 final_color = vec4(1.0, 1.0, 1.0, 1.0);
for(int i=0; i < max_iter; i++) {
z = vec2(abs(z.x), abs(z.y));
z = cplx_mul(z, z) + c;
if (cplx_abs(z) > 2.0) {
float t = float(i) / float(max_iter);
vec3 col = vec3(t, t * t, t * 0.5);
final_color = vec4(col, 1.0);
break;
}
}
return final_color;
}
""".trimIndent()
) {
var minX = -2f
var minY = 2f
var maxX = -2f
var maxY = 2f
override fun buildBuffer(): ByteBuffer {
return ByteBuffer
.allocate(16)
.order(ByteOrder.LITTLE_ENDIAN)
.putFloat(minX)
.putFloat(minY)
.putFloat(maxX)
.putFloat(maxY)
.rewind()
}
};
eventually i wanna store the shader code in a seperate file
it should be y_min, y_max
these values are wrong
should be -2, -2, 2, 2
GUH!
blame copilot for that
i should disable
lmao
and i pass it in the wrong order too
lmao horror
hmmstill black
unless that single pixel is something
BURNING_SHIP(
shader = """
uniform float x_min, y_min, x_max, y_max;
const int max_iter = 256;
// (a + bi)(c + di) = (ac−bd) + (ad+bc)i
vec2 cplx_mul(vec2 a, vec2 b) {
return vec2(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
}
// |a + bi| = sqrt(a^2 + b^2)
float cplx_abs(vec2 a) {
return sqrt(a.x * a.x + a.y * a.y);
}
vec4 main(vec2 fragCoord) {
float x = mix(x_min, x_max, fragCoord.x);
float y = mix(y_min, y_max, fragCoord.y);
vec2 c = vec2(x, y);
vec2 z = vec2(0.0, 0.0);
vec4 final_color = vec4(1.0, 1.0, 1.0, 1.0);
for(int i=0; i < max_iter; i++) {
z = vec2(abs(z.x), abs(z.y));
z = cplx_mul(z, z) + c;
if (cplx_abs(z) > 2.0) {
float t = float(i) / float(max_iter);
vec3 col = vec3(t, t * t, t * 0.5);
final_color = vec4(col, 1.0);
break;
}
}
return final_color;
}
""".trimIndent()
) {
var minX = -3.5f
var minY = -3.5f
var maxX = 2.5f
var maxY = 2.5f
override fun buildBuffer(): ByteBuffer {
return ByteBuffer
.allocate(16)
.order(ByteOrder.LITTLE_ENDIAN)
.putFloat(minX)
.putFloat(minY)
.putFloat(maxX)
.putFloat(maxY)
.rewind()
}
};
tried changing min/maxs
i have a feeling this is something to do with the difference between fragCoord in sksl and fragTexCoord in glsl
i think im right
try this
float x = mix(x_min, x_max, fragCoord.x / iResolution.x);
float y = mix(y_min, y_max, fragCoord.y / iResolution.y);
yayyyyyy
how make it pretty now
now find a way to shade it properly
yop
i do this
float t = float(i) / float(max_iter);
t = sqrt(t);
t = smoothstep(0.0, 1.0, t);
t = 1 - t;
float k = t * 4.0;
int l = int(floor(k));
int m = min(l + 1, 4);
float f = fract(k);
vec3 col = mix(colors[l], colors[m], f);
finalColor = vec4(col, 1.0);
``` where ```glsl
uniform vec3 colors[5];
``` and
```rs
colors := [
Vector3::new(0.0, 0.0, 0.0),
Vector3::new(0.835, 0.176, 0.0),
Vector3::new(0.937, 0.463, 0.153),
Vector3::new(1.0, 1.0, 1.0),
Vector3::new(0.639, 0.0078, 0.384)
];
for i in 0..colors.len() {
loc := rl::get_shader_location(shader, "colors[{}]".format(i));
rl::set_shader_value(shader, loc, &colors[i].x, ShaderUniformDataType::SHADER_UNIFORM_VEC3);
}
is colors a gradient?
o
its not really
how doesi t owkr
its the lesbian flag lol
you can just mess around with the colors
wait actually
i dont think this one is the lesbian flag
@valid jetty you should run my compose-scripts project on your pc
maybe,,
i changed it because the lesbian color scheme looks bad here
love
on the left
is this just random operations until it looked pretty or is there math behind it
bright
normalize, apply smoothing, flip (so dark regions are inside the fractal rather than outside)
i have 5 colors so i map t to [0, 4], aka the indexes of the color
then l is the lower color, m is the upper color
and f is the fractional part used for blending
then i interpolate and thats the color
@valid jetty how many iterations do you use
300
low iterations look funny
@valid jetty got something that isnt painful to look at
mouse := rl::get_mouse_position();
m := Vector2::new(
x_min + mouse.x * (x_max - x_min) / SCREEN_WIDTH,
y_max - mouse.y * (y_max - y_min) / SCREEN_HEIGHT
);
wheel := rl::get_mouse_wheel_move();
if wheel != 0 {
scale := wheel > 0 ? 0.95 : 1.05;
x_min = m.x + (x_min - m.x) * scale;
x_max = m.x + (x_max - m.x) * scale;
y_min = m.y + (y_min - m.y) * scale;
y_max = m.y + (y_max - m.y) * scale;
}
it's just an affine transform smh
its following the window scale, so it gets stretched if the window is wide
im dumbb
i dont like that
my name rini
hi p
if rl::is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) {
dx := rl::get_mouse_delta().x * (x_max - x_min) / SCREEN_WIDTH;
dy := rl::get_mouse_delta().y * (y_max - y_min) / SCREEN_HEIGHT;
x_min -= dx;
x_max -= dx;
y_min -= dy;
y_max -= dy;
}
i was gonna do that @valid jetty
sowee
evil roie
yayyyyy
you are lumina
you love
lumina
lumina
lumina
lumina
lumina
..
@young flicker can you react wwith lumina so i dont seem insane
as i zoom in it amplifies the existing offset which i need to fix
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
offset
noo dont do that
yeah but thats mean
turn it back on
thank you
@deep mulch now for the fun part
comment out this line and look at the result
leave everything else as-is
offset
its a mandelbrot!!
how it do that
magic
mandelbrot is defined as f(z) = z^2 + c
burning ship is just that but you take the absolute value of the components of z first before you square
yeah
true
@valid jetty
@cinder egret
@valid jetty send that essay in my dms aha
i need to fix the zoomm
i zoom in then dragging the mouse moves it so much
@cinder egret send that essay in my dms aha
I have literally so many Apple products made by Apple
didnt ask @cinder egret
I have literally so many Apple products made by Apple
my dream girl
CREEP
hiiiii
mouse delta
how are you calculating mouse delta
well then clearly whats given to you is wrong or youre using it wrong
dx := rl::get_mouse_delta().x * (x_max - x_min) / SCREEN_WIDTH;
dy := rl::get_mouse_delta().y * (y_max - y_min) / SCREEN_HEIGHT;
x_min -= dx;
x_max -= dx;
y_min -= dy;
y_max -= dy;
``` idk
this doesnt seem scaled by (max - min)
i only have offsetX and offsetY variables that define the cetner coord
i think
detectDragGestures { change, dragAmount ->
change.consume()
val dragDeltaX = dragAmount.x / zoom
val dragDeltaY = dragAmount.y / zoom
offsetX += dragDeltaX
offsetY += dragDeltaY
}
you shouldnt be tracking zoom but instead scaling your min and max by the appropriate zoom
and then your drag deltas should be the same no matter what the zoom is
i get this insane error I havent figured out with my scripts
Caused by: java.lang.ClassCastException: class Script_composable$Shader$BURNING_SHIP cannot be cast to class Script_composable$Shader (Script_composable$Shader$BURNING_SHIP is in unnamed module of loader org.jetbrains.kotlin.scripting.compiler.plugin.impl.CompiledScriptClassLoader @73f717da; Script_composable$Shader is in unnamed module of loader org.jetbrains.kotlin.scripting.compiler.plugin.impl.CompiledScriptClassLoader @459048ea)
@valid jetty
here is my elle render
are the min/max complex plane stuff
yeah
oh wow
changing the start position z_0
roieeee 😭
btw i tried controlling the value of c earlier and it resulted in just solid colors and was useless
hmm what else can i control
ooooooo
the exponent
lol yeah
weirdly enough as you increase the number of iterations the eiffel towers start to fade out
yeah thats the 32 bit float exploding
is 64 bit possible
not in shaders i dont think
it would have to render on cpu wouldnt it
do
what value is changing there
i dont have a z_0
niniii thank you for helping
@solemn rock @wanton osprey @royal nymph
I love ur loading quotes plugin but can i customize the quotes?
i know i can if i custom download into documents type thing for custom plugins, but cant otherwise?
damn bro my fault
rules 9, 10 and 12
should i just switch from solid because i'm too noob
is that a good reason
reactivity seems to be lost across For each boundary
wait no... across component boundary
oh i'm dunmb
there are so many things you need to wrap in closures
hi
u could trial and error but if u want smth easier then I think it’s fair
idk idk all frameworks are kind of magic
what was your first one
i just used vanilla js for years
and then
well ok
i think i might have used jquery a bit
then solid when i actually needed a... solid web application
as doing in vanilla js seemed too hard
alright
well idk u could try react it’s pretty simple and the most popular
or svelte is good too
i think i mainly chose solid because of smaller bundle size
also global state seems easier
you can just have a global signal lol
i did manage to figure out my issue
didn't react get a whole lot smaller recently
why
you mean this stuff?
vue is kinda like that in the same way and it’s easy af
vue was my first framework
it’s good but annoying for big projects
the main thing i keep running into is instead of this
let name;
if (props.game === "undertale")
name = "Toby Fox";
else if (props.game === "deltarune")
name = "Foby Tox";
else
name = "unknown";
return <div>{name}</div>
you need to do this
const name = () => {
if (props.game === "undertale")
return "Toby Fox";
else if (props.game === "deltarune")
return "Foby Tox";
else
return "unknown";
};
return <div>{name()}</div>;
and i don't really understand... why... it's hard to find resources explaining things
with the former it won't properly react to property changes
i guess it does make sense sort of because fine grained reactivity
but i feel like i don't really understand what's hapenning still
then again i guess most react developers probably don't learn what's going on under the hood and it also has confusing quirks
idk seems like that means the component isn’t rerendered when the props change
at least not in a way I’m familiar with
i think solid probably relies on a lot of compiler magic
doesn't react have a compiler but its optional
same way you cant destructure props
i think the main issue is unlike react where it tells you when you break the rules solid doesn't
the components function only ever runs once
you can do this with react too, just have to write a smell helper or use a contextprovider
yea ik
or smth like zustand
but <>{this}</> creates a rendering scope
so that part in {} basically gets turned into a function
that's what the solidjs magic is
u mean the auto imports?
with the store concept
here name is calculated once on the component, the accessor is what keeps it reactive
yes, take a look at dom-expressions
ah yeah thats the thing
projects i return to after not touching for months my beloved
I think you can
I remember writing this feature.
@valid jetty I made a Julia fractal last night
I was trying to get variables passed in but didn't finish
theoretically it's possible to make my script project run in the browser
what is that fps counter i keep seeing it
it's raylib I think
yayyy
I should add a fps counter
oh
faints per second
idgi ❓
i made a flag to turn burning ship into mandelbrot and look at this
everywhere there is a ship, there is a corresponding mini mandelbrot bulb
thats really cool its so smooth
yeah its awesme
The react compiler pretty much just helps reduce boilerplate
✅
ty
how do i make game loop run at like consistent rate. do i like do sleep or
while (1) {
float delta = curTime - lastTime;
if (delta < UPDATE_RATE)
continue;
update();
}
fuhh off gng
sleeping is imprecise
what about nanosleep or same thing
look at how raylib does that
https://github.com/raysan5/raylib/blob/master/src/rcore.c#L920-L1034
or what’s it called
tyy
oh
that's going to use 100% cpu
nanosleep is fine
https://blog.bearcats.nl/accurate-sleep-function/#timers-on-windows windows has some interesting stuff. They also have a method for partial busy waiting above
Programming and game development blog.
seems good
guh that sounds like too much work. i mean i could just blindly copy paste it but id rather figure out how it works. i can just uh not use windows 
oh seems like raylib just uses Sleep()
figure out how it works
doesn't the post explain it? or do you mean waitable timers
oh i thought the part above was irrelevant so i thought it was only those two paragraphs
