#Rosy

1 messages · Page 1 of 1 (latest)

inner warren
#

is this your vulkan project?

cloud rivet
#

ya

#

currently making iterative process on CSM, working on debug tooling to show the CSM layers in imgui image viewer

#

CSM has been taking me weeks, mostly because of side quests, where I switched to slang, switched to bindless, and experimented with multiview

#

plus work has been taking up tons of my free time and I'm preparing for an upcoming interview

inner warren
#

Im still tryna figure out why my image aint blitting onto my swapchain image lmfao

cloud rivet
inner warren
#

#vulkan message

#

here if you think you could have any insight ^

cloud rivet
cloud rivet
#

I gotta format that code in the bg heh

cloud rivet
#

I guess next is add the CSM descriptors to the mega set, put the indicies in my camera buffer, and then I guess render shadows

#

I expect I will need to deal with shadow acne and panning and probably fix the projection once I have shadows, and then I will add PCF and then I will be done with CSM for a bit

#

my vulkan books have PCF techniques I will look at

#

I bought all these vulkan books and they've been mostly not useful so far

#

either it's all GPU stuff or it's render pass & pipeline nonsense

#

I also need to reorganize all this shadow debug stuff it's all over the place right now

cloud rivet
#

my csm struct


struct allocated_csm
{
    VkImage image;
    VkImageView image_view_near;
    VkImageView image_view_middle;
    VkImageView image_view_far;
    VmaAllocation allocation;
    VkExtent3D image_extent;
    VkFormat image_format;
    VkSampler viewer_sampler;
    VkSampler shadow_sampler;
    VkDescriptorSet imgui_ds_near;
    VkDescriptorSet imgui_ds_middle;
    VkDescriptorSet imgui_ds_far;
    uint32_t ds_index_sampler;
    uint32_t ds_index_near;
    uint32_t ds_index_middle;
    uint32_t ds_index_far;
};

cloud rivet
#

well I got shader code now to sample shadow maps but it's all wrong

#

I will look tomorrow

inner warren
#

Make a descriptorset abstraction best thing I ever did

#

Also why are near middle and far all seperate sets, is this just an imgui requirement

cloud rivet
#

I don’t need a descriptorset abstraction as I am bindless, what you see there is just imgui texture handles

#

It internally manages them they are not my application code

inner warren
cloud rivet
#

it's been very helpful already

inner warren
cloud rivet
#

I have an index allocator for descriptors modeled after Jake’s

#

But with bindless you only need one descriptor set ever

#

So I don’t need to abstract it, just part of init code

inner warren
#

I dont need them but I like the organization

cloud rivet
#

Heh

cloud rivet
#

I'm going to go with csm from Lengyel's foundation

#

I just read through it, it's superb

#

I didn't expect CSM to be a forever project, but here we are

#

tons of debug tooling for this project

cloud rivet
#

fixed a lot of stuff already this evening

cloud rivet
#

alright alright I think my light matrix is okish, I added a little debug tool to show where the directional light is, and it is along the path I think I will use for my cascades, it's that little yellow tri fork, the lighter edge represents the light direction

#

I can also switch the camera to see from the perspective of the light

#

and I can also see the CSM ortho view, but that's still using the old matrix which I am replacing. I think the Lengyel approach will be a lot better than what I was doing

#

the light view doesn't have the sky attached to it, but you can see where the main camera is because that sphere is the sky wrapping its location

cloud rivet
#

I miss the simpler times of using zig and opengl, but I actually really love Vulkan will probably use it for forever now

cloud rivet
#

at least it's not a completely deformed frustum behaving unpredictably anymore, it's been really slow going but small progress wins along the way

#

it should just be a complete prefect cube based on Lengyel

#

some bad math somewhere

#

it should also be in my camera space and not centered around world origin

#

also the red box is the near plane and it's always negative z in world space

cloud rivet
#

it's been a real struggle, frustum math has been my biggest hurdle in graphics programming so far, it's what caused me to give up my voxel game to go back and learn

#

I can now decompose a clipspace projection matrix into worldspace, that was what I couldn't do in my voxel game

#

but what I am struggling with now is aligning an infintely far away directional light's orthographic projection with my camera's frustum

#

the other thing I can do now that I couldn't is find those points that you're seeing in that debug view, I can find sliced planes in a frustum

cloud rivet
cloud rivet
#

got the light debug display showing up where it is in the near plane

cloud rivet
#

I had the dumbest bug this whole time, I was overwriting my frustum matrix with a debug value in the debug drawer facepalm

#

a layer I never look at

#

the frustum is now directionaly correct with the light direction, but it's still not taking into account the camera position

cloud rivet
#

this will generate some shadows for sure, it needs more work

#

once it's an orthro it won't shrink in the distance

#

just have anything would be nice

#

so I'll work with this and iterate on it

cloud rivet
#

well

#

I licensed Lengyel's engine

#

and I found his CSM code in there

#

AND

#

well

#

his book leaves out a lot of details

#

I'm glad he makes his code available for licensing

#

I will use zero of it, it's against the license to

#

but I am learning from it

#

anyway, pretty cool stuff, it'll eventually help me make my own CSM better

#

it's time actually render some shadows with what I have for now though

cloud rivet
#

I am the biggest moron

#

I literally had working shadows this entire fucking time

#

except

#

bool InNearShadow = nearColor.z < csm.near.z; -> bool InNearShadow = nearColor.x > csm.near.z;

#

that was it

#

I just had to spend time in renderdoc

#

needs some pcf though

#

some other minor bugs

#

but CSM!

#

I need to pick the map to sample based on distance to camera

#

pcf

#

and there's still an orientation issue with the frustum at some angles

#

but these are small potatoes compared to not working at all because I only had values on x because of the image format KEKW

#

I learned a lot again about a lot of things by having some bug and being way off course on fixing it and learning all sorts of other things along the way

#

like my understanding of orthographic perspectives is solid now

#

like how to make them from scratch and how they behave

#

I also frequently lose time on code bugs that would never be possible in zig KEKW

#

well would be possible if you intentionally wanted to

cloud rivet
#

what's cool though

#

is how awesome vulkan is

#

because all of this makes sense

#

and I was able to debug it so nicely in renderdoc

#

I could see my image and sampler create info, I could see the indexes for them in the descriptor, I could see all my matrices, all the color values, depth values for every image (that part is awesome about renderdoc)

#

just a great ecosystem 🤗

dry apex
#

Nice

cloud rivet
#

I need to keep the shadow maps within my frustum

#

I will follow up later and make it better

#

I want to work on loading sponza

cloud rivet
#

I'm going to add tracy profiling next

regal yew
#

wait, c++? what happen with zig? 😮

cloud rivet
#

zig is great, I just want to use a lot of C++ libraries without writing bindings

cloud rivet
#

I am installing Powershell Tools for Visual Studio so I can configure a powershell project to run as a build step to build my slang shaders as a build dependency for the engine

#

then I need to figure out how to create a new startup profile for the project to set default macros to add all the ztracy stuff

#

this is all stuff that was really easy to do in a build.zig lol

inner warren
cloud rivet
#

I don't use cmake I use msbuild

#

yes I can run commands

