#Foundations - Learning Graphics Programming with the Zig Programming language

1 messages Ā· Page 3 of 1

delicate delta
#

made my camera and grid reusable froge

delicate delta
#

I like how I can just give a function a type T as an arg and then start calling functions on a variable of that T without having to define any kind of interfaces, just pure ducktyping preguana

#

it is just automatically inferred at compile time what the constraints of T are based on how I end up using it

verbal mason
#

I don't like C++ all that much, but it just gives me the most control

delicate delta
#

you get a lot with C++, it's pretty robust I kind of wish I was writing C++ sometimes, like when I realized I had no good ecs options

#

tons of stable libraries

#

all the editors and debuggers work

#

all the books and websites use C++ examples

#

lots of people on the server can offer advice, although I can get that on the zig server

#

despite all the problems though I just really like zig

#

I've never once had a single footgun or gotcha moment in nearly a year of using it

verbal mason
#

ended up switching to flecs just to save time, cause it was fully featured, but for some simple stuff it's not more than like 1 week of work

delicate delta
#

yeah I am going to basically write something of a game engine a little bit as I go along

#

not all at once

#

I'll try to keep in mind how I would use an ECS and try to build something similar as I go so I don't get into too much of a mess, and once it performs badly it'll be hopefully isolated behind an API and I can change how that part works without having to rewrite everything

#

writing my own pseudo ECS or making zig bindings for flecs are basically equal amounts of work and if it came down I'd rather just write the zig bindings for flecs though

delicate delta
#

It took me like around 2 minutes to build a brand new scene with a grid and a move around look at camera

#

just that little amount of code there

#

also I caved and did it camel case :<

#

now I need to figure out what an infinite plane should look like

delicate delta
#

I couldn't help but keep working on my camera

#

it now has smooth deceleration, I think decent mouse sensitivity and behaves really nicely, and adjustable speed

#

it's pretty nice now, fully time step and using integration

ivory verge
#

: )

delicate delta
#

I added coderabbit to my repo and it gave me a nice diagram of my scene

delicate delta
#

not doing any math just yet

#

I need to reread the plane math

delicate delta
verbal mason
delicate delta
#

trying to just create arbitrary plane position and normal orientation

#

via the parameterized plane [n|d]

#

this is an infinite plane

#

but drawing it like that looked not great

#

it'll make more sense when it's right

#

I am going to put a little ball at an arbitrary 3D point and have it calculate the distance to the plane and which side it's on

#

and I'm also going to do an arbitrary plane reflection

#

so move and rotate a cube around and it will be reflected across the plane

#

the controls are wrong, it's possible to create a zero vector via cross product, I have to just reread the plane stuff

delicate delta
#

I need a little pointer thing to tell me which way a plane's facing

#

so I'm building a cylinder mesh and a cone mesh, and will combine them to create a little pointer object

delicate delta
#

now I need to make a cone

ivory verge
#

i really enjoy watching this journey šŸ™‚

queen hinge
# delicate delta yay

Those colors are supposed to be the normals?
If so, doesn’t look right to me—the bases should have a single normal vector, not a gradient

delicate delta
#

There’s no base

queen hinge
#

OH

delicate delta
#

It’s just open at the ends

queen hinge
#

Yeah that makes a lot of sense

delicate delta
#

I have circles I could use, this is just the cylinder sides

#

I calculate surface normals via tangents which I get by subtracting points of a triangle

#

I take the cross product of the tangents as the surface normal

#

Looks like that’s what that also says

queen hinge
#

Sounds like what that page is doing, yeah

#

I go for that page because it’s really easy to find it
So for that like one time every couple moths that I start a new rendering project I can just google it

delicate delta
#

I just sit next to a mountain of math books and use those:P

#

The point of this project is to build reusable code I can just give it three points and get all that for any future projects

#

Like all these shapes I can use in the future once I have built them

#

I am going to delete my cube now that I have my parallelepiped actually, it’s way better

#

Cubes suck tbh

queen hinge
#

Especially considering I tend to have like 1% of my code even being able to be shared

delicate delta
#

How is your project going?

queen hinge
#

My game engine?
On pause
Currently trying to make an LLM model

delicate delta
#

Oh nice

#

I use those for work

queen hinge
#

I got my LLM model to something that could loosely be considered as learning

#

Aka before training it generates random tokens and after training it generates <finetune_right_pad_id> over and over KEKW

delicate delta
#

That’s cool i

#

haven’t looked into that

queen hinge
#

Granted my dataset is also unrelated to my usage and I don’t think a suitable dataset exists bleakekw

#

(Multiuser conversations is what I’m trying to get working; LLama3.1 is somewhat ok at those but it’s noticeably not meant for it)

delicate delta
#

Sounds expensive tokenwise

queen hinge
#

<|begin_of_text|>
<|start_chat_header_id|>User<end_chat_header_id>
Hello! How are you?<|eot_id|>
<|start_header_id|>instruction<end_header_id>
You are a chatbot, designed to respond to the user.<|eot_id|>
<|start_chat_header_id|>assistant<|end_chat_header_id|>
I’m using a prompt format derived from llama’s

delicate delta
#

Neat it’s too close to what I do for work these days

queen hinge
#

Hm?

delicate delta
#

It would just feel like my job to do anything ai related

queen hinge
delicate delta
#

I work with azure ai studio and copilot all day now

#

Writing prompts and state machines for helpdesk support

queen hinge
delicate delta
#

That’s what I was thinking I would do

#

Summarize context

queen hinge
#

KEKW that summary step is what’s running into context length limits

#

It’s also extremely incoherent with names

#

Which is
a huge problem for a discord chat bot

delicate delta
#

I have never run a model myself

#

Well I tried and my fan came on and I exited

queen hinge
#

Basically
My thought is
what if I use up to 4 NNs to encode the context into a fixed size block of data

delicate delta
#

Neat project that’s way beyond my level of understanding. I got enough trying to learn geometry and graphics :P

queen hinge
#

Also
I hate admitting this
But python’s debugger is kinda neat

delicate delta
#

I love jupyter notebooks only time I use python anymore

queen hinge
#

Step over doesn’t murder performance

#

I’m using HF Transformers for my AI stuff and I’m kinda doing it for a discord chat bot
So my options are either:

  • use actual python scripts
  • transpile python to java (pretty sure I need to write the transpiler myself)
#

I am absolutely not writing the discord portion of a discord bot in python, that sounds like a nightmare KEKW

delicate delta
#

Yeah I agree

queen hinge
#

I’m currently just using the input/output streams to have java communicate with python and vice versa
which is, not a great solution but it does work

delicate delta
#

Like http2 or bare socket or tcp

queen hinge
#

Those would be the proper solutions, yes

delicate delta
#

Lol

queen hinge
#

I’m using print() and input()

#

Console IO

delicate delta
#

Ah

#

Hey if it works

queen hinge
#

I mean so far my program hasn’t crashed in the like
probably already hundreds of messages I’ve had it generate

queen hinge
delicate delta
#

You could spin up a small k8s or docker compose if you wanted something fancy

queen hinge
#

I think I need performance

#

The game also reduces the program to like 1 message per minute

#

Which is, another reason I’m trying to make my own model

delicate delta
#

Forgot we’re talking about gpus when I started thinking about services

queen hinge
#

I mean the game I’m referring to is an unreal engine game
And unreal engine is a large GPU hog

queen hinge
delicate delta
#

Oh interesting hrmm

#

They do get slower

#

