#Foundations - Learning Graphics Programming with the Zig Programming language

1 messages · Page 6 of 1

elder kettle
#

are the underlying framebuffers the same as here though

#

or is there some way you can change the attachments cheaply

#

I thought changing FB configuration stuff was expensive

late jackal
#

yeah afaik you might as well make a new framebuffer and configure that

elder kettle
#

Ok so you sort of cache all the configurations or something?

late jackal
#

in fwog I have a framebuffer cache but I never measured its effectiveness

elder kettle
#

alright

late jackal
#

I would wager that the operation that is actually expensive is changing the render target state

#

so configuring or reconfiguring a framebuffer is cheap, but the first time you draw with it since it's been bound is probably not

#

I'm allowed to ponder about perf like this because it's gl

queen hinge
#

I’m pretty sure it’s actually just binding framebuffers in general that’s slow

#

Regardless of if it’s the first time it’s been bound or not

delicate delta
#

the shadowmaps are flipped, but it doesn't matter during sampling, these look correct for the back light perspective and front light perspective

#

I have two issues to work through still which is the textures aren't being read correctly for bindless I get warnings that don't correspond to with what I see in Nsight, and the fragment shader code is not applying the shadows

#

I work through those two remaining issues and I should have multilight shadows

#

I can actually work back from what is working with my dolphin, which works, to figure both of those issues out

#

oh there we go

#

just had the rotation wrong

delicate delta
#

I don't know what I would do without renderdoc

#

I guess generate textures from shadowmaps manually

#

oh I should maybe do that anyway

#

see the shadowmaps in real time

late jackal
#

You can draw textures in imgui with Imgui::Image

#

You can make a walmart RenderDoc with it

delicate delta
#

nice

zinc trail
#

Belive it or not there is an alternative to it. It's not as easy as overriding a method though. You have to mess about with phantom references n stuff but it's still possible

ivory verge
#

and wiz a little swizzle magic you can make the reddish looking depfthsphf map, look as white as in renderdoc, and a bit of TextureView shmooh

late jackal
#

Yeah, alpha is a bit of a pain with the default backend

#

Maybe you could modify the backend to support extra stuff in imgui's image handle

#

Sorry, getting ahead of myself hehe

zinc trail
#

Oh yeah if your drawing your fbo attachments in ingui you have to flip the uvs

#

Also on the topic ealier too. If you depend on destructor order. Then you probably shouldn't store the object as a global

late jackal
#

Bjorn is using zig so I don't think it's a problem

zinc trail
#

That's one of the few cases where I'm fine with a singleton

zinc trail
late jackal
#

It seems comfy

zinc trail
late jackal
#

I used zig once and unfortunately I needed to do a bunch of vector math, so the lack of operator overloading didn't feel nice

#

Everything else seemed cool

zinc trail
#

aww no operator overloading would probably make me feel like im back in the java days x.x

ivory verge
late jackal
#

I think zig has some built-in vector and matrix types now so if that's some consolation

zinc trail
#

yeah theres params in the call that have the uvs, by flip i meant those two params

late jackal
#

But that's not as good as just letting you overload the dang operators

wise imp
#

that stuff is for simd

queen hinge
#

and like it's probably not worth the effort

zinc trail
delicate delta
#

I never used operator overloading in the past so I don't have a problem with writing more characters of code to do that
zig is overall more verbose than C or C++
I definitely like zig, but I am fine with relying on a very limited set of C dependencies and updating the compiler every day and dealing with any backwards breaking changes and the overall verbosity of having to explicitly cast and various C++ sugar that lets you avoid writing code explicitly

#

I am also fine with not having very good editor tooling etc

#

so if you are ok with not being able to depend on libraries, frequently chance of backwards breaking changes, poor editor tooling/tiny niche ecosystem, no C++ features then you may also like zig

late jackal
#

most of those issues are shared by all new languages

delicate delta
#

yes

#

it's similar to using rust nightly back before 1.0

queen hinge
#

I sorta rely on keyword patterns to know what’s doing what
Using operator overloads sorta, breaks the keyword patterns I’m used to
And assignment overloads just drive me mad
If I’m gonna use =, I want it to behave exactly how = would
I don’t want to have clamping logic in my = operator or something, and I don’t expect it to write stuff to the disk

#

vector/matrix/tensor math are like the only things I like operator overloads for

delicate delta
#

I prefer imperative readable code, without hidden control flow

#

operator overloading is hidden control flow

#

it's why it's not supported in zig

#

it's one of the main goals of zig, so it will never be supported

wild ember
#

I find Vector and Matrix math very hard to read without operator overloading

elder kettle
#

Yes it's terrible without

wild ember
#

We have a very old codebase at work that started in C, but then they added C++ on top of it, so some files have really messy C matrix math and some files are super nice C++ with operator overloading

#

you just roll the dice

delicate delta
#

I just concatenate my matrices one at a time each line, it doesn't really make a difference after it's compiled

#

I don't think it's hard to read at all

#

I could create a function that is concatenate and takes a slice of matrices

#

I don't really feel the need to

#

actually think that would compile worse

late jackal
#

I think banning operator overloading was not a good choice but I understand the rationale

#

Any feature can be abused

wild ember
#

theres no more guarantee that the function add() does what you think it does than the operator + does

delicate delta
#

idk, I don't have any problems multiplying matrices in GLSL with the math operators and the zig way doesn't bother me either, I did like how the stroustrup book overloaded the << or whatever operator for the book's calculator problem that you built as you worked through the book

#

I can see why it's useful, but I have had zero foot gun. moments with zig in a year now

#

it's the same with go, it's a very simple imperative language that doesn't offer enough for you to ever get lost with the question "how do I do this in this language??" for hours

#

which is the opposite experience I had with Scala for example

delicate delta
#

have to flip the thought around there to understand the hidden control flow, of course functions can have side effects

#

operators can't

#

I don’t think zig is aiming for being a replacement for C++ anyway

#

More of C replacement

#

Which also doesn’t have operator overloading

#

I can’t speak for the core devs though or know their intentions and I don’t want to misrepresent them

#

idk use the language that works for you. gpAkkoShrug

#

I sometimes think about how nice it would be to just write C++ with the huge ecosystem, tooling and editor support

#

If this wasn’t a hobby I would use C++

#

There’s zero career value for me doing any of this lol

delicate delta
#

I should just use a UBO for all this shadow data

#

Light and shadow data

late jackal
#

I use ssbos (basically ubos but infinite size and allow writing) for almost everything

delicate delta
#

I made that argument and people argued against it saying ssbos are slower

#

My little buffer abstraction makes using ubo or ssbo trivial

late jackal
#

ubos go through special memory on nvidia but it's really not that big of a deal

#

and on amd they are identical to ssbos

zinc trail
#

if your operator = does something you dont expect from an assignment, then you wrote bad code

delicate delta
#

maybe it's not your operator