#

but I think it makes sense for a separate project to run the command and then I put all the slang files in that project

#

premake sounds cool, I have just been trying to contain everything to visual studio defaults

cloud rivet
#

not working

#

maybe I switch to premake KEKW

#

I mean it works as part of a build

#

but I can't get it run the script when the shader files change

#

it just can't seem to see anything other than C++ files as source and exe/dll as targets

inner warren
cloud rivet
#

that's the thing I don't want to run anything I just want to push the build button and stuff happens

inner warren
#

Yeah

#

It does it when you push build

#

It runs it every time you build tho

#

Not when you change shaders

cloud rivet
#

I want me changing my shaders to trigger them to build that's not too much to ask is it :(((

#

maybe I need a custom file watcher thing

#

I'm going to write a powershell script to do that

cloud rivet
#

nice was super easy

#

I have automatically building shaders now :D

cloud rivet
#

got tracy working!

#

I'll have to add zones and such tomorrow

cloud rivet
#

4 ms to render just deccer cubes (plus 3 CSM)

#

mostly the gigga barrier vkguide style takes only about 1 ms

#

the buffer swap takes another ms

#

and then 2 ms to render the cubes

#

unfortunately I wrote my code in a way that made gpu tracing not work well

#

I will have to refactor that

#

anyway, next I will add some hidden surface culling, using vkguide's strategy, I need to pull colors out of materials and then I try sponza. I don't have any support for translucent meshes right now those would just look broken

cloud rivet
#

after sponza I want to do skeletal animation

#

after that I just want to go back and go through my books again and learn more

#

@astral hinge I had pointed out before that running the new shader object commands felt slow, they really are slow you can't call them in a draw loop, they as a whole take over 100 micro seconds, I was calling them per draw at first, I sparingly set them now, they're like each 10 microseconds 😅

#

like to call any of those vkCmdSet*

#

I bet if I used pipelines I'd wipe 1ms off my frame time

#

eh it's ok

inner warren
cloud rivet
#

I don't create shader objects per frame

#

I was talking about calling the functions you have to record in a command buffer before you can render

#

setting depth enabled, setting polygon mode etc

#

all the new vkCmdSet* functions that were added in addition to the shader objects themselves

#

with pipelines you don't have to call them as you set all that in the pipeline create info

#

I think that they're slower than binding pipelines

#

it's no big deal, it's not that much slower and I rather use them than not :/

cloud rivet
cloud rivet
#

this is pretty cool

#

I am not going to worry about it right now though

wraith urchin
#

What's next for you now?

#

What needs to be done to get sponza running?

cloud rivet
#

and then it's just loading in the gltf and see what breaks or is slow

#

then I will work on skinned animations, then I will start making an actual game

#

I'm going to make my robot escape game

#

where you're a little obsoleted robot trying to escape being reclaimed

#

a small level puzzle game

wraith urchin
#

Very cool, frustum culling on GPU or CPU?

#

I'm also looking forward to the robot concept art

#

Hit me up, if you want some music

hushed creek
#

Ok found the thread

#

You should have pinged me like you promised >.>

cloud rivet
#

we'll see though I don't really know what I am doing

cloud rivet
#

I didn't ping anyone

#

idk I just don't have much to show right now

wraith urchin
#

you got the cubes at least

cloud rivet
cloud rivet
#

added a little bit of stats ui

echo crystal
#

no display of afps facepalm

cloud rivet
#

idk what that is

#

I think I heard of it before though

#

ah #1311466891415519302 message

echo crystal
#

was about to link it haha

cloud rivet
#

let me add that

echo crystal
#

yay

cloud rivet
#

my code is a mess. I need to clean it up, I looked at some other code bases, I really like Lengyel's C4 engine organization (I licensed it to learn from him), I think I would like to go for that

hushed creek
#

Did you ask him when his new books are coming out too

cloud rivet
#

No I just filled out a payment form and got access to a private GitHub repo

hushed creek
#

Owell

#

Does c4 also use vulkan?

hushed creek
#

Checked out the latest c4 vids and there is a real need for newer assets

#

I get the engine is 15+ years old but you cant tech demo today with what was good then

hushed creek
cloud rivet
#

I haven’t looked at what api it uses. The code is really good though. It’s like a crystal palace

#

Just sparkling beauty and clean

#

It’s great for understanding his math and technique which is what I am interested in. I haven’t run it

#

He doesn’t use STL I think

#

I am also going to stop using STL as much as possible

wraith urchin
cloud rivet
#

I will keep vectors

wraith urchin
#

(Technically STL refers to an obsolete SGI library, what we have now is the standard library or std)

cloud rivet
#

I just will stop using shared/optional/unique/expected and just use actual pointers

#

It is slow and I don’t like raii

#

Slow to build

wraith urchin
#

Yeah I guess it is your code, you get to choose how you do it. 😔 as much as I like unique_ptr

#

So why did you switch to C++ btw? I though you were big into zig?

cloud rivet
#

Ecosystem in C++ is better for games and graphics

wraith urchin
#

No vk bindings in zig?

cloud rivet
#

I don’t want to use bindings they are problematic and depend on a single maintainer working in their free time to maintain

#

I think STL clarifies the template stuff is what I don’t want to use

#

But that’s true

dry apex
cloud rivet
#

are you using vma?

#

I'm curious what you're using for textures also, are you using ktx or dds? are you generating your own mipmaps?

inner warren
#

glGenMipmaps bro

cloud rivet
#

it's not just mipmaps that you get from something like libktx you also get the compression

#

you can roll your own mipmaps with C++ but if you're still shoving in pngs idk, probably not as good

#

as something like ktx or dds and I don't know what other formats exist that do that, but there probably are

#

I guess it's all specified in the spec

#

VkImageCompressionFixedRateFlagBitsEXT etc

wraith urchin
#

I use bc7enc for compression + a lanczos3 filter for mipmaps

#

once you have the compressed data you can stick it in a dds ktx or custom format

supple magnet
wraith urchin
#

The cubes?

#

omg i forgot about the image KEKW

brisk chasm
#

your background reminds me of a few of some backgrounds i have 🙂

inner warren
#

I cant tell if its cobbled together clipart or ai art

brisk chasm
#

the latter

inner warren
#

why is deccer white color

cloud rivet
#

it's just a placeholder skybox I found online I need to replace

#

I actually had to fix it in blender

brisk chasm
inner warren
wraith urchin
#

The the contrast levels are wild

inner warren
#

well I mean

#

it starts from noise

#

so contrast is usually pretty 50/50 throughout the image

#

or atleast so I've heard

cloud rivet
#

I do not like ai art

brisk chasm
#

same

cloud rivet
#

it's not art

brisk chasm
#

it looks the same no matter what you "generate"

cloud rivet
#

it's just ai pictures

wraith urchin
#

This isn't the worst I've seen but generally it's pretty awful

brisk chasm
#

youtube is being flooded with ai shit too 😦

wraith urchin
#

I Literally click away as soon as I hear that awful ai voice over

cloud rivet
#

does anyone have any recommendations where to find good sky art? I am using a sphere now

#

I prefer it to a skybox

wraith urchin
#

Theres alot of hdris on polyhaven