Yeah even the accuracy thing I noticed too in larger contexts

queen hinge
#

Transformers has a warning when over the length limit
Different models respond differently to the context limit according to said warning
What this means exactly? not sure
So far I have yet to go above… I believe I currently have the limit set as 4096

#

For some reason I made it so users can upload multiple files to my system at once
KEKW users can upload like 5GB of data as a prompt if they have discord nitro

#

Users can also upload PNGs, which seem to deadlock response generation

delicate delta
#

Do these models have raw embedding extraction options, like just the vectors, for storing contexts

queen hinge
#

Unsure what that means

delicate delta
#

Embedding models let you extract embeddings which are like huge multi dimensional arrays of data

#

But it would be a more compact format for maybe

#

Storing conversation context for example

queen hinge
#

I’m not storing conversations, actually

delicate delta
#

I don’t know about these small open source models

queen hinge
delicate delta
#

Basically you store shit in binary form, it’s a black box that we don’t really understand

queen hinge
delicate delta
#

Human brain too small

#

I loaded it in safari lol

queen hinge
#

It’d be more reasonable for me to store tokenized data instead of embedding data tbh

#

Which actually I think would be ~40-75% compression ratio
But also I’m using json and I think json would freak out with that bleakekw

queen hinge
#

On iPhone it loads the page
Then abruptly reloads
Then abruptly errors

queen hinge
delicate delta
#

iphone safari

queen hinge
#

first coherent sentence my LLM has ever generated:

I have a problem

delicate delta
#

:S

#

shut it off it's not a good signal

queen hinge
#

I’ve already shut it off because it was gonna take 5 hours and I kinda don’t want to wait 5 hours

delicate delta
#

you should get back to graphics programming

queen hinge
#

But I wanna innovate and doing that in GP is difficult due to how long GP has been around and been a focus of things-

delicate delta
#

to innovate in GP you have to get really specific

#

like that fog guy that works at unreal

#

he's got like a PHD in fog

queen hinge
#

More specifically I also wanna innovate for low to middle end devices
There has been, little to no focus on high end models for low end devices afaik

#

Oh hey that thing you said about storing the embeddings
KEKW that’s a viable idea for one of the things I’m thinking of

#

So
Considering I want this to be a high end model for low end devices
I kinda, don’t want to actually train everything into it
I’d rather have it deal a lot with what it’s given as inputs, and be able to have it request extra additional inputs for a given topic to substitute the extra training data

queen hinge
delicate delta
#

nice

delicate delta
queen hinge
#

my brain can't comprehend the open bottom KEKW

#

anyway, how's that mo-
oh
I see how that's more c-
no I don't-
do I

#

yeah I don't see how that's more complex than a cylinder

delicate delta
#

it's a smoll brain thing I guess

#

with a cylinder you rotate all vertices of a quad to assemble the cylinder

#

with this cone I walked the bottom triangle vertices around a circle

#

and each triangle's first bottom vertex starts at the previous triangle's bottom vertex

#

I think cylinder is much less complex

#

it's just one matrix per quad

queen hinge
#

I think I'm being hecked over by huggingface transformers works KEKW

height = 1;
radius = 2;

for (double rad = 0; rad < rad_360; rad += rad_1) {
  double x0 = cos(rad) * radius;
  double z0 = sin(rad) * radius;
  double x1 = cos(rad + rad_1) * radius;
  double z1 = sin(rad + rad_1) * radius;
  
  addTri(
    x0, 0, z0,
    x1, 0, z1,
    0, height, 0
  );
}```
#

I do, operate on a per triangle basis by default

#

so I am also biased by that fact, since a cylinder is 2 tris per face

delicate delta
#

you don't think that's more complex

queen hinge
#

than doing the same thing but with 2 triangles instead of 1?

delicate delta
#

I am not so good at math that I can just look at trig and visualize what it does unfortunately

#

that looks like one triangle per loop but, I have smoll brain

queen hinge
#

I literally wrote this out in discord, lol
sin combined with cos creates a circle

#

sine on one axis, cosine on the other
doesn't matter which is which, it'll create a circle

delicate delta
#

right

queen hinge
#

that's the only bit of trig you need to know for a cone

queen hinge
delicate delta
#

oh I see what you're saying

queen hinge
#
height = 1;
radius = 2;

for (double rad = 0; rad < rad_360; rad += rad_1) {
  double x0 = cos(rad) * radius;
  double z0 = sin(rad) * radius;
  double x1 = cos(rad + rad_1) * radius;
  double z1 = sin(rad + rad_1) * radius;
  
  addTri(
    x0, 0, z0,
    x1, height, z1,
    x1, height, x1
  );
  addTri(
    x0, 0, z0,
    x1, 0, z1,
    x0, height, x0
  );
}```good chance I have this wrong
delicate delta
#

cool

queen hinge
#

actually kinda curious how scuffed that cylinder algo I just wrote it

#

but I don't really wanna setup an entire renderer just to test it KEKW

delicate delta
#

idk man it was hard for me, but you did it in 2 seconds in discord šŸ‘

#

noice

#

obvious in retrospect that is correct

queen hinge
#

I feel like if I make a custom generate algorithm I could probably reach that point in a few dataset entries instead of like 12k dataset entries or whatever

#

of note; I also do not understand the generate function at all, for I have not yet interacted with it on a lower level than just calling it and debugging some crashes

delicate delta
#

"I'm not have a good" perfectly describes me rn

queen hinge
#

I still love how the first sentence my LLM ever generates was "I have a problem"

#

also
I don't understand this perfectly yet, obviously
but it seems to me like it's gonna be output count that drags down speed more than input count
so I think I should be able to give it a large input count and small output count for a semi-reasonable speed
or alternatively, I do weird things, which seems like the more fun option

#

something I could do
is cut my inputs into pieces
cache the embeddings for the inputs into a variable
then when those inputs are next seen, until an unrelated input is provided, I just use those same embeddings
and piece together the embeddings into a single nd array and go from there

#

I think

delicate delta
#

how many dimensions are the embeddings

queen hinge
#

What's for lunch?<|eot_id|>
<|start_chat_header_id|>assistant<|end_chat_header_id|>
What's a problem? <|eot_id|>
<|start_chat_header_id|>assistant<|end_chat_header_id|>
well that's a new output sentence

queen hinge
delicate delta
#

what for lunch is too complex of a prompt, ask it something simple, like how to draw a cone

queen hinge
#

that's not in my dataset at all

#

I don't even know if what's for lunch is anywhere in my dataset
but it seems probably based off the like 2 entries I looked at KEKW

#

but yeah I want this thing to be as close to real time as possible
I'm gonna do my best to accelerate it in any way I can

delicate delta
#

more gpus

queen hinge
#

okay any programmatic way I can bleakekw

#

oh I should avoid training the model on full conversations actually

delicate delta
#

well they can run pretty capable models on small devices, it's the training where you need more hardware? idk

queen hinge
#

Well yeah, if you quantize the model it can run at a reasonable speed for short conversations
Problem is, that’s not several simultaneous long conversations

#

I have
I believe a [high end for home computers] computer, and even that isn’t really good enough for a high enough quality one

Granted I’m also severely limited in the fact that most prompt formats die if you decide to use a username instead of a role, since that’s sorta the best way to prompt-injection-proof naming, and there’s no models trained for that

#

unsloth 8B models are about the highest I can reasonably run for any kind of performance, and even that’s struggling in both performance and quality

#

Quantization also tends to slightly reduce output quality or change the output drastically from my messing around with LLama3.1 quants