#

maybe it's the person on the other team

#

maybe it's from a library

#

junior developers are a thing

zinc trail
#

i mean yeah, in most cases you shouldnt need to write your own assignment anyhow

delicate delta
#

and yes, bad code is also a thing

#

I write bad code

#

do you not write bad code?

zinc trail
#

i mean we all write bad code, anyone who claims their code is perfect are wrong

delicate delta
#

right exactly, and that's kind of explains zig's philosophy

#

no footguns

zinc trail
#

as far as i see it the only reason to have custom assignment in c++ is if you have custom move or copy

late jackal
#

I only write good code

delicate delta
#

afaik zig doesn't have a move, it's always a copy to do assignment

late jackal
delicate delta
#

idk what move means I guess

zinc trail
#

in some circumstances it allows you to avoid copying which is good

delicate delta
#

as I understand it any time I do var foo = bar; whatever is in bar was just copied to foo and changing foo will never change bar

#

if those are storing pointers then you can change what both are pointing to by writing to their fields

zinc trail
#

if you have this in cpp then its usually a copy

auto bar;
auto foo = bar;
delicate delta
#

but the values actually stored by foo and bar are different

zinc trail
#

assuming you dont do weird reference shenanigans

delicate delta
#

what is an example of a move I guess? I don't understand

zinc trail
#
std::string a = "string";
std::string b = a;
#

so lets say we have these strings

#

so as expected atm, a gets copied into b

#

so lets say you know for a fact that a doesnt get used after you copy it to b, this is a situation where you can do a move instead and avoid the copy

delicate delta
#

so a is now not usable?

zinc trail
#

in the example its perfectly usable

#
std::string a = "string";
std::string b = std::move(a);
late jackal
#

moving semantically "steals" the data from an object. in this case it means a now holds an empty string and b now contains the pointer to chars that a previously had

zinc trail
#

here we can tell b to move a instead of copying

delicate delta
#

why is this useful

zinc trail
#

optimization

delicate delta
#

why not just use a

zinc trail
#

moves are fast, copies are slow

late jackal
#

moving lets you express certain semantics that don't exist with only copies

#

some objects are movable but not copyable, for example, because copying them wouldn't make sense

zinc trail
#

or in the case of many opengl abstractions, where copying the object a lot of the time doesnt make sense

delicate delta
#

how is this different from just using pointers though

late jackal
#

std::unique_ptr enforces single ownership of the pointer it holds by banning copying

#

so it will only be automatically destroyed in one place

delicate delta
#

you could do b = a; a = undefined; now b has it

#

and a goes out of scope or whatever, I don't know, set it to something that doesn't cause UB

#

I kind of get it, sorry

#

this is like ownership semantics

late jackal
#

yes, exactly

delicate delta
#

rust features ported to C++

late jackal
#

zig doesn't have destructors so it doesn't make as much sense

delicate delta
#

std::cow when

zinc trail
#

that and it lets you keep your value types working as youd expect without heap allocating everything

late jackal
#

it used to be legal to implement std::string with 🐮 semantics

zinc trail
#

like if every object you have behaves like a shared_ptr then yeah moves are almost pointless, ahem... java

elder kettle
#

Move semantics let you describe things that have a unique and uncopyable identity

#

It's usually not necessary to implement yourself but it's very useful when it is

zinc trail
#

falls into that category of if you implement a destructor you should implement the copies and moves too

late jackal
#

rule of 0 or 5

zinc trail
#

yeah i see way too much newbie code define destuctors that do nothing and just casually makes their code that much slower

late jackal
#

imo a much worse problem is ignoring the rule of 5

zinc trail
late jackal
#

noobs make opengl abstractions with completely broken copy and move semantics

delicate delta
#

I kind of never transfer ownership of anything unless I'm doing a job on a thread

zinc trail
delicate delta
#

at least I haven't needed to

#

actually I do some initialization in the beginning of my app and then pass that into another thing and that thing becomes the owner, and some zig std library will allocate memory you then have to free, but you pass in the allocator for that thing so if you use an arena it's all handled

#

and if you don't, you just know to handle it, the general purpose allocator in dev detects leaks, UB is totally possible though if you get it wrong

zinc trail
#

I recently went though a code base where the abstractions were so bad.

Some things were default init in the class, some of it happened on the constuctor, some of it happening inside of it, and there was like a cube class which pushed into a vector of a buffer class with broken semantics and was raising exceptions from the driver, its great

elder kettle
#

Imagine using abstractions

zinc trail
#

the thing that was blowing my mind is that he had some classes that deleted copies, so they knew they could tell it to not allow copies

#

but deleted copies on a class that was never in a situation where it would ever be copied to begin with

zinc trail
#

manually connect the wires many billions of times every second

elder kettle
#

Don't give me that slippery slope bs you know what I mean

zinc trail
#

im just saying it starts with saying you dont need abstractions, meanwhile ur working on top of so many abstractions

#

i can think of at least 20 abstractions almost every one of you are building your software on

delicate delta
#

everytime I want to do something with my engine any stupid abstraction I wrote before I have to undo

#

I'm going back to copying and pasting code

zinc trail
#

i usually end up trying stuff and if i hate it i just git stash it lmao

delicate delta
#

I was like ok I have lighting now let me abstract it so every scene can have lighting without me having to do all this all over

#

and then oh, I want to have multiple lights and I want those to cast shadows

#

and then it's like jfc what I have done

#

this is why I am going to make a game with static geometry and small levels

zinc trail
#

yeah its hard to make good abstractions when your needs change a lot

delicate delta
#

every level will just be artisinal shaders and one use everything just for that level

#

I will do absolutely as little as possible to reuse code across levels

#

because it just becomes a fucking straight jacket

zinc trail
#

a lot of my higher level abstractions are tied into the ecs system so its super easy to iterate on it

delicate delta
#

ecs is cool, but I'm not going to use one

zinc trail
#

my light struct for example just has a type, a color and attenuation factors

delicate delta
#

yeah I have a light and material struct

#

that's a data type

#

that's not an abstraction imo

#

idk

zinc trail
#

thats fair tbh

#

i just mention it cause a lot of time abstracting tends to lead to having these massive classes and all

elder kettle
#

ECS is cool and you should use it

delicate delta
#

would you write Doom 1 with an ECS

zinc trail
#

sometimes an ecs is overkill, but if youre making something complex enough its absolutely worth using

delicate delta
#

because that's the kind of game I'm basically going to make

#

small puzzle escape room levels

zinc trail
#

if you know what an ecs is, then usually if you're good enough you'll know when its time to use one

delicate delta
#

I used one with my voxel game

#

it was great

elder kettle
zinc trail
#

i havnt brought ecs into my voxel stuff yet, but i do plan to bring it in eventually

delicate delta
#

that's fair, I could see using an ECS too

#

but the main reason that I don't use an ECS is just there's no easy way to port any of the C / C++ ones to zig because they do so much meta programming