astral hinge
#

I use rayDir * .5 + .5 for mine

cloud rivet
#

why doesn't google show me stuff like polyhaven

wraith urchin
cloud rivet
#

I search for skyboxes and I get junk

wraith urchin
#

Search engines are dead

cloud rivet
#

they really are, I just watched freya's recent video it was so depressing

#

even kagi is affected

wraith urchin
#

The only way to find stuff is to ask people on discord

cloud rivet
wraith urchin
#

Yeah I watched the vid

#

But polyhaven is a God tier site

inner warren
brisk chasm
#

when epic announced FAB i thought all sites they "own"? will be merged and just point to fab.com, but they dont, like sketchfab/polyhaven/textures.com etc

wraith urchin
cloud rivet
#

I gotta replace mine

#

maybe I just try the shader

wraith urchin
inner warren
#

Its only in short form content brainrot

wraith urchin
#

I have to assume everything its telling me is AI hallucinated misinformation

hushed creek
#

My oldish windows laptop takes about 10 mins to build my engine due to my tons of template stuff

#

But my macbook does it in about 20 seconds tops

#

So I see that as a windows laptop issue not a C++ issue in this context

#

The next windows machine will do it just as fast or faster than the mac

#

So while I'm sure you can learn (and should) lots from c4, keep in mind it was made by someone who made games a couple of decades ago on hardware from a couple of decades ago with languages and libraries from a couple of decades ago

#

Or dunno dont listen to me I may be talking out of my ass here XD

#

Templates are C++'s greatest strength because they allow you to write less C++ by having C++ write itself

#

Writing less C++ is always good in my book

#

Also play some games from a couple of decades ago or older, see how great they run on new hardware

#

Truly peak engineering must've been

#

I'm not taking shots at old games or what the devs had to do to make them work because making games is hard and focusing on supporting generic hardware from 20 years into the future is a waste of resources for many reasons, just not agreeing with how you randomly picked c4 and went with "this is good I will do everything like this"

#

Be more selective and critical of stuff, is my advice

hushed creek
#

Use the stuff that helps you be productive whatever that may be and you're productive when you add or change features to the thing you're building

#

Fixing bugs is not being productive, debugging is not being productive, stepping through code is the least productive part of the already unproductive debugging, fighting the language is not being productive and indeed dealing with modern C++'s occasional bs is not being productive

#

These are I think good guidelines to follow, use the stuff that helps you build what you want faster

#

You may argue that fixing bugs is not being unproductive because they're necessary to not ship something broken and I agree with the 2nd part especially they're necessary but also a day of bugfixing pushes the release date by an extra day while the features of the product stay the same

#

So anything that helps you avoid bugs is worth considering

hushed creek
#

In these 2+ years I've been working on my engine those days are the only ones I really regret, when I wanted to add something new or change something but instead had to fix some bugs to make it happen or to try and get something to compile or work the way I want it and need to research the magical incantation C++ wants

#

At the end I'm of course happy because finally I get to do what I want

#

But on the other hand jesus christ what a fucking waste of time

cloud rivet
#

Yeah, that’s why I turned on Werror yesterday. To avoid wasting time on bugs. It really does suck to lose hours on bug fixes

#

I am not just trying to blindly copy C4, I really dislike RAII, and my code actually is a mess and I have been learning about good code structure in C++

#

I don’t have time to write good code at work, I want to write good code

#

My thing is just a hobby, nobody will likely ever play anything I make. It’s just a thing I like doing, plans to ship a game on steam would stress me out even more on top of work stress

#

There are already a ton of games out there, many indie games much better than I could ever do. I am just building a game for me. I can take my time in my case

#

I appreciate your perspective though, you make a lot of good points

#

I do want to make progress

#

Just not with what I currently have, it is garbage

#

I turned up errors to W4, and fixed all those errors and learned how to ignore errors in third party code. I tried turning Wall on but it freezes Visual Studio lol. I think I will have to enable those warnings one at a time

#

I have found actual bugs

#

Like I was setting maxLod to num levels on sample create info, which must have been a copy paste failure??

#

I kind of just want to write C but in C++ so I can use C++ libraries

wraith urchin
cloud rivet
# wraith urchin what is it about RAII you don't like btw?

It's so much simpler to just allocate memory for something and pass a pointer around to that memory. I do a pretty good job of understanding the ownership of what code owns what memory and when it can be modified. It's all my own code. The magic of RAII is hidden control flow I don't like, I like explicit deinits. I can think about it better. I don't like std::move and std::copy and std::shared and managing all that. I can just track pointers. I did it with zig and never had any problems

#

also my build is really slow when I change a header and I have very little code, and I attribute that to: bad code organization that I am fixing and template usage, so I want to remove them for that reason too

#

I hardly have any code, my build shouldn't take 2+ minutes 0_o

#

I kind of went all in on RAII to try it out though

cloud rivet
#

I wonder if I can get more verbose output during building to see what actually is taking up time

wraith urchin
#

I recall hearing someone do that

#

Lemme see if I can remember where I saw that

cloud rivet
#

when I first started writing C++ for this project I kind of just was writing it as I would write zig and that didn't work at all. But now that I know more about C++ I think I can actually understand a path where I can write C++ as I would zig, but with the understanding of how translation units work in C++. In zig you don't have to worry about that, have to worry about import order and that has been something I have had to learn. This is for C, not C++ but I like this too https://www.lysator.liu.se/c/pikestyle.html

#

I want to try to have a single include and then include cpp files intead of the mess I have right now

bronze socket
#

I remember finding the flags for deccer but I forgot them already

#

it's like -ftime-trace and one other

cloud rivet
#

so that it ends up building a single tu for the renderer

bronze socket
#

one is clang-specific and gets you really nice flamegraph data

wraith urchin
#

What compiler are you using @cloud rivet ?

cloud rivet
#

msvc in visual studio

wraith urchin
#

Cool

#

Seems like most of us are

#

Well technically I use clang-cl most of the time but I'm still in the MS ecosystem

cloud rivet
#

I used msvc for zig too

#

well the zig compiler for compiling, I forget what I used msvc for in zig 🤔 I am already forgetting things

wraith urchin
#

You should check out clang-cl it's really easy to set up in VS with an existing project

cloud rivet
#

ok thanks

wraith urchin
#

It's good to see sometimes it gives better error messages

bronze socket
#

yep clang is pretty cool

#

plain MSVC with verbose error reporting gives me the best numeric UB feedback of the big 3, I've found

wraith urchin
#

Build insights

bronze socket
#

yes

cloud rivet
wraith urchin
#

My debug build is MSVC and my release build is clang-cl so I exercise both compilers

cloud rivet
#

oh, and you never have issues that something builds in one and not the other?

bronze socket
#

inevitably you do lol, that's why you check

#

I build with gcc and msvc, but use clangd as my language server

wraith urchin
#

Now I know my code is more or less compliant

cloud rivet
#

nice

#

do you use resharper C++?

#

would that help? it has a clang tidy check I already use

#

it's not free unfortunately

wraith urchin
#

Nah, I don't use it

brisk chasm
#

i think there is a clang plugin for vs, which provides clang tidyisms, without resharper