granite bolt
#

So many text messages and no talk about books

delicate delta
#

I've been in saving my job mode for the last 2 and half weeks, so only have had a tiny bit of time to do any of this, otherwise be boring you with my book reading rn

#

I usually spend about 4 hours a day on weekdays and nearly all of the weekend working on my game engine when I'm not doing stuff with my family, but it's just a lot of working late nights and weekends right now trying to make unhappy customers happy again

delicate delta
#

I have a pointer

delicate delta
#

I haven't fixed any of the plane rotation around an arbitrary axis and the normals are all wrong also but I am now pointing in the direction of the plane

delicate delta
#

ah I figured it out thanks to renderdoc, I just had to normalize my normals after the inverse transpose

verbal mason
delicate delta
#

Yup makes sense!

#

I think I will fix my weird rotation by always rotating around the axes of the plane instead of an invisible arbitrary axis

#

I will have to convert it to the axis angle though

#

Well

#

I have to read the math again facepalm it’s just [n|d]

#

I don’t know why planes are so hard for me

#

I am going to get it soon

#

The goal here is to just change the parametric plane values [n|d] and the. draw it based on the values of that four d vector

#

I am drawing a sub plane of the full plane , the center is the plane’s closest point to origin

#

Then I will add a sphere and a cube and move them around and find their closest points to the plane and reflect them across the plane

#

I think I got it

verbal mason
#

cool

delicate delta
#

I fixed a bunch of stuff, I fixed the ridiculous grid scale, I fixed camera, grid and plane positioning, I made pointer look more like pointer, normals are all correct. I'm ready to make progress again

#

now that the grid scale is actually sane I think maybe the camera sensitivity seems too high again

#

all of these fixes, fix everything going forward, these are all fixes that impact everything going forward, the camera, the scale of things, the normals of things

#

these aren't one off fixes for this particular scene, so when I make a game eventually all this will make that game better

delicate delta
#

the cone normals inverted also

#

seems correct now though

#

just the sphere is horrid

#

that's a little better, now the holes

#

just bad geometry

elder kettle
#

Kind of a funny looking sphere

#

But yeah I don't think you want the triangles to align like that

#

I would generate it basically as if it were quads and then triangulate each one

elder kettle
#

It should be basically the same as an algorithm to generate a grid, except that you take the x and y position of each vertex and use them as lat/long instead

delicate delta
#

yeah

#

what's funny looking about it?

#

besides the holes

#

I made it before I had a projection

#

so couldn't see all the problems with it then

elder kettle
#

Yeah just the alignment of the triangles, the way the tip of one lines up to the edge of the other

delicate delta
#

yeah

elder kettle
#

that's inevitably going to cause gaps unles the mesh is flat

delicate delta
#

it's just bad geometry code

elder kettle
#

yeah that's all I was referring to

queen hinge
#

I favor using a shader to project a sphere out of a quad

#

Also for spheres
I recommend icospheres, personally

delicate delta
#

this is just a first iteration

#

I'll probably make a bunch of different ones eventually

elder kettle
#

icospheres are a pain, UV spheres are straightforward

queen hinge
#

I do not like UV spheres

#

They are straightforward, yes
But I want even point spacing

elder kettle
#

Then you will suffer for it

delicate delta
#

I am going to fix this sphere I guess

elder kettle
#

Might I offer a compelling alternative: a cube

#

jk the sphere is fine

delicate delta
#

I don't want to spend forever on this right now I'm going to see if I can these holes plugged, I'll make a better sphere eventually

#

I am going to delete my cube, I have a parallelepied that's a million times better

elder kettle
#

fix it if you like, but cubes can be colored to have the faces represent the XYZ basis vectors too which is nice, it has a recognizable orientation

delicate delta
#

parallelepiped

elder kettle
#

alright

delicate delta
#

oh

#

I mean it will act as a cube

#

if I want it to

delicate delta
elder kettle
#

I'm just kidding around too just do whatever you like

#

I like the vector thingy up there

delicate delta
#

thanks!

elder kettle
#

personally I just use bare lines as debug vectors but that's fancy

delicate delta
#

bare lines are cool, I was also thinking about dashed lines for some debug things

#

like when I have an AI and it does path finding

#

I was thinking like a dashed debug line to show where it's going

elder kettle
#

yeah

delicate delta
#

it's got some rough edges, but works for now

#

I will make something better eventually

#

yikes

elder kettle
#

There's no escape šŸ™‚

delicate delta
#

this sphere will cut you

#

hrm lat long huh, I actually am using that

#

spherical coordinates

elder kettle
#

Yeah

#

You should just be able to have a double for loop that goes over incrementals of the polar and azimuthal angle

#

And makes points

#

And then the index scheme is the same as a grid

delicate delta
#

yeah the holes are gone but this is gross

elder kettle
#

They don't seem to be quite gone in the sense of being an actual manifold mesh they just appear to be gone

delicate delta
#

right

elder kettle
#

Whereas the UV sphere as I'm describing will only have singularities at the poles

#

And they'll be invisible anyways

#

It'll only be broken in the sense that the coordinate system doesn't lend itself to calculating a surface normal at the very top point

#

But actually you can anyways since we can do it analytically

delicate delta
#

I'm getting the normals by just shooting them out from the origin

#

not using the triangles at all

#

it looks right though

elder kettle
#

Yeah that's even easier

#

It should be for a perfect sphere

#

(kekkedsadge)

delicate delta
#

how is this not perfect

#

jk

elder kettle
#

It is, I'm laughing at my own suffering from my non-spherical earth terrain system

delicate delta
#

your terrain is mind blowing, I think it is amazing and if I ever achieve anything half as good I would be pretty happy

elder kettle
#

It's a testament to my stubbornness

#

And stupidity

delicate delta
#

I am not very fast but I am committed and I do the work. It works for me.

#

this is not a good sphere but it works for this scene I want to get back to reading so I'm going to do all the plane stuff

#

I bet one of my many books has a sphere in it

#

I am going to use a cube actually for the distance measuring

elder kettle
#