zinc trail
#

i technically already have the ecs library in the codebase, i just dont use the ecs features of it

elder kettle
delicate delta
#

but that's kind of overkill for a small game

queen hinge
#

And I’m a java person KEKW

delicate delta
#

I can just not use an ECS and be fine

zinc trail
delicate delta
#

yeah

#

or complex C macros that flecs uses

zinc trail
#

entt specifically is pretty heavy on templates, im not sure if any ports of that exist

delicate delta
#

there is a zig port of entt

#

I don't use zig dependencies

elder kettle
#

ECS can be overkill but that doesn't mean it's bad

delicate delta
#

I said ECS was cool though, I never said it was bad :P

zinc trail
#

nobody here was calling it bad tho?

elder kettle
#

Well you said you wouldn't use it for something like doom 1

queen hinge
#

What is ECS

delicate delta
#

entity component system

queen hinge
#

oh like what unity has?

delicate delta
#

yeah probably

elder kettle
#

No

#

Unity has a shit version

queen hinge
zinc trail
#

conceptually yes

#

unity does do some weird crap with it tho

delicate delta
#

high level you have entities and they have components and you query components in systems that have side effects/behavior

elder kettle
#

ECS is just splitting your game into pure state and pure logic and creating game objects by composing types of state

delicate delta
#

implementation detail is it's a bunch of arrays of arrays

elder kettle
#

ECS is great for any problem where objects are combinations of smaller things rather than fitting into completely separate categories

queen hinge
elder kettle
#

No the performance is amazing

delicate delta
#

ECS are fast af

zinc trail
#

thinmatrix has a decent older video about the general idea of it, gives a decent enough visuals

delicate delta
#

small amounts of collocated data queried sequentially goes brr

elder kettle
#

Yea

zinc trail
#

while not really talks about ecs, it goes over why giant class heiarchies are just next to impossible to manage over an ecs

queen hinge
#

I’m the sorta person who will get annoyed about something taking nanoseconds too long KEKW

zinc trail
#

implement an ecs correctly, they will easily outperform, dare i say nearly all other methods (of grouping entities and behaviors)

elder kettle
#

ECS is basically cache optimized by default

#

To make it maximally optimized it takes more work but the naive implementation is like 90% of the way there and faster than most anything else you'd come up with using other architecture paradigms

queen hinge
zinc trail
#

yeah in that video his example was like 7 subclasses deep

#

and i assume it was based on his real code at the time

queen hinge
#

bleaker_kekw my class hierarchies usually only go like 2-3 deep

zinc trail
#

i mean it was a java codebase and when its so easy to make a subclass, i cant exactly blame him for using it

queen hinge
#

I mean my stuff is also java, so I have the same conveniences as him for that

zinc trail
#

tbh the only part of java i miss is easily embedding assets

#

oh and their standard library

queen hinge
#

The standard library is something I wish I could ditch most of the time KEKW

elder kettle
#

I don't use classes at all

zinc trail
#

yeah but compare it to c++'s standard library annddd yeah

elder kettle
#

Or almost at all

zinc trail
#

^ c functional purist?

elder kettle
#

No I use C++

#

I just don't use classes

#

Yeah mostly procedural code

zinc trail
#

i hope you actually mean classes and not just the class keyword lmao

elder kettle
#

Yes I don't use member functions

queen hinge
zinc trail
#

i suppose, i was always able to just throw the files into the classpath and java just sorta knew about them

#

and majority of the time it will happily load those with inputstreams

queen hinge
#

Java’s dependency management environment and ecosystem is pretty nice
Need something? Someone’s made a library for it
One of the highest compression ratio png encoders I’ve seen is a java library

zinc trail
#

i never got crazy involved in the tooling but what i have used is very nice admittedly

queen hinge
#

If not actually the highest compression ratio png encoder I’ve seen

queen hinge
zinc trail
#

the only "proper" tooling ive used for java is gradle (which i hated) and maven

#

meanwhile theres no c++ tooling out there that i enjoy or know of

queen hinge
zinc trail
#

i still maintain some java stuff and it uses maven and i dont have much to complain about there

queen hinge
#

I… don’t like how maven is xml based
I also don’t know if it supports actually scripting your builds

zinc trail
#

eh i could care less if its xml or yaml

#

just please we gotta get away from using json for everything

queen hinge
#

KEKW but json is nice… so long as you don’t need to look at a large file

#

And yea yaml is a solid choice for human facing data formats

zinc trail
#

json is NOT NICE, who told you that, have you everrrr tried working with it

#

oh toml is aight too

queen hinge
zinc trail
#

and you enjoyed it?

#

you're insane i tell you

delicate delta
#

I am getting so good at renderdoc

queen hinge
#

oh no I didn’t say I enjoyed it, but json is not meant to be hand written truthfully

delicate delta
#

it's like boom snap, got my data, confirmed it, move on

#

like I get a capture and see the output in like 2 seconds

#

no more of this clicking around

zinc trail
#

love seeing people learning renderdoc, its like ur moving on from grade 1

queen hinge
#

json is meant to be used by the computer
… or at least that’s how I feel about it
I mean json doesn’t even support comments

zinc trail
queen hinge
#

gson is also a very convenient thing to use

zinc trail
#

oh that brings me back, i remember using that, but after writting yaml, im never choosing json for my own projects

queen hinge
#

Oh wait

zinc trail
#

anyhow ima clock out of this chat since this is convo is taking away from bjorn's stuff here

queen hinge
#

I’m the sorta person to casually reverse engineer a system to go implement something more akin to an older version of the system into the newer one for performance reasons KEKW

delicate delta
#

ok I have found the most optimal positioning of my lights and objects to test my shadow maps in all 360 degrees

#

that gets me all four sides and up and down

queen hinge
delicate delta
#

I got ubos, I got a good 360 I can fix all the shadows, get shadows working with texture binding and then figure out my bindless problems

#

this is a plan

#

I am making progress

#

someday this will work

#

just my up and down are fucked

#

bam

#

fixed

queen hinge
#

So there’s this optimization you can do
Where you only update shadow maps every N frames
Might also be able to do some reprojection for slow moving light sources

elder kettle
#

I wouldn't bother with such things until your game is bottlenecking

delicate delta
#

guys

#

I think I should go pro

delicate delta
#

I really think so

queen hinge
#

though I know for a fact that my game will bottleneck on lights KEKW

delicate delta
#

ok

#

now to get shadows working with non-bindless, then I can fix bindless

queen hinge
delicate delta
#

then, if that is possible, smooth shadows and I'm done with this scene

#

hrm I just do it every frame right now, I'm not worried about performance at all with these learning scenes

#

just getting it working

#

I bind 12 framebuffers every frame kekw

#

but I should totally go pro I got what it takes, obviously

#

back to it

queen hinge
delicate delta
delicate delta
late jackal
#