wraith urchin
#

I never got ReSharper pilled

cloud rivet
#

Resharper is great

#

I probably would not add it to a big existing project though?

#

probably better to try it out on a new project if you're ever interested

hushed creek
cloud rivet
#

yeah, I don't have multliple platforms but I will try the clang compiler for sure

dry apex
brisk chasm
#

@ devsh's sweatshop nodocs

cloud rivet
#

oh you guys are coworkers, neat

#

I am going to use a bit field to track what I vk objects I initialized instead of std::optional. I see everyone seems to call abort() without cleaning anything up when they encounter something that isn't VK_SUCCESS and I don't want to do that. I guess RAII handles it in that case. I want to deinit everything I inited on any type of exit and not just exit the program. I was using std::optional but I am getting rid of that too.

#

Destructors of variables with automatic, thread local(since C++11) and static storage durations are not called. Functions registered with std::atexit() and std::at_quick_exit(since C++11) are also not called. Whether open resources such as files are closed is implementation defined. An implementation defined status is returned to the host environment that indicates unsuccessful execution.

#

ah nah it doesn't even do RAII? lol

#

no way am I doing that

#

oh I don't really understand what that means I guess, nm

brisk chasm
#

abort is the lazy way out

echo crystal
#

OS will free ur memory anyways smart

brisk chasm
#

ye still

#

you might want to cracefully shutdown

#

not just call some shit at atexit

wraith urchin
#

Sometimes you gotta make sure things happen in the right order

brisk chasm
#

sorting std::atexit() calls into the right order

#

: )

inner warren
#

A lot of memory management solutions create more problems than they fix ime

cloud rivet
#

my code is just a mess is all

cloud rivet
#

I'm going to fix it

cloud rivet
#

I am going to fix it by starting over

brisk chasm
#

as in Rosy 2?

hushed creek
#

Rosier

cloud rivet
#

I'll add a git tag on what I have and reboot the current project

brisk chasm
#

Rerosed

inner warren
#

make it based of wrenderer which is the pinnacle of rendering code and there is obviously no pitfalls in my design

cloud rivet
#

I'm not going to go crazy different, just be more conservative and apply what I have learned so far and hope it goes better

#

I'm also going to explicitly create the create info structs in each case that I use them and not use helper functions

#

idgaf

#

I'm just going to avoid abstractions as much as possible

#

and fancy C++ pointers

#

still use std::string and std::vector etc

wraith urchin
#

You can maybe try putting less code in header files

#

Also PCH or modules

#

Your biggest compile time seems to be headers from that graph

#

Instead of starting from scratch again why not try a deep refactoring (I always find that fun)

cloud rivet
#

it's because I didn't know any C++ and wrote code like you might expect, I have a huge dependency tree problem where I basically have really unstable headers because I just didn't really understand TUs and it is just a mess

#

I can't really easy reason about what is included by what at this point

#

I will make a change somewhere and something totally unrelated starts erroring

#

I looked at a deep refactoring

#

I think that would be more work than starting from scratch I hardly have any meaningful code

#

it's mostly vk setup and a rendering pass

#

and gltf ingestion

#

and a camera

brisk chasm
#

its totally fine to start over and over

#

and then apply what you learned the previous iteration

#

that will make those actual refactors simpler in the future, when you actually "have" or want to

cloud rivet
#

I think so too, especially now where I hardly have any code that does anything

brisk chasm
#

im doing the same now with that HowToScript learning project thing, which was Toadwart before 🙂 and now becomes OpenSpace or perhaps one more step in between, not sure yet hehe

cloud rivet
#

I do want to have something at some point that lasts and I can work on for the long haul, like uninvestigate

#

I will read up on C++ modules

brisk chasm
#

tear or allmight (i always mix the two) were also fiddling with modules, perhaps speak to them too about their experience with it

cloud rivet
#

get on my level

astral hinge
#

those comments aren't gonna write themselves

cloud rivet
#

I'm gonna try and avoid vcpkg this go around and add manual build instructions for third party deps

#

instructions for me when I want to run this on my laptop

#

maybe I'll write some powershell at somepoint to add them

brisk chasm
#

not naming header .hpp facepalm

astral hinge
#

that takes too long to write

brisk chasm
#

hehe

astral hinge
#

we are efficient programmers here

cloud rivet
brisk chasm
#

isnt that an oxymoron, in the context of cpp

cloud rivet
#

I just used this

#

:|

brisk chasm
#

oh no 😄

cloud rivet
#

anyway

brisk chasm
#

nah its alright, ignore me

astral hinge
#

I use those buttons too

astral hinge
#

But I have to fix the formatting in the cmake every time 😄

brisk chasm
#

we need a no version of 👌🏽

cloud rivet
#

look at this sub second build time froge_love

#

see, problem solved

brisk chasm
#

the whole engine code is in one line, checks out

astral hinge
cloud rivet
#

alright I will add sdl3 then

#

then vulkan init, then render, then camera, then shadow and boom back to where I was

#

ezpz

#

oh and the gltf stuff

#

and the image stuff

#

ezpz

brisk chasm
#

and then you draw the nice owl

cloud rivet
#

already more than one second agonyfrog

#

it just hello worlds

brisk chasm
#

time to switch the programming language

cloud rivet
#

✅ SDL3 Window ezpz

#

took like 5 minutes to do that

#

also this time I went with a blank C++ application

#

I don't have this msbuild litter in my flie system anymore

#

just the files I have created

#

it's really nice

#

Vulkan init next

#

after a break

wraith urchin
cloud rivet
#

how do I cout ?

wraith urchin
#

don't KEKW

cloud rivet
#

write logs to a file?

wraith urchin
#

fwrite

#

but std::format() + fwrite works good

#

iostreams are widely considered to have some design mistakes

#

I don't really like any of the streams

#

If you do wanna use streams for logging, I recommend create a log.cpp and only including streams in there

astral hinge
#

I like printf but the lack of type safety is a huge bummer

#

std::print is better

wraith urchin
#

yeah std::format is pretty safe tho

astral hinge
#

std::format is std::print but to a string

wraith urchin
#

but std::print is 23 only

astral hinge
#

yeah so you have to write ugly code to print the result of std::format until then

wraith urchin
#

@cloud rivet which C++ standard are you on?

cloud rivet
#

latest

#

23

astral hinge
#

the other nice thing about printf is that its header is very light

wraith urchin
#

oh maybe you can use std::print

#

iostream is a horrific header

astral hinge
#

man it sucks that nice features hurt compile times agonyfrog

cloud rivet
#

oh ok I will dump it

#

I can't deal with slow compile times I don't care how nice the feature is

#

I need a fast dev loop

wraith urchin
#

I mean iostream isn't even that ergonomic

wraith urchin
astral hinge
#

Even though it has a nice API, it destroys compile times ime

cloud rivet
#

I am going to write a debug logging thing that will have log levels and stuff abstracts things

#

in game engine architecture they have a browser view of their debug logs that they can filter froge_love

#

different logging systems for different subsystems

#

hot reload will help with fast dev loop eventually too

#

I wish I had all this advice last go around, I appreciate the help frogeheart

#

thank you