Spoiler'd in case you don't want it to be given away but the position part of the UV sphere is just
||```cpp
int stepsAzimuth = 32;
int stepsPolar = 16;
float r = 1.0f;

std::vectorglm::vec3 verts;

for (int i = 0; i < (stepsPolar+1); i++)
{
for (int j = 0; j < (stepsAzimuth+1); j++)
{
float az = 2pifloat(j)/stepsAzimuth;
float polar = pi * (1.0f - float(i)/stepsPolar);
glm::vec3 pos = r * glm::vec3(sin(polar)*cos(az), sin(polar)*sin(az), cos(polar));
verts.push_back(pos);
}
}

#

I will leave the index generation as a graph paper exercise

delicate delta
#

I was actually writing some code doing quads just now because I couldn't let it go :P

#

I haven't looked your spoiler yet let me see how far I get

#

I think my original solution I realized I need more triangles near the equator so I came up with something convoluted one late night

#

but it doesnt need to be

elder kettle
#

yeah

delicate delta
#

I like the quad idea

elder kettle
#

If you want to be clever you can skip some of the triangles at the top so that the ends come together nicely but personally I just allow a whole row of verts to collapse to a point at the poles and just call it good

#

at which point it's literally just a grid

delicate delta
#

yeah I'm writing a grid now using spherical coordinates

#

idk we'll see. I just reduce the grid to very few quads at first it should be somewhat spherical, and simple to debug any issues and then I can increase the grid size and it will look more sphere like

elder kettle
#

good luck

#

I'm going to sleep but I'll see your results tomorrow

delicate delta
#

gn!

delicate delta
#

already looking better

#

let me try it with more points

#

holy fuck

#

looking great

#

that was so easy

#

that took me like 10 minutes lol

#

I always over think this shit

#

ok mine is a bit different, my spherical coordinates do have the same trig though

#

I'm a bit more explicit in my quad/indices, I can't quite visualize the quad/triangles in your solution, though I can see the points as a sphere

#

no more sharp edges

#

it has the same number of triangles though for each band gpAkkoShrug

#

it's so pretty though

#

thanks for your help!

#

I am so glad I stick with that dumb thing I had before

#

here it is with a orthographic projection

#

alright time to add a cube

delicate delta
#

these normals are looking great man

#

I got these things rotating around their centers now too

ivory verge
#

why is your x up?

#

are you an xup lizzard?

delicate delta
#

so I can make a finger gun when I am thinking about my coordinate system

ivory verge
#

: )

#

i pictured it immediately hehe

delicate delta
#

I like this scene so much I made it a banner on my githubs

elder kettle
#

Someone stayed up late hehe

delicate delta
#

Makes sense

#

I am duplicating vertices I will fix that, it was late

elder kettle
#

Jeez someone's up early too lol

delicate delta
#

Yeah would be better to sleep more

#

For reflecting the cube across the plane, I am just going to draw triangles, i have only read about the reflection math for points so far. This scene is just about basic plane math

#

I will just iterate over the points in the cube, reflect three at a time and literally just draw triangles just for the demo. I hope to wrap it up today

#

Then work on a frustum plane extraction culling scene

#

Maybe I can get both done today

elder kettle
#

I can't remember off the top of my head what it entails in general

#

I think just reflecting all the points works

#

The only potential snag is that it may require reordering the indices to change the winding order

#

Or just flipping the cull face direction

delicate delta
#

Yes, I will find out. Hehe

delicate delta
#

AI giving me PR reviews (I hadn't written tests or used this yet so no compile error heh)

delicate delta
#

just need to reflect that cube across the plane and am done with this scene frogepinkhappy

delicate delta
delicate delta
#

I want to theme my dear imgui tbh

ivory verge
#

please do šŸ™‚

#

im curious with what you are going to come up

delicate delta
#

probably won't do it right now I want to get back to reading I'm just tired of looking at it

#

feels so vanilla, everything else I put so much work into it

elder kettle
#

You could use someone else's

#

I like the old school steam one

delicate delta
#

yeah that sounds cool even just to look at it to see how theming is done

#

I'm working on reflecting finally

#

I know these things aren't games but they're pretty fun to work on

#

feels great when you see the math work

elder kettle
#

You can theme it just be opening the demo window and tweaking the properties in the theme editor

#

And then export

delicate delta
#

oh

delicate delta
queen hinge
ivory verge
delicate delta
#

back to working on my sphere

#

I'm going to have a reallly nice sphere

#

100% worth it

delicate delta
#

it has a single point on top and bottom

#

it's amazing

delicate delta
#

for my plane extraction I was thinking demoing a little voxel scene with my parallelopiped instances via stb_perlin

#

the failure to extract planes from my frustum was the reason I stopped working on blockens, this will be a pretty feel good scene once I get it working

queen hinge
delicate delta
#

yeah

#

it's one buffer

#

vao and index data are in the same buffer

queen hinge
#

huh I have never considered sharing a buffer for the two

delicate delta
#

oh maybe I'm lying

#

I'm sharing instance data and attribute data

#

not indices

#

sorry

queen hinge
#

Also
One of the problems with using a game engine instead of making your own and just hardcoding everything
There’s a chance that your game just decides to corrupt bleaker_kekw

delicate delta
#

:S

queen hinge
#

Godot crashes ~5 seconds after I open my project, and my fog volumes corrupted bleaker_kekw

delicate delta
#

I've never used a game engine

#

nfi how they work

queen hinge
# delicate delta

So this is actually probably my least favorite sphere meshing algo in terms of sphere aesthetic

delicate delta
#

I love it

#

although

#

this is all I've done with it

#

maybe uv mapping or lighting or other stuff is harder

#

I have no idea how to do any of that yet

#

I mean compared to what I had before, which was just broken, I like this for sure :P

#

I wrote my own trig for this one :O

elder kettle
queen hinge
#

UV spheres are the easiest spheres to make
They are also the easiest to UV map

Icospheres have an even point distribution (these are my favorite)

#

The one you did is also a bit too mathy for me, given the fact that I really don’t see any potential advantage to it

queen hinge
#

Well
I would say stuff like specular and metalic and stuff but I actually don’t know anything about those

queen hinge
# delicate delta

I can tell godot also uses this sphere geometry, due to the top of my bubble being a bit wonky; I’ll probably make an icosphere in blender at some point or smth ig

delicate delta
#

looks amazing

#

icospheres look really cool

#

I'll probably give that go at some point

delicate delta
#

took me like two minutes to add stb_perlin noise result 0.984375

#

hrmm

delicate delta
#

I like my camera

ivory verge
#

2d equalizer šŸ™‚

delicate delta
delicate delta
delicate delta
#

Back to reading! I got about 5 books that each have a perspective chapter to get through now and then read the 3D math review chapters in the books like GEA and then I am out of the math kiddie pool and on to actual graphics programming topics instead of basic math and geometry

delicate delta
#

I think I might just drill down the opengl book and get through it after I get through these chapters, I'm kind of blocked less on math at this point and more on how to use OpenGL, like I don't know anything about attachments or separate frame buffers or much at all about opengl textures beyond the basics

#

if I get blocked on math somewhere along the way I'll switch back to the math books, probably on lighting, I don't know anything about lighting or shadow math

#

if it's just basic vectors stuff though I should be fine

delicate delta
#

I have culling now working with two different methods:

  1. getting the planes via the linear combination of the camera matrix columns and the the focal length and aspect ratio
  2. by extracting planes via the transpose of the full model to view perspective transform, including the look at and the x up coordinate space transform
#

they both work

#

I literally pieced the math together from three different math books

#

They all had a different piece of the puzzle

#

One book has a zup coordinate system, one has a yup and the other has a camera y down world y up coordinate system

#

None of them have an xup

#

One book is left handed the other are right w

elder kettle
#

Left handed is cursed idk who is using that unironically

delicate delta
#

None of them explain how handedness and up affect the plane extraction math

#

I am lol

elder kettle
#

oh no

#

Anyways it just puts a bunch of sign changes in random places

delicate delta
#

It is good for me forcing me to learn more

elder kettle
#

I would really suggest using right handed though that's what like all of math and physics uses

#

but fair enough

delicate delta
#

Yeah these books just don’t bother to explain how the math is different

#

The 0 to 1 Z NDC also was a trip

elder kettle
#

I would have to derive the rotation matrices and stuff

#

maybe it doesn't affect the basic transforms that much

#

but it would really fuck with my head so I'd prefer not to think about it too much lol

#

all of my years of math education have been in RH coordinate systems so trying to do it in another is like trying to read a foreign language

#

I'm sure I could figure it out with some conditioning though

delicate delta
#

I think I kind of am stuck with my left handed x up

#

Like I am conditioned now by my normals and constantly having to map y up book math to x up

#

I Actually really like it

#

Y pointing into the screen is great

#

x and y are up and forward, z horizontal

elder kettle
#

I have Y into the screen too

#

I just have X to the right and Z up

#

Typical ENU (east, north, up) coordinates

delicate delta
#

it's mostly just contained to a single matrix concatenation, but the plane extraction was much harder because of my weird coordinate system

elder kettle
#

what is plane extraction

#

idk what that's referring to

delicate delta
#

from the clip space

#

getting the planes that make up the surfaces of the clip space volume

#

into camera space

elder kettle
#

ah

#

oh for frustum culling

delicate delta
#

and then into world space

elder kettle
#

I see

delicate delta
#

yeah

#

so the easy way is to just take your camera matrix and do the linear combination thing

#

doesn't even involve the perspective matrix

#

like the left plane from the view frustum I extract via adding the second column of my camera matrix multiplied by the focal length and third columns of my camera matrix multiplied by the aspect ratio

#

the other way from clip space it's the addition of the inverse of my mvp transform's fourth column by its first

#

and then inversing the plane distance

#

I just didnt realize how much harder that would be because of coordinate system decisions

delicate delta
#

it's interesting how the planes are similar but not equal

#

also my sphere has too much geometry to instance spam it

#

I need like a sphere LOD

delicate delta
#

it uses glFrustum, uses a height/width aspect ratio where the plane of perspective height is the +/- aspect ratio, and mentions that some older GPUs don't do perspective correct interpolation

#

it also uses the -1 to 1 Z clip space

#

the math is still correct and interesting though

#

published in 2011

#

discusses a reflection perspective matrix also, so not that old I guess

#

perspective matrices are pretty complex and I understand now why they're so far into these books, people don't want to wait to get to 3D but in a math book you have to work through the math because if you're starting at 0 it's not going to be understood

#

the whole viewing in 3D is pretty complicated objects get moved to world space, then get moved into camera space via a reverse camera matrix, then projected into a view frustrum onto a projection plane into a clip space which is not 2D, you're still 3D, then you're in shaders, then you're in clipping and rasterization, and now you're working on pixels that get put into framebuffers

delicate delta
#

Not super interesting I'm sure, but I wrote this in my notes when trying to explain how a projection matrix works just from my understanding:

In a perspective matrix the x and y of a point have to be mapped into the x y coordinates of the projection plane, this is done by casting a ray from the camera through the point onto the projection plane. The aspect ratio and the focal length(the distance from the near plane to the projection plane) determine the shape of the projection plane and thus in the perspective matrix the first two entries in the diagonal achieve this transformation of x and y, in the case of older platforms a linear combination required more columns than just the diagonals for anx and y. This is probably because of the shape glFrustum took. In any case the z needs to be transformed into a reciprocal (1/z) by the projection matrix for the purpose of being interpolated into the clip space depth volume to then be transformed into a value in the depth buffer after division by w. The reciprocal is is also used for perspective correct interpolation of vertex attributes. The z value of the perspective requires the depth scale created by the near and far plane and thus the z value ends up being transformed by a linear combination of two components in the third row (in a column major matrix).

#

I didn't state that because the projection plane's x is twice the size of the aspect ratio it's multiplied by focal length and divided by the aspect ratio, and the y is just multiplied by the focal length, but I know that. The z projection math is harder to explain, but I think I got the high level of it.

#

probably the hardest to understand matrix so far

maiden gazelle
#

I like Cem Yuksel’s explanation a lot

#

It is intuitive in that perspective projection is divided into two steps: perspective transformation + orthographic projection

#

It was easier for me to internalize that way

#

I also used a combination of sources to tackle this topic

#

Introduction to Computer Graphics.
School of Computing, University of Utah.
Course website: https://graphics.cs.utah.edu/courses/cs4600/fall2020/

ā–¶ Play video

Perspective matrices have been used behind the scenes since the inception of 3D gaming, and the majority of vector libraries will have built-in helper functions to construct them for you. But what if you wanted to know the reasoning behind how these matrices are constructed.

I start off with a brief introduction of computer graphics and the k...

ā–¶ Play video
#

Also took some notes if you want to compare

wise imp
#

i feel like directly learning a bit of the core math works well too

#

khan academy linear algebra stuff

#

so that you learn about things like vector spaces

maiden gazelle
#

Definitely

#

Also, I could not keep up with this thread coming in so late as I did

#

I’m watching you though beware šŸ¦‰

#

Awesome stuff in the works, kudos!

delicate delta
#

even understanding perspective geometry isn't enough, because that's not what the perspective matrices we use in our games do, it's not a simple perspective divide

delicate delta
#

the result of a perspective matrix in games and game engines doesn't simply project a 3D point in 2D, it is a homegenous 4x4 matrix that instead performs a transformation from 4D to 3D, the end result being a 3D point in clip space, not a 2D point, because the depth needs to be preserved for hidden surface removal and perspective correct interpolation of vertex attribute data

#

so you have to also understand graphics apis and the rendering pipeline, and on top of that you have understand how virtual cameras work and coordinate system transformations and NDC because the shape a perspective matrix takes will vary considerably based on these

#

an infinite reverse matrix takes into account floating point precision near the far plane, so there's even more

#

or you can just use the glm perspective function and be happy with what you see if that works for you

delicate delta
#

So reading through Essential Math I realized that I don't need to inverse my camera matrix, although that works, there's a more performant option which is to transpose the upper 3x3 of the camera matrix and then multiply the transform the translation from the camera by that and negate it

#

pub inline fn cameraInverse(m: matrix) matrix {
    var r: matrix = .{
        .columns = .{
            .{
                at(m, 0, 0),
                at(m, 0, 1),
                at(m, 0, 2),
                0,
            },
            .{
                at(m, 1, 0),
                at(m, 1, 1),
                at(m, 1, 2),
                0,
            },
            .{
                at(m, 2, 0),
                at(m, 2, 1),
                at(m, 2, 2),
                0,
            },
            .{ 0, 0, 0, 0 },
        },
    };
    var vPos: vector.vec4 = vector.negate(transformVector(r, m.columns[3]));
    vPos[3] = 1;
    r.columns[3] = vPos;
    return r;
}
#

works

#

I think Lengyel didn't even cover the camera matrix

#

this produces the exact same matrix as inverse did since the upper right 3x3 is orthonormal

elder kettle
#

Yeah

#

handy trick

#

orthogonal matrices are convenient for that reason

delicate delta
#

yes, very handy I agree

#

more evidence that just one math book isn't enough, you have to read a bunch of them

#

I guess I should have figured this out on my own though, I know that the inverse of orthonormal matrices is the same as the transpose

#

but I didn't think about how the translation would be affected

elder kettle
#

I just learned that incidentally from group theory I think

ivory verge
#

@delicate delta last night

#

you were in my dreams

#

along with your foundation

#

i dont rember the details, but some maffematical stuff came up and involved vectors or normals of sorts, and then all of a sudden you were there, and all your pictures and clips were parts of a book you browsed through to show/explain to me what normals (or whatever it was exactly i dont rember) were

#

background was dark blue

#

and the pages of the book must have been A3 or so

delicate delta
#

oh no

#

I'm sorry :/

ivory verge
#

šŸ˜„

queen hinge
#

lol

delicate delta
#

hey yeah you should be having Lyzantra lecture you on maths in your dreams, as Lyzantra is way beyond me

queen hinge
#

I am NOT a math person

delicate delta
#

still better than me

queen hinge
#

KEKW I just know how to make the most of the stuff I do know

delicate delta
#

that's great tbh

#

what version of Java do you use btw

queen hinge
#

Typically J17 ā€˜cuz that’s what MC used for a while
Though I flip between J8, J17, and J21

delicate delta
#

I knew you were still using java 8

#

I think like 90% of people writing java are still using 8. I made that up but I think its' true

queen hinge
#

whenever I use J17+, I regret not using J8, and whenever I use J8 I regret not using J17 KEKW
MC is the one place where I don’t have to deal with this conundrum

delicate delta
#

is java 8 peak java

queen hinge
#

Only reason I ever regret not using J8 is because it’s what everyone has KEKW

delicate delta
#

does minecraft ship with its own jre?

#

who still has java

queen hinge
#

Basically; the java website only has J8
So if you want to use a newer version, you have to download a JDK from elsewhere

delicate delta
#

I think intelij also ships with its own jre yeah?

#

oh

queen hinge
queen hinge
delicate delta
#

that page doesn't answer the question

#

so this is a java licensing issue

queen hinge
#

oh really? KEKW

delicate delta
#

looks like because it went GPL?

queen hinge
#

The newer JDKs are faster due to JIT optimizations and easier to write code with due to newer syntax features and methods which exist to reduce boilerplate

delicate delta
#

I am asking the ai

#

idk seems like it's mostly that java 8 is just the version everyone has I guess

#

just as you said

queen hinge
#

According to reddit
Until Jdk9, the developers of java didn’t want people to redistribute the JDK, and this mindset changed with J9

delicate delta
#

this all gives me the impression that java is kind of at a deadend, time to switch to something modern like Mono or Perl 6

queen hinge
#

I mean
Code wise Java’s got more potential now than it ever did before

#

Also got more active development in the JDK than ever before

delicate delta
#

what's a new feature you're excited about in java

queen hinge
#

They’ve been working on redoing native interface is the big thing they’re working on
Project Panama

I have… mixed opinions on it

queen hinge
delicate delta
#

new zig nightly doesn't let me do this any more :(

#

not sure what to name these props now

#

config2 and scene2 wdyt

#

config_prop

#

config_

#

config_123

queen hinge
#

KEKW those are quite the variable names to reserve

delicate delta
#

they're not reserved

#

it's that I can't use them as props because they're imported

#

I can rename either one

queen hinge
#

OH

#

What is this a config for?

#

I’d name it after what it configures, personally

delicate delta
#

oh game config like right now just screen settings

#

well they're both the same thing one is an instance of the other

#

so it's like having a function parameter called x setting an x prop on a struct inside the function

#

hrm

#

no that's allowed

#

src\foundations\app.zig:1:1: error: duplicate struct member name 'scenes'
scenes: *scenes,

#
const scenes = @import("scenes/scenes.zig");
#

I import this at the bottom

delicate delta
#

Chapter 10 of game math is like 120 some pages

#

it's gonna take a while :<

#

it's basically a summary of an entire book on rendering

#

it's a good intro because that's what's next

#

I just have to power through it

delicate delta
#

I've never read so much in my life as I have in the last few months tbh

delicate delta
#

you can tell when I started getting into graphics programming and zig

delicate delta
#

half way through chapter 10, with notes, covered the phong and other basic lighting models

delicate delta
#

I have finished Chapter 10!

#

it is a massive chapter

#

I actually really enjoyed it

#

I learned so much, and because of how old this book is, I got a little bit nostalgia and I felt like I was really learning about how to build a game

#

like I didn't know anything about lighting at all before this chapter, never once read about phong or blinn or doom style volumetric lighting

#

the amount of detail it went into the render pipeline and graphics pipeline, even though it is a bit dated, was really cool and I learend a lot

#

a 150 pages that covered like all of rendering at a very high level and ended with some HSLS examples of how to do bitmapping and skinning and lighting

#

I also really liked that it kind of broke down how games are built, at least how the rendering is built

#

like what is done where and when

#

I am actually done with math books for a while. I am going to read three chapters of Game Engine Architecture and then just plow through my OpenGL book, Computer Graphics Programming in OpenGL with C++
3rd Edition, https://athena.ecs.csus.edu/~gordonvs/textC3E.html

#

because I'm actually like kinda more limited by lack of OpenGL knowledge than anything else before I get into advanced math I can't use because I don't know how to add attachments and whatever

#

I emailed the publisher for the files for that book, I will actually build all of the examples in my engine

elder kettle
#

Nice

#

Time to whip up some gameplay

#

It will require you to expand your GL knowledge pretty quickly

delicate delta
#

nice, that would be fun

#

yeah everything I read from here on out should lead to some cool rendering I hope, out of the kiddie pool now

maiden gazelle
#

Nice progress!

maiden gazelle
maiden gazelle
#

And the viewing transform part of Chapter 10

#

I think the book is solid from an education point of view

maiden gazelle
delicate delta
#

Nice, it’ll take a bit before I get to real time rendering

#

I want to finish all the math books first

#

I am about halfway through most of them now

#

So probably at this rate maybe next year

#

idk

#

I want to read the books I bought they aren’t there to just look pretty

queen hinge
#

I’ve yet to really have a reason to read about those tbh

delicate delta
#

It’s trivial

#

It’s super basic

#

It’s cool how basic it is and how well it works

maiden gazelle
#

You'll be a force of nature next year

#

Though a little overpowered math-wise

#

Me personally

delicate delta
#

Nah

maiden gazelle
#

I tend to forget math topics if I don't apply them frequently

delicate delta
#

Everyone is like that mostly I think

delicate delta
#

Your godot project looked really cool

queen hinge
#

Physical accuracy isn’t really something I desire, I like my stuff being stylized

delicate delta
#

Makes sense

queen hinge
#

In my opinion
Realistic rendering is best for horror games, because it makes it a lot easier to get immersed in it
Beyond that, I don’t generally care much for realism in games, and generally see it being more performance intensive or more file size than it’s worth

delicate delta
#

I like cool lighting, like a cyberpunk scene in which all the neon and digital lights refract and reflect all over and every other thing is itself emissive

queen hinge
delicate delta
#

I just write notes

queen hinge
#

KEKW also I’ve never actually seen cyberpunk

#

Oh shoot
I just discovered something neat about discord mobile

delicate delta
#

The Ascent is a small indie cyberpunk game that has cool lighting

queen hinge
#

So I can just immediately jump to #1248864886772072591 message

#

That’s neat

queen hinge
#

Yea it’s also cool if you design your game around it I guess

delicate delta
#

It is a short game though

#

It is very fun

queen hinge
#

Actually
A neat mechanic I’ve only seen once or twice

#

Having stuff react to light

#

Like
In gameplay
You shine a light on an object and it acts as a trigger
Not just a visual thing

delicate delta
#

That is cool

queen hinge
#

There’s a game with a combat system essentially built around that KEKW

delicate delta
#

Metro games do that

queen hinge
#

I have never heard of metro

delicate delta
#

Some of the creatures hide from light and avoid coming near you

queen hinge
#

One I was thinking of is alan wake

delicate delta
#

Metro (Russian: ŠœŠµŃ‚Ń€Š¾), (Ukrainian: ŠœŠµŃ‚Ń€Š¾) is a post-apocalyptic fiction franchise consisting primarily of novels and video games that began with the 2005 release of Russian writer Dmitry Glukhovsky's novel Metro 2033. It was followed by his sequels Metro 2034 and Metro 2035, as well as by many other books by different authors, including Tullio ...

#

I only played 2035 it was great

queen hinge
delicate delta
#

The one from 2021

queen hinge
ivory verge
#

i dont know the game

queen hinge
#

The Ascent

ivory verge
#

seems to be some sort of transistor clone but without pixelart bs?

#

not transistor, the other game with H

maiden gazelle
#

Hades?

ivory verge
#

yes!

#

i want something like that for my scifi shit too, instead of the dude, have my ship hover in ze hangar while you look at things šŸ™‚

maiden gazelle
#

Sounds sick

#

When

delicate delta
#

The Ascent is real fun

queen hinge
#

Game’s name: Hades
Deccer’s memory: transistor

delicate delta
#

Can play it fully in half a day I think

#

They added content

#

Since I played it

#

It’s like original the Fallout games

#

Very story based and character driven

queen hinge
#

Honestly
I should probably actually do a project where I go through and make a bunch of test scenes for sake of generalizing my engine

ivory verge
#

same studio too iirc

queen hinge
#

Also
I’m trying to do a software raytracer in MC
… need to figure out how to build a BVH for anywhere from 0 to… I think it was 500k triangles entirely on the GPU

#

every single reference I’ve found of BVH construction is on a light theme website, for C++, on a single thread, and does not assume a fixed memory layout like GLSL has
I also cannot preallocate large blocks of data, as that makes switching to the shader take a while (iirc, ~15ms or smth; more than I have leeway for)

#

bleakekw literally writing the number 4 can cripple performance with this due to that

delicate delta
#

I saw your ray tracing recently looks impressive

queen hinge
#

That was hardware raytracing with vulkanite

#

bleakekw that could not have been much more simple to write

#

If I can get this shader to perform well I will probably put it on github as a minimal software rt shader type of thing KEKW

queen hinge
#
#ifdef FALSE
void main()
#endif

{
    int att = 0;
    uint oldBits = DATA;
    float oldFloat = uintBitsToFloat(oldBits);

    do {
        uint newBits = floatBitsToUint(OP(oldFloat, VALUE));
        uint prevBits = atomicCompSwap(minX, oldBits, newBits);
        if (prevBits == oldBits) {
            // Swap was successful
            DATA = newBits;
            break;
        } else {
            // Swap failed due to concurrent modification, try again
            oldBits = prevBits;
            oldFloat = uintBitsToFloat(oldBits);
        }
        att++;
    // 500 for safety reasons
    // should never hit this point, but maybe
    } while (att < 500);
}
```cursed atomics
delicate delta
#