you should add a floor to make shadowing issues more apparent

#

btw shadow mapping is a constant battle between too little bias (causing shadow acne) and too much bias (causing disconnected shadows/peter panning)

#

the worst case is when the incoming light is almost perpendicular to the surface normal, as you observed. you need an infinite amount of receiver bias to deal with it

delicate delta
#

yes, I searched this server for glPoygonOffset and found where you had discussed it previously

#

#graphics-techniques message

#

I found that diagram really helpful, thank you

#

although in that case they were using PCF and I am not right now

#

searching this server for stuff is more helpful than asking google or ai btw

delicate delta
late jackal
#

one technique to alleviate acne is to simply offset the depth of the receiver (the surface being shaded) in the fragment shader

delicate delta
#

oh yes I tried that

#

it did nothing

#

I don't know what values to use for these things

#

I don't understand the math. I read and I don't really understand it either

#

maybe because it's late

late jackal
#

glPolygonOffset is different from a receiver bias btw

delicate delta
#

I saw a really nice visualization deccer shared using glPolygonOffset

late jackal
#

but the receiver bias might not have worked for you if you didn't have a factor based on the dot product of the normal and the light

delicate delta
#

oh I see

late jackal
#

at grazing angles the receiver bias approaches infinity

delicate delta
#

I see

late jackal
delicate delta
#

my math books go into shadows

#

I haven't gotten to those chapters yet

#

so if you do a dot product you are getting the projection of the light onto the surface normal

late jackal
#

well we're just using it to get the cosine of the angle

delicate delta
#

right because they're both normalized vectors

#

oh I can drag the control point in that visualization

late jackal
#

nice progress, you're learning really quickly

delicate delta
#

thank you

#

this is probably the hardest thing I've done so far

zinc trail
#

What exactly is glpolygonoffset for? Or some use cases of it?

#

Oh nvm. I found a discussion here. Ignore me

delicate delta
#

I may be wrong but it offsets the depth buffer value to be closer to the camera so that on sampling there’s less chance of a precision error where we sample behind the surface and erroneously draw a shadow

delicate delta
#

I think maybe my high 4K resolution is part of the problem

zinc trail
#

I'm not using it. Never seen it covered. But as far as ive been reading it's main use cases are shadows and decals

#

And the function itself can offset polygons based on their normals if I read it right

delicate delta
#

I literally cannot have decent shadows of any kind without it so no idea how you aren’t using it

zinc trail
#

I've just manually calculated biases based on normals

#

But on the recieving end. So same sorta effect but slower id imagine

delicate delta
#

I think that’s a different issue

zinc trail
#

Wouldn't the bias issues be improved by offsetting the polygons in the shadow pass?

delicate delta
#

I sample inside the mesh, it is similar to z fighting

#

It’s a precision issue

zinc trail
#

Oh I havnt really had precision issues

#

Not yet at least

delicate delta
#

I have the normals angle problem too though

#

Is your code open source?

zinc trail
#

Only certain parts of it. The shadow stuff isn't public rn

delicate delta
#

You’re using textProject with a bias based on cosTheta?

zinc trail
#

No idea what textProject is

delicate delta
#

How are you sampling?

zinc trail
#

But the bias is based on the dot product from the light direction so more or less cosine

delicate delta
#

You are you doing perspective division in your shader code?

#

Oh your shadows are orthographic

zinc trail
#

I'm rendering stuff to the shadowmap as is. No offsets. And when it comes time to shade objects I transform the fragment into light space. Sample the shadowmap and bias the depth based on the dot project of thr normal and light direction

#

And if it's in shadow. I don't do thr lighting calculation.

#

This skips over the technical detail of cascades and pcf filters etc

delicate delta
#

Oh you bias the output of the result of sampling bias cosTheta as in sampleResult * cosTheta? + ?

#

the dot product of light dir and surface normal is cosTheta

#

It’s used by your light code too I imagine

zinc trail
#

The bias is basically that yes and it just gets applied to the current depth

delicate delta
#

That doesn’t do anything for me I tried that

zinc trail
#

The lights don't use it at all. It's only used by objects recieving shadows

delicate delta
#

What lightmodel do you use?

zinc trail
#

A modified Blind phong

delicate delta
#

blinn phong and phong use cosTheta

zinc trail
#

I'm not sure if it exactly has a name but it's based on that

delicate delta
#

Are you doing a dot product in your light code

zinc trail
#

Yeah :p

#

It uses a wider range of the product though instead of only the 0 to 1 range

delicate delta
#

Does it happen to be dot product of the light direction and the surface normal

#

All my vectors are unit vectors

zinc trail
#

I mean that gets calculated but that's not what's used in thr final calculation

#

Dot product. Remap the range then clamp

delicate delta
#

Are you using an ortho projection to generate your shadowmaps?

zinc trail
#

Ambient light is handled a bit differently then blind phone too but it isn't significant

#

It'd a directional light so yes ortho

delicate delta
#

Ambient light doesn’t consider light or view direction

zinc trail
#

But its part of the light model

#

I'm not seeing how this is relevant to the shadowmap stuff

delicate delta
#

It results it in perspective foreshortening

#

That makes a huge difference?

zinc trail
#

Yeah in ortho that isn't a big issue

#

Not an issue at all afaik

#

The challenge with getting ortho looking nice is biases and very carefully calculating shadow boxes

delicate delta
#

In perspective projection further away objects are smaller and have fewer fp precision

#

This is a problem with any perspective projection

zinc trail
#

Yeah in ortho you still perspective divide but it doesn't cause foreshortning

delicate delta
#

The range of precision in far plane is bad unless an inverse z matrix is used

zinc trail
#

With point shadows I could see that being a problem

delicate delta
#

Which requires a flipped depth buffer

#

This all makes sense now

#

I use perspective with my directional light

#

Because that’s what the book did

zinc trail
#

That's weird

delicate delta
#

It’s hard

zinc trail
#

Cause directional lights are considered parallel so a frustum doesn't exactly make sense for it

#

But apparently you can make it work

delicate delta
#

Your ortho near plane is how far from your ground?

zinc trail
#

It moves with your camera frustum so it isn't based on where the ground is at all

delicate delta
#

But where is the near plane? Just the top plane of your view frustum?

zinc trail
#

Basically it calculates a box to fit the frustum. We do some extra calculations to fit it in a certain way and we move the z near plane back some distance to make sure shadows are captures from stuff behind the camera

#

But if you think about the scene from the pov of the light. You're visualizing a near and far plane.

#

#1286757925863424063 message

#

I have this lil gif I make that actually previews the shadowbox

delicate delta
#

Cool thanks for explaining all that forgelove

zinc trail
#

The problems I'm currently having is bias issues and some temporal stability issues

#

And pcf issues but i could care less about that rn

delicate delta
#

I an going to duck these issues with small levels with static geometry lol

zinc trail
#