wraith urchin
#

No worries

astral hinge
#

Tbh I don't even worry about compile speed optimization as long as it's fast enough

#

I put stl includes in headers all the time

#

But the biggest thing is probably having a 5950X

wraith urchin
#

Yeah I spend more time optimizing my engine load time

#

I'm using a 3900x which is a bit old these days, but it can still chew through C++ code

brisk chasm
#

i had a 3800x before this 5950x there is not much difference, despite double the thread count

#

compiling firefox or ue might be a bit faster

wraith urchin
#

or LLVM bleakekw

brisk chasm
#

hehe

brisk chasm
#

(`・ω・´)ゞ XD

#

i just looked at your latest PR and that rabbit gets mad if you tell it to stfu 😄

bronze socket
#

if you keep optimizing your build time in the back of your head you end up with decent enough results

#

just being extremely stingy about including anything unnecessary, maximizing forward decls, etc.

brisk chasm
#

forwardmaxxing decclmizing?

bronze socket
#

something like that

dry apex
#

yoo deccer is orange again. not the right orange tho

inner warren
hushed creek
#

frog_agony.png

inner warren
cloud rivet
bronze socket
#

there's also a pin in bikeshed iirc with a bunch of compile time optimization tips

cloud rivet
#

I will look thank you

bronze socket
#

#bikeshed-😇 message

cloud rivet
#

that's a great list

#

I think minimizing headers is interesting

#

I guess I don't need to stick anything into a header that isn't going to be used by a different TU yeah

#

I just always declared everything and all things in a header

#

but I guess I don't need to thinkeyes

cloud rivet
#

new(std::nothrow) 🎉

#

TIL

#

I can just check nullptr instead and not have any try except and can still clean deinitialize after an oom just like I can in zig

#

I do miss errdefer and defer :(

hushed creek
#

You shouldn't make exceptions part of the program's regular flow because they'll bring in a lot of overhead and catching is especially slow

brisk chasm
#

catching being slow is fine

hushed creek
#

If you crash right after yeah

brisk chasm
#

you usually want to exit your shit anyway when an exception occurs

#

or when you have IO involved (connecting to some http service for some reason, or something like that)

cloud rivet
#

I want 0 try catch

#

I will have to for file loading I think unless there's something I don't know about yet

#

but keep them to as close to 0 as I can

#

I don't want try catch messes

hushed creek
#

Like can you recover in a game if the file finalboss.bin is missing, nope

#

So crash

#

Can you recover in an editor if the file finalboss.fbx is missing, yes, so catch

#

You can remove its asset entry, emit a warning etc.

#

Maybe in a game like elder scrolls that lets you load and unload mods you could attempt to recover from missing files but even the game tells you it's not a good idea to continue

#

Exceptions are just one type of error handling mechanism, use the best one for the case you're in I guess

brisk chasm
#

you can recover very easily from that though

cloud rivet
#

no

hushed creek
#

I think std::expected when it becomes more common will help a lot in making error checking easier mainly because you can't get the value without doing the check

brisk chasm
#

if you expect files and they are not there, you skip or use placeholders instead, or decide to peace out

cloud rivet
#

you can use try catch I am not using them, I don't care what utility they offer I don't want any

brisk chasm
#

you dont need exceptions

#

streams have .bad() or the overloaded not operator

cloud rivet
#

I also do not use std::expected or any of those templated things

brisk chasm
#

the whole c file FILE* api also has functions to check

cloud rivet
#

I got I think all the files set up now that I will need until I have game play I am not allowed to add anymore files until then

#

ok I'm going to walk Rosy and then come back and add vk init

hushed creek
#

You named your project after your dog? 😮

#

Thats kinda cute

cloud rivet
#

She’s also my pfp

#

She’s a good dog

wraith urchin
#

Do use templates though

#

they are good for you

astral hinge
cloud rivet
#

I created a result enum I return to handle errors

#

I do not leave them unhandled

#

In zig I would use a union but here it will be just the result type and and the actual return value pass in as pointer just like Vulkan APIs

#

No templates, no exceptions no std::expected

brisk chasm
#

alternatively you could cook an expected type yourself

#

then you dont have to use enums

cloud rivet
#

That would require templates

brisk chasm
#

ye, one 🙂

wraith urchin
brisk chasm
#

compile times

wraith urchin
#

They don't always do that

astral hinge
#

yeah avoiding templates like that is kinda cargo culty

wraith urchin
#

@cloud rivet how long could you tolerate? for compile time

cloud rivet
#

If I have to use templates I will, but I don’t think I need to for this

astral hinge
#

the only way templates hurt compile times is through redundant instantiations, which you can theoretically remediate with extern template

wraith urchin
#

Like a clean build of ASO + dependencies (Bullet, SoLoud & SDL) 1:27 minutes

#

an incremental build is near instantaneous

cloud rivet
#

Nice

wraith urchin
#

I use templates and standard library all over the place

#

How fast do you want it to be?

cloud rivet
#

I don’t have an exact number

#

But the previous version took as long as ASO KEKW

wraith urchin
#

Do you have /MP set?

cloud rivet
#

I just have whatever is default I don’t understand all the options yet

wraith urchin
#

actually is this cmake?

cloud rivet
#

No

#

msbuild

wraith urchin
cloud rivet
#

Oh good idea

wraith urchin
#

Is your code on an SSD?

#

I assume in the year 2025 it is lol

cloud rivet
#

Yes

#

No spinning metal in this house is permitted

#

I am sorry for my weird code

wraith urchin
#

In this blog, I will discuss features, techniques and tools you can use to reduce build time for C++ projects. The primary focus of this post is to improve developer build time for the Debug Configuration as a part of your Edit/Build/Debug cycle (inner development loop). These recommendations are a result of investigating build issues […]

brisk chasm
#

may i suggest a rename, of log to logger

#

log is what the logger writes into 🙂

#

log* new_log reads a little funny too

#

perhaps Logger* logger or logger_t* logger?

#

or TLogger* logger 🙂

cloud rivet
#

TLogger will trigger resharper to yell at me

#

I have reread the template metaprogramming section of GEA and they advocate for a case by case basis

#

also

#

in defense of what I have said so far, I am not going to bend over backwards to avoid templates, I'm not cargo culting, I think what I have explained I would do for returning results is just like all the vulkan code I use all the time, it's not exceptional

#

logger is not a real word, is what bugs me about it

#

I don't like nouning verbs

#

or verbing nouns

#

I guess it is a noun, but it describes someone who fells trees

cloud rivet
wraith urchin
#

/MP is the parallel build flag

cloud rivet
#

yep

#

alright really going to start on vk init now

cloud rivet
#

You know if I ever want to take a break on graphics programing for a short while and work on something else I think I would want to help out on the slang visual studio extension, and fix some of the issues with it, and maybe just on the actual slang project itself if they accept PRs

#

I don't think I will want to take any breaks any time soon though

astral hinge
#

you could take a break to work on gameplay froge_yeehaw

cloud rivet
#

ok back to work

cloud rivet
#

I frogeheart git log -S

#

-S<string>
Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file. Intended for the scripter’s use.

It is useful when you’re looking for an exact block of code (like a struct), and want to know the history of that block since it first came into being: use the feature iteratively to feed the interesting block in the preimage back into -S, and keep going until you get the very first version of the block.

Binary files are searched as well.

cloud rivet
#

current frame rate report:

cloud rivet
#

going through the vk init is just a grind

#

about halfway I think now

#

I think though I won't have to do this again any time soon

#

I think this engine is now much better

inner warren
cloud rivet
#

long term grind long term success

#

the grind is not short term

#

the grind never stops

inner warren
cloud rivet
#

8 more init functions to implement

#

maybe I can get a clear color by EOD

#

with no abstractions and helpers my loc is much bigger than before but this is much more readable

#

it's a zero abstraction init, I am hoping to just have a fully zero abstraction rendering engine, I do have a descriptor index allocator, but that's not really abstracting away any vk stuff, it's just something I have to have

#

my full build, after a clean is still under 3 seconds

#

hasn't gone up at all

brisk chasm
#

"Judy: Trent, we need to go faster."

cloud rivet
#

tiny headers, no templates, just a few files, it's working out for me

#

my graphics.cpp is going to have a massive loc eventually

#

I bet fastgltf will add like 1 second to the build

brisk chasm
#

linking massive cpp files also takes ages

cloud rivet
#

it's ok, I don't think I'm going to end up with another 80 second build once I am done with this, this is already a huge improvement

brisk chasm
#

i also have ccache and mold setup, but im not really sure if they do anything

cloud rivet
#

fastgltf is worth 1 second

brisk chasm
#
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 23)
if(!${MSVC})
    set(CMAKE_CXX_LINKER_LAUNCHER "/usr/bin/ccache")
    set(CMAKE_LINKER_TYPE MOLD)
    #set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-ftime-report")
endif()
cloud rivet
#

oh I wonder if I can use a different linker than whatever's the default

brisk chasm
#

sudo pacman -S mold ccache

cloud rivet
#

maybe I quarantine gltf to a separate cpp file so I don't build/link fastgltf whenever I touch Graphics.cpp

brisk chasm
#

some years ago i was playing around with a little c# program which would constantly compile modified files and link whatever lib/o was there into whatever binary i needed, so that i constantly have a binary ready to run at my fingertips, i need to pick that one up again eventually

cloud rivet
#

that's neat, wow

#

yeah my overall build from beginning to end is probably faster like this, but I am probably destroying incremental build times

#

so some tradeoff to be had

#

anyway still better than 80 seconds

brisk chasm
#

im also quite annoyed by build times > 1s because im so spoiled with what delphi/c# can do

#

but yeah, it is what it is, you cant always make this c++ shit that fast magically without tricks 🙂

cloud rivet
#

I assume anything that is feeling bad in my dev loop is a skill issue on my side

brisk chasm
#

same 🙂

#

and a big spoon of c++ cruft and tech debt from 50 years ago

cloud rivet
#

yes 😅

inner warren
#

holy shit im building slang with all options for a pr rn and this shit is lagging my entire pc

#

thats nice

brisk chasm
#

slang people also cooked up some RHI 🙂

#

it was suggested to me on ze github feed few weeks ago

astral hinge
#

I wonder if it's as cooked as slang is

brisk chasm
#

its some vulkan soup, i didnt look into it yet 🙂

#

but it made me think about anari, nvrhi, filament for a split second

#

and then i used the rubber band to snap my self out of it

brisk chasm
#

"the game" doesnt write itself : >

cloud rivet
#

And every one and their mom is making an unnecessary graphics api abstraction

cloud rivet
#

I'm just not in the market for any of these things anymore, I don't want an engine, I don't want a graphics library, I just want my vulkan

cloud rivet
#

finished vulkan init 😅

#

I'll do the color clear tomorrow, then add imgui back in and then work on adding gltf and skybox back in

#

I have a pure zero abstraction vulkan init again though, that's nice

#

still under 3 second clean to build time

#

This has been super worth it

#

I actually found some issues in my init code

#

cleaning out all that optional mess also is great

brisk chasm
#

you can probably move VMA and Volk into their own targets and link them statically?

#

in my Fuk project, i have vma, volk, vbkootstrap as submodules for some reason

cloud rivet
#

Those are those are files with a single #include and have a stb style impl #define directive

#

I could move them to the libs directory

#

I will do that

cloud rivet
#

these examples are great

#

the graphics to graphics sync says to use subpasses

#

which with dynamic rendering and SO means using the VK_KHR_dynamic_rendering_local_read extension

#

I'm getting rid of my ALL_COMMANDS

brisk chasm
#

i dont think i will look into vk anymore, all those outdated guides out there, and no matter whom you ask, its always different on what you should do now

cloud rivet
#

I'm going to read the 4 sync links everyday until I can recite them verbatim as I am team vulkan for the long haul

cloud rivet
brisk chasm
#

im also too old to learn new shit, opengl is hard already

cloud rivet
#

I think opengl is harder in many ways than VK

#

the explicit api and VVL layer errors really help

wraith urchin
#

How exactly?

#

I've only done a tiny bit of VK

cloud rivet
#

sync is explicitly documented and an explicit api whereas to me all that stuff seems less understandable and less well documented with no validation with opengl

brisk chasm
#

i think i should read the spec more next time (vk's spec) to understand sync better, but i didnt quite understand it last time when fiddling with Fuk

cloud rivet
#

the first time I did init with vulkan it took me 2 weeks full time? It took me 1.5 days this time

brisk chasm
#

i guess you are right that vk makes more sense there, since its much more documented than with opengl : )

cloud rivet
#

of course opengl will always take like 5 minutes

brisk chasm
#

hehe

cloud rivet
#

I take short cuts with my sync with ALL_COMMANDS and sync in vulkan is hard, you get that explicitly handled for you with opengl, but given the common uses cases I can follow the sync examples and figure out any custom stuff I want to do later

#

I'm also doing some things that aren't thread safe right now

brisk chasm
#

one step at a time

cloud rivet
#

Here's my current pedestrian understanding of vk sync some of it which may be wrong:

basically nothing is ordered for you, everything is out of sync, if you need something synchronized it has to be done intentionally. You don't get ordering guarantees even between/across queues or submits.

if you need the cpu to read from device you need a fence

if you need to read memory you wrote to from gpu to gpu you need a memory barrier, and if you need an execution to happen in order you need an execution barrier, a memory barrier is also an excecution barrier.

You can use pipeline barriers or events for that.

Semaphores synchronize queues, pipeline barriers & events synchronize cmds, fences sync gpu to host.

#

a subpass I think also behaves like a pipeline barrier, but that's render pass stuff

#

someone shared this on the vulkan discord I liked this:

#

the ALL_COMMANDS is a giga barrier shortcut that just says "fuck you, flush all caches" and is super inefficient, but basically guarantees order, based on my metrics for the few barriers I had it probably cost me about 1ms for all of them combined per frame

brisk chasm
#

vkCmdWaitIdle(); vkFinish(); basically

cloud rivet
#

There are also flags to refer to “all commands”, ALL_COMMANDS_BIT, which basically drains the entire queue for work.

#

hrm well it's gpu to gpu

#

glFinish is really slow

brisk chasm
#

i will look at it when i decide to unalive Fuk

cloud rivet
#

I use ALL_COMMANDS_BIT several times a frame

#

but I will get rid of it

#

vkguide uses ALL_COMMANDS_BIT

brisk chasm
#

i keep seing people mention timeline semaphores and whatnot

cloud rivet
#

yeah I don't need those right now

brisk chasm
#

vkguide doesnt do anything "performant" i believe or "best practice", it just gets the vulkan ball rolling

cloud rivet
#

no vkguide loads a full big gltf scene at the end of it

brisk chasm
#

yeah that hangar thing

#

but still

#

just like logl it just gets you enough knowledge to start using vk

cloud rivet
#

not really

#

it's outdated

brisk chasm
#

exactly

cloud rivet
#

you can use it if you want to manage descriptors like they did in the stone age

brisk chasm
#

that means, it lets you know enough to get started, but it wont be the "best" way of doing vk

cloud rivet
#

idk I am not a source of information about vk, I am happy to explain what I know but it is probably incorrect, I just know I like using it

brisk chasm
#

its all good

cloud rivet
#

ask the big brains in #vulkan

#

Sascha is super in particular

brisk chasm
#

he should know 🙂

cloud rivet
#

and really helpful

#

one last thing about vk vs opengl, I think the tooling for vk is also better than opengl, I think it's not keeping up anymore for opengl (also maybe relevant to @wraith urchin 's question)

#

like renderdoc opengl support is just mostly in maintenance mode at this point, is a fair thing to say

brisk chasm
#

yeah that is true unfortunately

#

bindless and vvl and all that shit is >>>>>>>>> opengl

cloud rivet
brisk chasm
#

hes not actively supporting any opengl nonsense really anyway

bronze socket
#

timeline semaphores make thinking about and implementing stuff simpler, so they're 100% worth it

cloud rivet
#

clear color ✅

#

I'm going to fix minimize and resize and then add imgui back in

#

then add gltf and camera back in and the csm and back to where I was 🎉

#

maybe a week for the full reboot is not bad

#

still sub 3 second build time

#

full rebuild after clean

#

this was a necessary exercise I keep finding things I had wrong actually

#

my rendering is also zero abstractions

#

+300 lines to render

cloud rivet
#

removing all the helper functions for vk create objects dramatically increases loc, but I don't care, I hated those functions. They hide important information and they required adding multiple versions or logic to handle variations

#

I much prefer putting the explicit create structs right there where I use them gpAkkoShrug

cloud rivet
#

my frames right now with just a clear color

inner warren
#

I have a bunch of functions(like 6 lmfao) that all do their specified task in one function, and then an Initrenderer function that also sets up some other stuff as well as calling those functions personally

cloud rivet
#

nice

cloud rivet
#

oh there's a validation error

#

also cleaned up volk and vma

#

that's a pretty clean code base that builds under 3 seconds, I just don't actually see how it's going to end up back at 79 seconds again I am sure I fully fixed the build speeds and made my code so much better I'm gonna have a game real soon

brisk chasm
#

does build time include compiling shaders? 😛

cloud rivet
#

I don’t have any shaders yet

#

But no

#

Just the C++ build

wraith urchin
#

He's using OpenGL 1.x KEKW

#

No shaders

cloud rivet
#

My shaders before were tiny anyway

#

Just shadow and texture sampling and basic lighting

brisk chasm
#

i also realised something this morning under the shower 😄 i have been doing basic ndotL lighting wrong the whole time

cloud rivet
#

I am going to try to use local attachments instead of render input attachments for multiple passes so I can just have one rendering block and fewer pipeline barriers I bet it will wipe like 1 or more ms from my previous frame time

cloud rivet
#

Just check the emoji

bronze socket
#

blinn phong is considerably more complex than simple ndotl

cloud rivet
#

Right it has the half angle

brisk chasm
#

i never used the FRAGMENT position 😛

#

l = normalize(fragment position - light position)
n = normalize(n)
light = n dot l

#

color = diffuse * light

cloud rivet
#

That should look pretty wrong with big surfaces with large distances between vertices

#

It’s kinda like gouraud

brisk chasm
#

idk why i fooked it up the whole time

cloud rivet
#

You mean the interpolated vertex position yes?

brisk chasm
#

you need to calculate the light direction from the light to your fragment

#

and do the ndotl based on that

bronze socket
#

oh you had a basis issue?

#

yeah you have to either put the normal into world space or put the light into TBN space

cloud rivet
#

how vulkan queues look on the inside

wraith urchin
brisk chasm
#

: D

bronze socket
#

honestly I haven't bothered with point lights in so long I didn't notice the mistake

cloud rivet
#

my game will be mostly point lights

#

since it will all be inside

#

I'm putting game play begin deadline beginning on feburary

#

like february if I'm not done with the code stuff bikeshedding I will be done and will be working on gameplay

wraith urchin
cloud rivet
#

yes

#

that's sort of like a directional pointlight?

#

hrm

#

with a width

wraith urchin
#

Yeah but the shadow maps are much simpler

#

It's like a cone

cloud rivet
#

yes

wraith urchin
#

You only need 1 face instead of 6

cloud rivet
#

with respect to shadows

#

we'll see though

#

small levels, large camera distance == cheating

#

@true moon to not spam deccer's thread too much with my own thing, I am even planning to set the origin at a corner of the level so that all cordinates in all directions will be positive, regarding:
#1019740157798273024 message

brisk chasm
#

its totally fine if you spam in my fred, thats what they are made for 🙂

cloud rivet
#

ok sorry just felt bad about that full discussion going on in there

wraith urchin
#

Yeah we can't allow deccer to get any actual work done froge_love

brisk chasm
#

i started ripping out glfw earlier : >

#

all the topics in our threads is what keeps me here 🙂

#

offtopic or not doesnt matter

wraith urchin
#

Are you using SDL @cloud rivet ?

cloud rivet
#

yes

#

SDL3

#

which has a nicer API imo

wraith urchin
#

How different is SDL3 compared to SDL2?

cloud rivet
#

for just windows and events not much

#

just minor api changes, but I like those changes

wraith urchin
#

I probably won't update any time soon but I'm curious

cloud rivet
#

there is a new way to use SDL, I think it is new, where you just provide hooks and don't even have a main function

#

If you're just using SDL for windows and events I don't think it will be a lot of work to update

brisk chasm
#

yeah that is cursed

#

where you provide function prototypes

cloud rivet
#

the way SDL kinda works is already cursed

brisk chasm
#

and SDL finds them magically and calls those

cloud rivet
#

because it replaces your main function

brisk chasm
#

like your GameTick and init function iirc

cloud rivet
#

well

#

it does a weird thing with main

brisk chasm
#

the benefit is that you can support all sorts of platforms which work differently, like mobile and consoles

cloud rivet
brisk chasm
#

without any jumping through hoops

wraith urchin
brisk chasm
#

its kinda cool actually, but weird when you are used to wire it up yourself

#

im also going with sdl2

cloud rivet
#

You should only include SDL_main.h from one file (the umbrella header, SDL.h, does not include it), and know that it will #define main to something else, so if you use this symbol elsewhere as a variable name, etc, it can cause you unexpected problems.

#

main becomes a macro

wraith urchin
#

SDL3 will probably happen around the time of my theoretical vulkan port

cloud rivet
#

yeah it's not fully released yet

#

at least not on github

brisk chasm
#

yeah i dont get that release bs either

#

everyone is celebrating SDL3 IS OUT NOW

#

but its not really

cloud rivet
brisk chasm
#

yeah

cloud rivet
#

it's not released yet

brisk chasm
#

im on 2.30.10 😛

cloud rivet
brisk chasm
#

its good that they cleaned up naming

cloud rivet
#

and that errors are now returned as bools and you call SDL_GetError() I love that

#

like if (!SDL_DoThing()) { // handle error } // all good

brisk chasm
#

yeah thats better too

wraith urchin
#

That is better, but that could be annoying to find all those spots

#

As I suspect it won't produce a compile error

#

Not too bad tho

cloud rivet
#

it would be a runtime error for you

#

because 0 == false

wraith urchin
#

Yeah but it might be an error that happens only when I put in a gamepad or something

cloud rivet
#

yeah

wraith urchin
#

Because they flipped success and failure

true moon
wraith urchin
#

I think it was the right choice, but the potential to introduce those bugs is not worth the benefits at this point in time

cloud rivet
#

I agree

#

I chose a lot of bleeding edge with Rosy

wraith urchin
#

Yeah if you are starting from scratch that makes sense

cloud rivet
#

vk shader objects doesn't work on linux afaik? could be misinfo and I'm picking up the new VK_KHR_dynamic_rendering_local_read extension

wraith urchin
#

When are we gonna get robot running around sponza?

cloud rivet
#

february I'm commited to game play starting feb 1st

#

that's it. I'm done with the project bikeshedding

true moon
#

I don't think there's really a benefit to keeping your coordinates positive

#

Your math is generally going to be basis-independent except for the up dimension

#

So the values don't matter much

#

And by keeping them all positive you're throwing away a lot of floating point precision

cloud rivet
#

I was thinking it would be a nice bounds check, negative numbers == bad math, but thinking about it would only bounds check in half the possible directions so maybe not a great idea

#

in fact

#

yeah placing origin at center and then absolute ceiling is even better

true moon
#

Yeah because then you have sort of a soft limit in all directions

cloud rivet
#

yes

true moon
#

Having a hard limit somewhere is going to cause pain eventually

cloud rivet
#

yeah more of a warning I think when it happens

true moon
#

I wouldn't worry about it too much loss of precision is a pretty seamless error

#

If you wanted you could just log a warning if something is far away

#

But generally it's not really a major issue

#

If you have debug visualization for things like raycasting and bounding volumes and stuff, then the actual geometric ramifications of precision loss will be visible graphically

#

So if your raycasts are missing for some reason and you go debug to see why it'll be obvious what's happening

#

But generally speaking graphical instability becomes significant long before physical stuff does

#

Since less than a millimeter of jitter is very obvious graphically but not really significant for most gameplay/physics purposes

#

100μm precision is about where you want to be (2048 meters) but you can get away with around 0.25mm I think (4096)

cloud rivet
#

thank you, that sounds good

cloud rivet
#

also this time drawing my imgui to my draw image instead of to the swapchain so I don't have srgb issues lol?

#

what was I going to do next I forget

cloud rivet
#

hrm

wraith urchin
#

sponza froge_love

cloud rivet
#

heh

#

I need to add a camera back

#

but what would the camera look at

#

chicken and egg problem

#

ok

#

I will add sponza

#

and then uh

wraith urchin
#

Gotta get that gltf loading

cloud rivet
#

change things until it's not broken anymore

#

yeah

#

none of this toy geometry, straight into sponza, I like it

wraith urchin
#

Might wanna start with Crytek sponza, Intel sponza is gonna be painful to deal with

cloud rivet
#

ok

wraith urchin
cloud rivet
#

how are they different?

wraith urchin
#

Crytek Sponza is the "original", Intel sponza is insanely detailed

cloud rivet
#

ok I get 60 fps on crytek sponza and then I try and get 60fps on intel sponza?

wraith urchin
#

Yeah, basically, you will probably need some culling to do intel sponza reasonably

#

also intel sponza will take longer to load, so it will be a pain to deal with while you are just trying to debug stuff

brisk chasm
#

it takes 2s when done semi properly

slim oak
#

60 fps on crytek sponza -> 6 fps on intel sponza KEKW

dry apex
#

i whish my life was this stable

#

bro doesn't pass a day without gamedev

dry apex
wraith urchin
#

its like 5gb froge_sad

cloud rivet
#

The one in May I took a train from Milano to Rome and back, it was a nice day

#

Walked around Rome

#

When I got back I was exhausted and just went to bed and had to fly home the next day

cloud rivet
#

I am going to start with incremental loading that reads bits per frame and shows a progress bar. I can’t have the app freeze while it loads large files anymore. I don’t like that

#

It’s single threaded still

astral hinge
#

what if you use std::async to spawn the loading in another thread and have it write its progress to an atomic string or something

cloud rivet
#

Hrm yeah could do that

astral hinge
#

doing it single threadedly sounds hard to reason about

#

I'm aware how ironic it is that I'm suggesting multithreading

brisk chasm
#

pinned

cloud rivet
#

I don't like these jpgs

#

I am going to make a tool to convert these gltfs to binary format, I'm just going to start with vertices, index and normals, then add materials

#

I am going to gzip that and load the gzip

#

I don't want to deal with any jpegs so I will convert those to ktx2

#

I'm going to load sponza at first with just normals as the color

#

then I'll add materials and textures

#

yeah there's going to be no fastgltf code in my actual engine I think

#

I don't think this is a lot of work

#

if it's not ktx or dds I don't want it

slim oak
#

they did textures in jpeg?

brisk chasm
#

some versions of old spoonza yeah

slim oak
#

genius bleakekw

brisk chasm
#

theres a tga version too

slim oak
#

yeah, I remember using targas

brisk chasm
#

i was finking of doing something similar as bjorn wants though

#

or screw all that, and do demon style development, i dont need to load any arbitrary model from sketchfab, but my own shit i made with blender

slim oak
#

I have a custom binary format that has a simple header with a magic word and textures, meshes and stuff like that is serialized to it
it's turbo fast for everything and I don't have to use Assimp or other format importers at all after compiling assets

#

loading pngs from .png take 50x longer than using my custom binary format

brisk chasm
#

yeah png is super slow

#

i would like to use gl...Compressed... exclusively

cloud rivet
#

yeah I just want one format for intake for everything

#

getting just vertices, indicies and normals in should be quick and then I can write a camera

#

and then go back and add the other stuff

brisk chasm
#

perhaps split your geometry into 2 things

#

vertexpositions and all the rest

#

then you don thave to send the whole geometry for things like depth prepass or shadowmapping, where normals/uv/colors might not be needed

cloud rivet
#

yeah that makes sense

#

well

#

it all goes into one big buffer

#

and then I have a buffer address pointer to it

brisk chasm
#

doesnt vulkan have something like buffer views

#

ah its probably that