The function returns the original content of mem regardless of the outcome of the comparison.

#

I'm not sure if (prevBits == oldBits) is valid

#

isn't that always true

#

or that means the previous swap, but not this one worked

#

idk

#

this feels terrible

#

If the content of mem is equal to compare, then the content of data is written into mem, otherwise the content of mem is unmodifed. The function returns the original content of mem regardless of the outcome of the comparison.

#

I see

#

prevBits == oldBits means it wrote newBits

#

well

queen hinge
#

basically
I'm trying to make sure it's written to and also wasn't overwritten by another thread

#

now the thing is
I feel that should be checking prevBits == newBits

delicate delta
#

you can't know that

#

at the time of comparison it may get overwritten

#

idk

#

don't you have to get the context each thread

queen hinge
#

well
it sure seems to be working KEKW

delicate delta
#

ok it is an atomic compare

queen hinge
queen hinge
delicate delta
#

oh I am dumb

#
       if (prevBits == oldBits) {
            // Swap was successful
            DATA = newBits;
#

this though

#

this can be wrong without a lock or something?

#

because now you're comparing without atomic

queen hinge
#

yes

#

seems to reliably converge after 2 iterations, so 500 should be more than good as a safety KEKW

delicate delta
#

why 500?

queen hinge
#

arbitrary value

delicate delta
#

ok

#

this is for ray tracing?

#

or a new project

queen hinge
#

computing the bounds of a box that encloses the entire scene

delicate delta
#

why do you have to compute the bounds of your scene? is it generated?

queen hinge
#

well
it's a minecraft world

#

almost nothing is consistent in minecraft

delicate delta
#

you're doing this for light sources from outside the view frustum?

queen hinge
#

I'm doing this because I'm going to get approximately -1000 fps if I don't have a bvh, and I need to know the size of the root node in order to be able to start subdividing the BVH

delicate delta
#

idk what I'm saying tbh

#

can't you just create an arbitrary box and see how it behaves

queen hinge
#

I could
or I could use 16 threads to essentially instantly compute the bounds that perfectly enclose all of the triangles in the scene; no more no less

delicate delta
#

I don't know anything about bvh or ray tracing

queen hinge
queen hinge
delicate delta
#

are you using stb_include

queen hinge
#

whatever iris does

delicate delta
#

have you considered a nested loop from 0 to 10

#

er

#

0 to 15

queen hinge
#

I can see that my code is doing stuff based upon the values
can't tell if it's actually right or not but

#

also why is it flickering sometimes

#

maybe my triangle bin is full?
can't tell

#

ok setting it to 1 thread tells me that either these cursed atomics do not work, or my loop is wrong

delicate delta
#

:P

#

After this current chapter in GAE I'm going to read a chapter about parallelism and concurrency, maybe after I can say things that are helpful, although this is all GLSL and not application side

maiden gazelle
#

That chapter is fire

delicate delta
maiden gazelle
#

That's a fortune in my country

#

I have Game Programming Patterns & Mathmetaic for 3D Game ... in my library as well

delicate delta
#

I did also just order The Modern Vulkan Cookbook also

#

I had some of these books, just sitting around for a couple of years

maiden gazelle
#

Lovely collection, drooling just looking at it šŸ˜…

delicate delta
#

well I have to read them

#

I mean

#

to me it's a bunch of pending work

#

or work in progress

maiden gazelle
#

Is it fun?

delicate delta
#

sometimes

#

I wish osmosis worked

maiden gazelle
#

I was gonna reply with "then all the more reason to do it" to cheer you up, provided you responded with "yes" lol

#

"Sometimes" works as well though

#

It's kind of like a roller coaster

delicate delta
#

it's like exercising, I just do it because it helps me reach my goals

maiden gazelle
#

Motivation does not grow on trees

delicate delta
#

I don't have motivation, I have goals

maiden gazelle
#

Damn

#

I can't achieve the latter without the former

delicate delta
#

motivation is temporary, a routine is daily

maiden gazelle
#

šŸ’Æ % true

#

That's why I'm still not where I wanted to be perhaps

#

But I'm getting there

delicate delta
#

where are you from?

#

if you don't mind me asking, just curious since you brought it up

maiden gazelle
#

Turkey

delicate delta
#

oh cool

#

I want to vist Ankara some day

maiden gazelle
#

I personally don't like Ankara that much tbh, worst drivers on the planet for some unknown reason, and the weather is too dry for my crumbling retina (I have severe eye dryness)

queen hinge
delicate delta
#

time to let go of minecraft?

queen hinge
#

no

delicate delta
#

you need an intervention

queen hinge
#

I'm using a premade mod to implement this into

queen hinge
#

Because I’m sorta trying to challenge myself

maiden gazelle
#

The one going from/to İstanbul is good though, the "speed train"

queen hinge
maiden gazelle
#

My humbler collection

delicate delta
#

The Lengyel book is so great, it's basically all the math

#

that you need

#

it's just not really explained conceptually

#

but you would know when you need it

#

what it is for

#

it's like the ideal math reference I think

#

what's the math for this problem? it will have an answer

queen hinge
#
float ov = x
if ov < v break
float nv = min(ov, v)

pv = atomicCompSwap(x, ov, nv)
if x<=nv break```
I think this is probably what I want
maiden gazelle
#

Funny story: that Lengyel math book is printed reverse. It is perfectly usable, provided you flip it 180 degrees on your x axis (direction to your right).
I asked Amazon to take this back and send me a new copy, they countered with "keep the book & we'll refund your money". So it is free šŸ˜…

delicate delta
#

your real time rendering is digital?

maiden gazelle
maiden gazelle
delicate delta
#

I don't like digital books

maiden gazelle
delicate delta
#

but I have to with gamemath

maiden gazelle
#

As in I don't have it yet

delicate delta
#

oh I see

queen hinge
delicate delta
#

only good about digital is you can search them

maiden gazelle
delicate delta
#

true

maiden gazelle
#

For example I'm reading a digital copy of GAE on the tablet

delicate delta
#

also lighter to carry around

maiden gazelle
#

even though I have a physical copy

delicate delta
#

I just don't like reading on a screen

queen hinge
#

decided to abandon the cursed atomics and just do two shaders KEKW
Not 100% convinced it’s working though, turning down the invocation count causes it to break

delicate delta
#

what is it

queen hinge
#

These colors represent the bounds I need for my BVH’s root node
… not sure if they’re actually correct, gonna have to validate that tomorrow

fleet dew
fleet dew
#

also from turkey šŸ˜…

maiden gazelle
#

Hey šŸ‘‹

#

As bayrakları

ivory verge
#

@delicate delta andrew left discord and the zig server behind? do you know why?

delicate delta
#

he's still active until end of september

#

I also dislike the quests

#

but like

#

I'm not going to start using IRC

#

I haven't used IRC in like 10 years

#

all the clients are unmaintained and it is not great for sharing media and such

#

idk I don't really talk to him much anyway

#

I don't go into the dev channels, they are serious in there

#

like you say the wrong thing while they're trying to get work done it's a ban

ivory verge
#

its quite funny

#

i am thinking of leaving discord too

#

and find a new place where you just hang with your friends

#

no kids homework solving bs like we have in #opengl or #questions all day

#

just bikeshedding your frog's projects

elder kettle
#

We need the elite gp inner circle private element chat or something

#

where it's mostly just project threads

#

general discussion can still take place here

ivory verge
#

yeah

#

but basically a new server

#

where those peasant channels dont exist which keep teasing you to take a look

elder kettle
#

yeah I imagined matrix/element or something

#

away from AI training bs too

ivory verge
#

yep something selfhosted perhapsly

elder kettle
#

I just wish there were some better solution for user uploaded data

ivory verge
#

yea

elder kettle
#

There needs to be an "upload manager" system like old forums used to have, where when you upload files it goes into a little personal cloud storage drive with a fixed size

#

Then it's up to the user to manage their data

#

If they are running out of space they can delete old files or reduce the resolution of old images

#

then it puts the data management in the hands of each user and makes the storage scaling on the server vastly more predictable

#

Also gives an easy way to look back at your pictures so I don't have to search from:the_Demongod has:file every damn time

#

and click through their slow pages

ivory verge
#

a background job could replace all the images by low quality ones for posts which are older than 90d or so

#

and if you click on it to enlarge and the user still has it in their store you get the original pic or something

#

small thumbnails could be stored globally somewhere, so that you dont lose pics from old messages

elder kettle
#

Yeah

delicate delta
#

revolt

#

oh you mentioned matrix

fleet dew
#

like, discord search for example, I use it extensively to figure lots of random stuff. and sometimes I stumbled upon zig std channels, read some random interesting stuff

delicate delta
#

yeah I learn a lot from being on the servers

delicate delta
#

have been sitting on the zig irc channel on libre via the web client, it's super dead

ivory verge
#

yeah kids these days dont want irc anymore, i dont blame them

delicate delta
#

idk if andrew can really stay off of discord

queen hinge
#

KEKW I have never used an IRC client

delicate delta
#

ohh

#

he did leave discord today

#

he didn't wait a month

#

and he's not on irc he's on zulip

ivory verge
#

yeah

#

that platform which uses "leadership" in every other word on their website šŸ˜„

delicate delta
#

ok I'll try zulip I guess

#

oh just work channels

#

doesn't seem like a community chat

ivory verge
#

it is more thread centered

#

something what demon and i would want probably

delicate delta
#

oh is very thread based

#

I like it

fleet dew
#

I know rust compiler and stuff related uses it successfully

#

wish it was possible to move existing zig discord conversations to that without hassle, that would be awesome

delicate delta
#

Having lurked on Zulip for a day, I think it’s pretty great actually

ivory verge
#

i sink i have to ackchually check this out too

delicate delta
#

it's not a very pretty UI

#

but I like it how it works

ivory verge
#

yeah

delicate delta
#

GAE's third chapter has the best explainer for alignment I've ever read

#

it's super, it's like two pages and just fully explains it in clear and simple terms whereas everything else seems to have struggled

ivory verge
#

i find GEA quite bad in general

#

its how one would write engines 15 or 20 years ago

#

not sure why so many praise that book so much

delicate delta
#

can't speak to that but the parts I've read so far have been very good, I'm still in the first section of the book

ivory verge
#

perhaps im biased somehow

#

because its heavily OGRE influenced, and ogre was shit back then

delicate delta
#

honestly it kind of comes across as a how to pass a technical interview at a game studio more kinda book

ivory verge
#

yeah

#

you wouldnt waste your time reading it

#

it helps to understand concepts in general and thats more important than knowing what assembly you have to use to implement SSAO for a specific gaming platform or soemthing like that

maiden gazelle
#

I treat GAE as a general-knowledge kind of book

delicate delta
#

I think maybe the more recent edition might have reduced ogre, I see some of it

maiden gazelle
#

Showing the big picture that is a game engine

#

Lots of better books on specific topics of course but as a general surface-level book I think GAE is not bad

delicate delta
#

I think it's more like a great intro for junior engineers at game studios or something more than a how to build your own

maiden gazelle
#

Yeah

delicate delta
#

or as I said for how to prepare for an interview

ivory verge
#

yeah

#

its GEA my frogs šŸ˜›

delicate delta
#

right GEA :P

ivory verge
#

everyone on the server keeps saying GAE šŸ˜›

delicate delta
#

idk why I did that

#

it's GEA

maiden gazelle
#

I'm only saying it because Bjorn said it first

ivory verge
#

: >

#

vb also says GEA hehe

delicate delta
#

lies

#

but actually truth

wise imp
#

why do you think gea can be bad?

#

its only a high level overview but its a pretty decent book to get started with

#

i dont remember any sort of ogre influence on it šŸ¤”

#

OGRE was truly awful even at its time

#

and i think first edition of GEA is older than ogre

delicate delta
#

I think maybe older versions of the book had more about OGRE

#

it has appeared a little bit so far, but I'm only chapter 3

maiden gazelle
#

It appears every now and then

#

I’m on chapter 5 I think

delicate delta
#

that's the math chapter yeah

maiden gazelle
#

Ok then I’m on chapter 4 šŸ˜…

#

Resources and whatnot

delicate delta
#

that's the parallelism chapter in my issue

maiden gazelle
#

Hmmm maybe I skipped math

#

And on chapter 6

#

Let me check

delicate delta
#

we have different editions

#

it goes overview of game engines, dev tools, how to write c++, parallelism, game math