But to make shadows look better for the sun. You basically divide the frustum up into sections and fit multiple shadowmaps into it

#

And you do cascades with it. Which makes a huge improvement for thr same resolution shadowmap

delicate delta
#

Yes makes sense

zinc trail
#

If you're light source are static you can get around almost all temporal stability issues

delicate delta
#

Do you use multiple passes and multiple framebuffers?

zinc trail
#

It's one fbo. 4 passes

#

Basically one depth buffer is split into 4 sections. And using glviewport I draw into the 4 sections

delicate delta
#

With multiple attachments on the fbo or you change the attachment each pass?

#

Oh

zinc trail
#

Yeah just clever use of the depth buffer

#

This method was targeting older hardware so there's probably a better way to do it

delicate delta
#

I need to read the spec on how to use multiple attachments

zinc trail
#

But it means the only state that changes between shadow passes is the viewport

zinc trail
delicate delta
#

You’re working with others on your project?

delicate delta
zinc trail
#

I am but I'm the main one working on code

#

I have someone who helps with Linux compatability improvements in code sometimes but besides that the code base is my thing

queen hinge
#

Have not heard of it being used in shadow maps but yeah it offsets the poly in the depth buffer

queen hinge
wild ember
#

This function is also commonly used in modeling applications, let's say you wanted to draw an overlay of edges on top of a solid model

delicate delta
#

I'm totally unsatisfied with my understanding of glPolygonOffset and light incident bias so instead of rushing this scene to be done I am going to create a scene just to visualize glPolygonOffset and also add some visualizations to my shadows scene to understand the light direction angles on surfaces

#

I am unsatisfied with pasting some code that fixes problems in a magical way I don't understand, when I can just spend a little bit of time to understand them and learn how they change rendering

#

reading the spec for glPolygonOffset is just incomprehensible babble because I guess I'm too ignorant

#

I am confident that the subsequent shadow and lighting related chapters in my math books I haven't yet read cover this

#

but glPolygonOffset and textProj are like openglisms

wild ember
delicate delta
#

that makes sense

#

there's so much I had to learn for this chapter, first time using fbos, first time using more than one rendering pass, first time using depth sampling, first time using attachments

wild ember
#

This is the same concept so you may get more insight here

delicate delta
#

If an application renders a wall first and then a shadow
this is a curious statement though, because the wall's fragments would change the color in the way I'm doing it, I'm not separately rendering shadows

wild ember
#

Yeah don't worry about that, depth bias can be used in multiple ways

#

Decals for example

delicate delta
#

DepthBias and SlopeScaledDepthBias are such nicer names than gl's "factor" and "units"

wild ember
#

Basically yeah, same thing

delicate delta
#

I could call anything factor or unit, it's like calling things type and item

wild ember
#

This is quite an old feature of GL, im not surprised it has jank naming

delicate delta
#

appreciate the link and context, thank you

#

I'm just coping

wild ember
delicate delta
#

yes

#

reading the spec actually makes more sense now too

#

I'm going to make a scene to visualize what it does

queen hinge
#

opengl is a library built on deprecation

delicate delta
#

we should all be going 4723h54m37s's route and just write assembly renderers

queen hinge
#

Using vulkan as the api

delicate delta
#

assembly to spirv when

queen hinge
delicate delta
#

it would probably be a bit of assembly

queen hinge
#

The amount of C ABI would be lethal to write

zinc trail
#

Opengl is a specification built on depreciation? (Aka compatability)

#

Yall are being a bit extreme

delicate delta
#

OpenGL is in fact a modern API with a bright future that everyone in the ecosystem is excited to build with and build additional tooling and drive support.

#

it's the tip of the spear

#

the best possible choice

elder kettle
#

Expecting APIs to be in active development is web brainrot imo

#

GPU drivers will support GL 4.6 for longer than GL has existed for sure

delicate delta
#

yes

delicate delta
#

it's just a depth buffer manipulation

#

so it's useful for decals to render something on top of a surface by adjusting its depth buffer so it doesn't end up partly inside the object

#

I guess this is how you can build a wallhack type deal outline too

#

so stencil a mesh to produce an outline, then change its glPolygonOffset so that it appears through other objects

#

it's interesting how I need a 20k range abouts to see it work

#

that's I guess related to my clip matrix

#

I'm not sure

#

that's the maximum depth slope above

zinc trail
delicate delta
#

I think it's probably more instructive to look at renderdoc than look at the visuals

zinc trail
#

have interactive stuff usually explains stuff to my brain better

late jackal
#

glPolygonOffset is funny when the depth buffer is floating point

#

and by funny I mean horrifying

delicate delta
#

I don't use floating point for my depth buffer attachment

#

I saw someone say not to do that

late jackal
#

yeah, just saying

zinc trail
#

i might be missing something but arent depth buffers always float?

late jackal
#

floating point depth is good for your main camera though. it lets you do infinite reverse z

late jackal
#

you should use unorm for shadow maps

zinc trail
late jackal
#

opengl has bad naming for formats

zinc trail
#

i should have have known this ages ago since i know about the depth float formats

#

huh good thing i rarely if ever use the floating point depth formats then

late jackal
#

it does have a place as I mentioned

zinc trail
#

ive done infinite z with the unorm format but i probably didnt pay close enough attention to see the problems

delicate delta
#

is the only thing I see in renderdoc that's different

#

the data is otherwise all the same

zinc trail
#

i mean the gl state yeah makes sense, you should have different stuff written into the depth buffer then no?

delicate delta
zinc trail
#

this reminds me i should be able to make my shadow passes faster with the multi viewport stuff

delicate delta
#

multiviewport stuff?

shy cosmos
#

this is a common misconception

#

there is nothing faster about multiviewport

late jackal
#

the fastest way to draw a shadow map is to draw nothing in fact

shy cosmos
#

fr

late jackal
#

(you can cache shadow maps)

shy cosmos
#

yeah the biggest perf givers are cache at n1 and occlusion culling at n2

#

LOD at n3

late jackal
#

VSM at n0

zinc trail
#

okay assume i have to draw the shadow map, rn i draw everything in the shadow map 4 times, wouldnt i be able to just draw it once instead if i use the multiple viewports?

shy cosmos
#

VSM is too powerful

delicate delta
#

what are n1,n2 and what is VSM

shy cosmos
late jackal
#

you might save cpu overhead though

shy cosmos
#

even then it's just 4 indirect calls vs 1

#

you only get a measurable CPU speedup if you're doing basic glDrawArrays

late jackal
delicate delta
#

I am a pleb

late jackal
#

I'll allow it

zinc trail
late jackal
#

variance sm is not too difficult to implement

delicate delta
#

n1 means number of shadow maps what are we counting?

shy cosmos
late jackal
shy cosmos
#

multiview can only save you so much

delicate delta
#

oh tier list

zinc trail
#

so basically just do the 4 indirect draw calls and change my viewport between them

shy cosmos
#

yes

zinc trail
#

fair enough i suppose

shy cosmos
#

or even just have a layered shadow map if you're not doing fancy stuff

delicate delta
#

I thought this was a graphics jargon thing and it's just a reading comprehension thing

zinc trail
#

i would use the layered rendering stuff but i dont think theres a way to set the layer in the vertex shader thats in the core spec

#

and i really dont want to have a geometry shader for that

shy cosmos
#

have you heard of our lord and savior vulkan

zinc trail
#

eh swapping to vulkan for me would slow me down in terms of development time, plus i just simply dont need the performance gains vulkan provides

#

i really should just a better method to do shadowmaps though

shy cosmos
#

the better method is glMultiDrawElementsIndirect froge_love

late jackal
#

erm how do you render to multiple shadow maps

shy cosmos
#

for shadowmap in shadowmaps glMultiDrawElementsIndirect();

late jackal
#

wahoo

zinc trail
#

berubeUgh its basically just fitting multiple shadow boxes to the furstum and its just a couple small things to help looks

#

its nothing fancy and im not at all vested into using it forever

elder kettle
#

You could make your transformation matrix and indirect buffers such that it renders the whole shadow map atlas as a single scene KEKW

delicate delta
#

yeah I'm just drawing in a loop to do my multiple shadowmaps atm

zinc trail
#

it was just my introduction to getting shadows working and i crave better shadows lmao

delicate delta
#

not sure if there was a better way

shy cosmos
zinc trail
#

vsm and pcss are two things ive been wanting to get that workin

shy cosmos
#

it's only 15 bababillion steps to get up and running

#

or 2 if you're cool like us

zinc trail
#

oh and shadow samplers, i keep seeing them in the spec but never tried them

shy cosmos
#

they're just free 4 tap pcf

#

not too useful

zinc trail
#

oh i aint missing out then

#

would the gpu gems 3 about summed area vsm be a good place to start?

shy cosmos
#

I don't like the bad vsm

#

light leaking and self shadowing errors are nasty with bad vsm

delicate delta
#

I use that

#

that's what I mentioned before

shy cosmos
#

yea in shrimple scenes it's fine

zinc trail
#

i mean good luck avoiding artifacts with any shadow map method

shy cosmos
#

but with high depth complexity you just die

shy cosmos
#

have you heard of our lord and savior VSM (the good one)

delicate delta
#

sampler2dshadow

zinc trail
#

i have but nobody suggested a good resource for me to learn about it

delicate delta
#

it's like a one line change

shy cosmos
delicate delta
#

textProj

shy cosmos
#

but for the time being #1168692074447642664

#

the VSM team is working on it

zinc trail
#

and what about completed stuff that i can follow, discord threads are horrid to navigate

shy cosmos
late jackal
#

virtual shadow maps not found, useless article smh misinfo

zinc trail
#

ill take actual articles about stuff over stuff that isnt documented well

shy cosmos
#

we made VSM with our blood and tears

#

remember when we were struggling to understand how to go from virtual UVs to physical UVs Jaker? KEKW

#

hold up I gotta find that conversation

late jackal
#

there were many challenges

delicate delta
#

sounds like niche stuff that is unecessary

late jackal
#

I originally proposed rendering each page as a separate bindless texture

shy cosmos
#

#1090390868449558618 message

#

it's almost been one year since VSM

#

how time flies

delicate delta
#

oh so the VSM is making one gigantic texture and then using lookups to index into it

#

this avoids additional passes?

#

hrm

late jackal
#

it's about applying the concept of virtual memory to textures (so you have virtual textures) and then using that to minimize memory consumption

#

and it will consume basically a constant amount of memory no matter how many shadow cascades you have

shy cosmos
#

the random chinese articles about VSM

#

remember those? KEKW

late jackal
#

xiao hong zhu

late jackal
#

lao gan ma

shy cosmos
#

need some lao gan ma on my vsm

delicate delta
shy cosmos
#

it achieves better resolution with less memory overhead

#

so for example a classic VSM setup is to use 16 shadow maps, all of which are 4k in resolution

late jackal
#

in the context of shadow maps, you can analyze the visible scene to see which pages from which shadow maps need to be allocated

shy cosmos
#

if those are D32_SFLOAT shadow maps they would consume 16 * 4096^2 * 4 bytes of memory (1 GiB basically)

late jackal
#

being able to allocate individual pages (not whole shadow maps) gives you the granularity to minimize memory usage

delicate delta
#

yeah I allocate a lot of memory with my 12 4k shadowmaps

shy cosmos
#

yup, in the classic case you allocate only 64MiB to achieve 16 4k shadowmaps

delicate delta
#

that's incredible

#

hrm

#

I don't understand it though

late jackal
#

it's complicated

shy cosmos
late jackal
#

consider these things a curiosity rather than something you need to implement immediately

delicate delta
#

gotta be cool to have an entire team of graphics programming experts building just the shadow maps for your game's rendering engine

shy cosmos
#

they could've called us smh

delicate delta
#

they couldn't afford it

#

so what's cool

#

in renderdoc is you can hover over the pixels in the texture map

#

and get the actual values thank god

#

and see the math

#

the output from the math

#

but maybe it's deceiving because it's a float

#

hrm

#

I'm trying to understand what I should learn from this glPolygonOffset visualization

#

the constant I understand

#

the slope is harder to understand

#

by changing the factor parameter, the angle of the surface changes its position in the depth buffer

#

the factor parameter changes the position of a surface in the depth buffer given the surface's slope

#

so if I increase the factor the angle of of a surface results in the surface being given a greater distance value in the depth buffer

#

so factor * angle + r * unit = offset

#

m is the slope of the angle

#

I get it!

#

hrm

#

and this is useful for reducing shadowacne because I can use it move the surface further into the depth buffer so that when I sample the surface as part of the render pass it will appear closer to the light than what's in the depth buffer

#

and this can cause peter panning because the actual visible surface is now at a non-zero distance from what's in the depth buffer

delicate delta
#

hrm

#

so the reason I saw artifacts

#

was because it was self shadowing

#

and I have to offset it just enough so that when I sample it the surface that actually is visible to the light doesn't test as being a more distant value than what's in the depth buffer

delicate delta
#

I'm going to add these sliders to my shadows scene

#

except when there's movement

#

hrm

#

ok

#

that shadowing while movement happens kind of makes sense though

#

that's also self shawdowing

#

the geometry is out of sync with the shadowmap for a frame or something

#

I don't know how to fix that

#

let me just skip a frame?

#

that was a terrible idea

#

so

#

I fixed it

#

I now generate all 12 shadow maps twice in a frame

#

before a draw and after a draw

#

but only if the light and objects moved

#

setting the polygon offset and the full depth pass twice a frame when the lights or objects have moved

late jackal
delicate delta
#

I clean this up and done?

#

I can be happy with this?

late jackal
#

Yes

#

Spheres are the worst case for shadow artifacts hehe

#

Try a bigger, more diverse scene

delicate delta
#

the final boss

delicate delta
late jackal
#

Is the dolphin a triangle mesh?

delicate delta
#

yes an obj

#

I wrote my own very simple obj parser

#

idk what I'm going to do for gltf yet

#

my options are cgltf, write a C++ lib to use in my engine that uses fastglft or write my own gltf parser

#

they're all kind of bad options

late jackal
#

I'm telling sean

#

oh wait fastgltf is c++

#

yeah cgltf is probably going to be the easiest to use then

delicate delta
#

yeah, cgltf is kind of bad though

elder kettle
#

continue using obj frogapprove

delicate delta
#

cgltf_node** nodes;

late jackal
#

two-star programmer

delicate delta
#

imagine using ** for a format that heavily relies on indexing

#
cgltf_size cgltf_mesh_index(const cgltf_data* data, const cgltf_mesh* object)
{
    assert(object && (cgltf_size)(object - data->meshes) < data->meshes_count);
    return (cgltf_size)(object - data->meshes);
}
elder kettle
delicate delta
#

is how you get the index

#

I am not sure that works with zig

delicate delta
#

I should test if those functions work in zig

#

and if they do just go with cgltf

elder kettle
#

I used IQM which is basically like binary .obj but supports animation

#

It does have an example you could copy but it's still probably more work than just writing some abstraction over cgltf

#

Just standardize on an output format that your engine will store and just have a function that takes a gltf and returns that format

delicate delta
#

ok well gouraud is not going to get any shadows :/

#

hrm

#

maybe I need to remove ambient from the lights in the shadows too

#

in gouraud

#

that doesn't make sense

delicate delta
late jackal
#

Looks good. I wouldn't worry too much about fixing the tiny artifacts. If you look closely, most games have them too

delicate delta
#

yeah that's true

delicate delta
#

I am spamming these I know

late jackal
#

hmm the latency between the cursor and imgui is sus, but maybe it's a recording artifact

delicate delta
#

oh you mean how the cursor is always ahead of the drag handle?

#

it's really like that

#

this is all through renderdoc

#

nah it's like that without renderdoc too

#

is that not normal?

late jackal
#

hmm let me see

delicate delta
#

the cursor is still ahead of the handle

late jackal
#

mine has latency too but not as much

delicate delta
#

I think it's my laptop

#

and a 4k screen

#

it's just a bad laptop

late jackal
#

I recorded that on my crappy 60hz monitor

#

with double buffering I think

#

anyway it's not a big deal or even a problem

delicate delta
#

I don't have evidence, but I think the gpu can't power the pixels

merry surge
#

should’ve used C++

delicate delta
merry surge
#

I was searching for something else and found that by accident

delicate delta
#

what was that something else

merry surge
#

looking for users with my name

delicate delta
#

maybe I will get tired of zig and rewrite in C++

#

I don't think so though

#

I would definitely use fastgltf if I was writing C++

late jackal
#

me too

delicate delta
#

idk I might use it with this project too idk yet

queen hinge
delicate delta
#

nah

#

it doesn't work

#

that's what deccer says he does with his, he has a smiliar laptop

#

it doesn't scale well

queen hinge
#

idk why th people decided 4k monitors should be more common on laptops than on desktop computers bleaker_kekw

#

the only differences with a 4k monitor on a laptop to me are

  • the device runs slower
  • the device uses more battery
  • text is basically unreadable unless I reduce to resolution to 1080p in windows settings
delicate delta
#

^^ all of this is true

#

and I regret buying this thing

queen hinge
#

Which… I’d imagine a lot of people would have those same complaints with 4k monitors for laptops, lol

delicate delta
#

it's punishment for just looking blindly looking at a spec with a higher number

#

and pressing the buy button

queen hinge
delicate delta
#

nah macs have a lot of pixels

#

and I wanted something mac like

#

and dell didn't deliver

queen hinge
#

My laptop’s a gaming laptop and it only has a 2k monitor with a weird aspect ratio

delicate delta
#

mac like in terms of screen quality

#

and that was a foolish thing to want

queen hinge
#

I use it as ~1080p because I want to be able to read text KEKW
but it performs comparable to my desktop computer

#

A lot of programs I use don’t acknowledge dpi, and thus don’t scale for 2k or 4k monitors

late jackal
#

If it's too small, increase the scaling

delicate delta
#

the default scaling is readable on my laptop, it's just a performance issue, readability is an issue with imgui apps that haven't applied scaling themselves

#

the resolution is a performance issue

#

anyway I suspect it is

#

I don't actually have any evidence other than a blank glfw window that just calls clear color maxes at 500 fps

#

when using the full window resolution

#

and the smaller the resolution the more the fps go up

#

a max 500 fps for a blank window seems to indicate poor hardware performance yes?

#

at 4k

#

it's all spent in swapbuffer

late jackal
#

2ms to blit a single framebuffer is not a good sign

delicate delta
#

right

#

the laptop is otherwise really good

#

well there are touch screen issues

#

I think given I have an nvidia gpu pc my next laptop will just be amd linux

#

framework 16 or something

#

my goal is to get through the books I have and then if I make it maybe that will justify the purchase idk they're not cheap

#

I can't work on a PC and be glued to a desk I am more productive on a laptop

queen hinge
queen hinge
late jackal
#

bad app

queen hinge
#

also fonts just look
off to me at 2k res for some reason

late jackal
#

Higher resolution text should always look clearer in an app that correctly respects content scaling

delicate delta
#

I should really go pro

#

don't look at my shader code though

#

it has a lot of if statements

#

        float bias = 0.0;
        float not_in_shadow = 1.0;
        float normal_offset = 0.5;
        if (i == 0) {
            if (f_can_get_light_from_z_pos_0 < normal_offset) {
                not_in_shadow = textureProj(f_shadow_texture0, fo_light_1_z_pos_0, bias);
            }
...
#

super professional

#

unreal recruiters breaking down my doors rn

#

hey it works

queen hinge
#

you have caused me to start going through LearnOpenGL myself

delicate delta
#

yes I saw you were active in your thread

#

I gotta lurk all the unread community threads

#

been super busy all day

#

I had a bug where I was shadowing the wrong direction

#

so that's why I added the normal check

#

it's not perfect but like

#

it's just a learning scene

#

I'm good, I did it, we did it, we have shadows

queen hinge
delicate delta
#

hrm I lost my capture afte nvidia driver reboot

#

well actually I only fixed for one lighting

#

I can show you

#

that's broken

#

that's fixed

queen hinge
#

huh

delicate delta
#

just had to use the surface normal vs the shadowmap direction

#

dot product

queen hinge
#

next thing for me is textures KEKW
(I'm like 90% done, just need to install it into my shader)

#

good job brain
install is not the right word there KEKW
conveys the point but like

delicate delta
#

nice

#

I am going to use this picture for this chapter's learnings on my github readme, it doesn't look like much but it was the hardest thing to get right

#

that's applying the shadow across three axes onto a sphere

late jackal
#

what does it mean to apply the shadow across three axes

#

is it a point light

delicate delta
#

it means there's three shadow maps

#

involved

#

yes

late jackal
#

sun + two point lights?

delicate delta
#

no sun here

#

it's six shadow maps per light

#

like a cube encasing the light

#

maybe that was dumb idk

late jackal
#

no that's normal

#

idk where the three shadow maps are coming from is all

delicate delta
#

oh so

#

in this picture it's

#

y neg, x neg, z neg

#

idk

late jackal
#

oh like three faces of the shadow cube

delicate delta
#

a part of that sphere is spread across each of those three maps

#

is what I meant

late jackal
#

it's on the diagonal of the shadow cube?

#

where three faces meet

delicate delta
#

I think so

#

I didn't verify in renderdoc when I took the screenshot

#

it was a cube there instead of a sphere

late jackal
#

hmm you could color each shadow differently to check

delicate delta
#

and the shadow was on three surfaces

#

of the cube

#

idk

late jackal
#

so basically it's seamless

delicate delta
#

it's not actually, there's definitely a problem there at parts of the diagonal

#

but it's good enough :P

late jackal
#

seamless enough

delicate delta
#

if I wanted to spend more time on it I could make it better

#

my frag shader is awful

late jackal
#

next time you write it, it'll be better

delicate delta
#

yes

late jackal
#

I still think you should load a bigger model

delicate delta
#

there's still artifacts, but which for a game I will want to get just right

late jackal
delicate delta
#

I will, I have tons of progress to make still, I'm not done with shadows yet

#

it's just learn a little bit about this, move on to the next, come back around learn a little bit more

#

after my math books I have four books on just rendering, and then a bunch of vulkan cookbooks

late jackal
#

wow

delicate delta
#

I love taking pictures of my books :P

#

I need help

late jackal
#

I have a pile of books too, but they're collecting dust 😦

delicate delta
#

you already read them?

late jackal
#

I read a little of all of them

delicate delta
#

nice

late jackal
#

I need to read them fully

delicate delta
#

you know a lot already

late jackal
#

Math is my weakness

delicate delta
#

you work on graphics at AMD?

late jackal
#

I was a gpu devtech

#

Then layoff nation attacked

delicate delta
#

oh no I'm sorry

wild ember
late jackal
#

It's all good, I was looking for an out anyway

delicate delta
#

I wish you luck

late jackal
#

I'm having fun working on my renderer

#

I should've used this free time to read those books lol

#

I should go through math textbooks too but I don't think I have the discipline to teach myself college level math beyond what I already know

delicate delta
#

my degree is social science, I am anthro major and have a library science masters so not a lot math, I like learning the graphics and physics math though

#

I'm definitely not interested in math for math's sake

#

just to get stuff done in a game and that's it

#

I do like math a lot

late jackal
#

Same, but sometimes I want to understand papers better

delicate delta
#

I just need it to be useful

late jackal
#

Yeah having a use for it really makes you keen to pick it up

#

I didn't like math classes, but then I discovered graphics programming and now I wish I paid better attention

delicate delta
#

I was able to solve a shadow problem today because I understood what a dot product does, that felt nice

late jackal
#

When I was making a software renderer for a college class, I had a eureka moment when I understood how the dot product fit into lighting

delicate delta
#

that's a great feeling

#

gaussian elimination and the determinant matrix construction is basically just a black box to me still, I did think about it while reading through it, and it made sense then, but I couldn't explain it to anyone

late jackal
#

for me, it takes multiple reads to understand things

delicate delta
#

same

late jackal
#

and from multiple sources

delicate delta
#

yes, reading through multiple math books was very so helpful for understanding the look at/view matrix and the perspective matrix

#

they all had a piece of the puzzle

late jackal
#

brain works best when you feed it lots of sources

delicate delta
#

that is very true

delicate delta
#

I think Blinn Phong looks better than Phong, at least with what I've done so far

#

it just looks better, I like the specular better

late jackal
#

it does

delicate delta
#

I was looking at the latest FIFA game because it was being advertised on Steam and you know I think all the shadows in that game are simple projective shadows

#

the characters are all on a flat surface

#

the shadows are all highly PCF'ed. I bet those shadows are cheap af

#

they're all directly beneath the players, there are lights from every direction in the stadium

#

I bet that game uses 0 shadowmaps

#

I bet 90% of that game's costs is just the FIFA license

#

it probably is a single shadowmap

#

actually idk

ivory verge
#

2 times mastering thing with vulkan book one on each pile

delicate delta
#

I accidentally ordered it twice

ivory verge
#

: >

delicate delta
#

No idea what to do with the extra copy

ivory verge
#

find one who is also interested in giraffics in your area 🙂 or donate it to the library?

delicate delta
#

Libraries don’t like donations fwiw

late jackal
#

burn it for heat during a particularly cold sf summer day

delicate delta
#

Librarians curate the books at a library

late jackal
#

yeah it's like how museums curate their collections and can't just put everything in an exhibit

ivory verge
#

so you need to plant the thought into their brains that they should cure their curations by acureately adding a new bok to their curation

wise imp
#

well that depends on the library

#

you can just ask them

#

most libraries do take books in donations

delicate delta
#

It’s not pauper house for orphaned books to find parents

delicate delta
wise imp
#

i mean that depends if you library has stuff like graphics programming books

delicate delta
#

It’s extra work and they again curate the books

wise imp
#

ive donated mine to my school library

delicate delta
#

Idk what they do with donated books tbh

#

They’re usually low quality

#

And old and very used

#

I think Americans libraries are different from European libraries

#

Being a librarian requires a lot of education

#

I forget it’s been awhile

#

I think saying vulkan in a community thread summons vblanco like saying gltf summons lethargic 😛

wise imp
#

nah ive been on this thread for a while

#

im only on a few

delicate delta
#

My thread is probably pretty basic for you but always appreciate when you pop in

#

Probably basic for most people

#

In a year I will have a game I am working on again

#

And hopefully it will go better this time

maiden gazelle
#

You can use operators in glsl to multiply matrices tho

ivory verge
#

yes

#

mat4 a = b * c; // b and c are mat4s

#

its all in the glsl spec iirc

maiden gazelle
#

Okay I misread

#

I read the opposite of what Björn said

#

Nvm

#

This channel and Björn is too active

#

I should read it more often

ivory verge
#

😄

#

i keep mixing the 3 channels all the time

maiden gazelle
#

That’s an insult to Björn :p

ivory verge
#

nah 🙂

#

i like to hang out in all of them

maiden gazelle
#

Just joking

#

I like having you on my channel 🫶

#

And Björn of course