#Rosy
1 messages · Page 3 of 1
🇬🇳
ye that's mega ub
unless you have multiple copies of the data in mapped memory and cycle through them
you could try putting vkDeviceWaitIdle at the end of the frame
or lowering fif to 1
Nice choice of soundtrack, I approve
glorious
Thanks for the encouragement 
I will add the normal map support after I fix the ub
It also has transparent textures so I should make sure that is working
We've all been waiting for sponza, glad to finally see it. You're waay ahead of lots of other people here lol
I was so close to trying it out I couldn’t go to bed lol. That was a late bedtime for a worknight
happens to me all the time lol
So I think I will create a permanent staging buffer for buffers that update frequently and once per frame blit them bounded by a memory write read barrier
I bet that fixes this
Hrm
Yeah its the gpu side that needs to be fixed so don’t have to worry about a slow fence
And then just directly write to the staging buffers instead
nice. i thought you had shadows tho
I rebooted the project because I wrote really bad C++ 
rip 💀
I can add them back
shadow mapping were a nightmare for me
what's that
It’s a newer KHR extension that gives dynamic rendering subpass like functionality that you get with a RenderPass, basically you get a way to create barriers during rendering is what I think it does
interesting. thanks
np, previously I had to stop rendering between shadowpass and render pass I think I won’t have to with this
I want to add drag and drop for for my .rsy format files so I can just drag them in and it reloads the level
with that file's contents
Oh no
should be easy?
it's just a hard coded string right now
I just detect the string on drag, via sdl?
and then load it?
just as I am now, I need to clean up the current level's stuff I don't think that's hard
Ah ok if you already have the rest working it's probably not that hard it just smelled like major bikeshed
no no I already have all the rest of it working
this will make my dev loop fast too when I work on assets
just drag them in
maybe drag them in as new objects as part of the current scene vs reloading the whole scene
does sdl have drag & drop support?
idk I hope so
rsy files are much smaller than gltf + bin
not even compressed yet
just a subset of gltf stuff though
it seems it does have drag & drop file support 😮
that's cool
I hope this video was helpful to someone.
oh god, that yt username
do you not like this youtuber
nah, its not about them, its about a person who kept ignoring any advise/response when asking very trivial things in #opengl and they kept asking non opengl questions there as well : >
one of the 5 people on the ultimate black list
absolute help vampire
On the subject of VS2022
Nice addition
Although not exactly rocket science so why wait until 2022 
i hate parameter hints
Intellisense is definitely faster but there are still some cases where it flat out refuses to work
Another reason to abandon templates in c++ I guess
They made it so that hitting ctrl twice toggles this
It (unsurprisingly) slows down the text editor when it is open
So I use it off and occasionally toggle it on/off
I always accidentally enable the hints by double tapping ctrl while using other shortcuts
Count on me to waste time in VS settings to get to know what's new instead of you know, actually coding
Kinda annoying that e.g. pressing the save shortcut twice will also enable inlay hints
There's a checkbox to use ctrl for this and it came off
Yeah I was thinking of turning it off
It's really annoying to accidentally toggle it
Ah well I'm okay with the shortcut being ctrl, I'm just slightly annoyed that it can be accidentally toggled while using other shortcuts
Just for reference for anyone searching for it
I got what you mean yeah
Appearantly alt + f1 also works
Of course it is assigned to nvidia's overlay mumbo jumbo (it takes a screenshot)
Anyway enough mumbling sorry
I don't like inlay either
it takes up so much space and makes selecting text harder
I haven't disabled it yet
I've disabled nvidia screenshot shortcut (because why would I use Nvidia for this?)
alt f1 works nice
Time to uncheck that "press ctrl twice to toggle" checkbox
Yeah I should do the same
It should toggle the inlay
wait it opens up windows help in edge
I have resharper C++ installed it changed all my visual studio key board shortcuts
maybe that's windows key + f1
Is resharper worth its cost?
I am sure my project would be way worse without it
like much much worse
but I am new to C++
resharper has saved me from being ignorant
I also have warnings as errors and W4 enabled
I like it, but honestly I can't distinguish between vanilla vs and resharper features anymore
I think there's a free trial
Yeah the linter is great
yeah I just have max linter level and warnings enabled
I use the refactoring stuff too
I don't have all warnings because it breaks all my dependencies
you can hide that, by telling CMake to do some SYSTEM thing rather PUBLIC or PRIVATE iirc
yeah, but also the stuff in all aren't really all that great tbh
Unfortunately yeah
get banned by deccer speedrun
oh yes remap F1 to microsoft's chat gpt or whatever
nice
get the kind of help that will just make everything worse
Still better than launching bing
the only ai I am still using is coderabbitai PR reviews in github because it actually saves me from horrible dumb things I missed
I canceled my anthropic and all the other things
I disabled all the ai tools in editors first thing
it literally just points out that I used the wrong value for sizeof because I copy pasted
etc
I do not use it for anything that requires thinking about
I use chatgpt as a quick google from time to time
Ask for sources on a topic etc.
how's that working out for you
It's a good "gatherer" I think
I don't think it's good at anything personally
But ask it a genuine question and you might as well ask the plant in your room
anything I can ask chatgpt that it could help me with I can figure out without it and then I don't have to worry about it being a hallucination
msdn is the best imo
I don't think msdn is a thing anymore
I think it's been microsoft learn for like a decade now or so :D
idk maybe I am wrong
2016 it looks like and finally fully shut down in 2020
I haven't heard or read "msdn" in forever, I was like woah
Now I feel old 😅
Have you watched any cppcon talks?
no, I don't really like learning from videos
with video/graphics programming sometimes it's nice because the video format works for 3D stuff
I need to be able to skim text
I can't sit through someone talking about something
I like the talks if there isn't a ton of code on screen, like short snippets work. But I absolutely can't stand videos where somebody is going over a ton of code, I need actual text for that
I second this, for another reason as well: I can listen to it while driving
I feel like I mostly get vk sync at this point, the thing that's not clear to me 100% is when things don't have a dependency on a pipeline barrier they just act like it's not there is a bit of a headspin thing I don't fully get yet, like you put a barrier to split cmds into before and after but it's specific to specific stages and if I think your src stage is unrelated to the barrier it's just ignored
I made a vk sync playlist on youtube for all the khronos videos that were sync related https://www.youtube.com/watch?v=iZ3J25qsacA&list=PLba6ETlcAXxDHsKEwa09MunGMxgSEassX
I'm going to watch them all I guess
at some point
created some github issues to track progress towards intel sponza https://github.com/btipling/Rosy/issues?q=is%3Aissue state%3Aopen sponza
I am not rendering the pots and plants at all I think
I think I am not pulling something out of the gltf that's causing that
that's another issue
oh wait I am pulling them out nm
looks great 
ok ok I'm going to start with the sync issue
perfection 
yup yup, nailed it
I gotta get it looking more like it does in blender
alright alright sync issue
interesting there's no layer validation message for whatever I'm doing wrong
I think the property is called "alphaMode"
in gltf
oh I don't look at that, nice I will check for it thank you, was going to look at the spec about transparency/blending mode
I got 9 days before game play so let's see how many of these issues I can knock out, idk, I have more issues than days
I think its set to "alphaMode":"MASK" for those bits
Shadows will go a long way
yes, also the normal mapping
Also what lighting model is this?
in blender?
oh mine?
it's like blinn phong without any diffuse/specular
I did pull that out of the PBR for gltf
just not using it yet
the shader has that info
Ah yeah, you should try ggx or something like that, it will look more like blender
ggx?
also the gltf uses roughness instead of specular, which phong uses
yes
GGX uses roughness
Its one of the more common BRDFs
thank you
I would show you my shader but its an absolute fucking mess
float ggx(float NdotH, float a2)
{
float denom = (NdotH * NdotH * (a2 - 1.0) + 1.0);
return a2 / (PI * denom * denom);
}
vec3 schlick(vec3 F0, float VdotH)
{
return F0 + (vec3(1.0) - F0) * pow(1.0 - VdotH, 5.0);
}```
the important bit 
actually is not that bad
vec3 lighting_ggx(vec3 l_color, vec3 F0, vec3 light, vec3 eye, vec3 normal, vec3 albedo, float metallic, float alpha, float alpha2, float k2, float attenuation)
{
vec3 halfvec = normalize(light + eye);
float LdotH = saturate(dot(light, halfvec));
float NdotH = saturate(dot(normal, halfvec));
float NdotL = saturate(dot(normal, light));
float D = ggx(NdotH, alpha2);
vec3 F = schlick(F0, LdotH);
float V = 1.0 / (LdotH * LdotH * (1.0 - k2) + k2);
vec3 specular = F * (NdotL * D * V);
vec3 kd = (vec3(1.0) - F) * (1.0 - metallic);
return (attenuation * NdotL) * l_color * (kd * albedo + specular);
}```
oh thank you!
and alpha, alpha2 and k2 are just
float alpha = roughness * roughness;
float alpha2 = alpha * alpha;
float k = 0.5 * alpha;
float k2 = k * k;```
and vec3 F0 = mix(vec3(0.04), albedo, metal);
yeah looks like my issue is the camera update, in the first is the bug, and in the second I do a vkDeviceWaitIdle before I update the camera buffer
do you sort your transparent meshes?
I'm gonna guess glsl won't support unicode variable names α
I don't want to use the wait idle, I want to try a staging buffer that I map to and then a blit in the rendering
the wait idle feels really jank moving around
oh heh, I don't know anything lol
what do you mean by feels jank?
Its not your fault its the ancient greeks
it's like the opengl glFinish
probably not something to call every frame?
idk, I want to try the staging buffer idea
the scene buffer is really small
I feel like I can blit that fast like
I'm going to look at what frogfood does for camera actually lol
oh
input (euler angles to orientation without gimbal lock)
https://github.com/JuanDiegoMontoya/Frogfood/blob/voxels/src/Voxels/Input.cpp#L56-L58
this is where I produce the viewproj matrix (I have an old and irrelevant comment about flipping the z axis
)
https://github.com/JuanDiegoMontoya/Frogfood/blob/voxels/src/Voxels/VoxelRenderer.cpp#L430-L449
what I linked is my New™️ way of doing it
the most important difference is that I don't use lookAt anymore hehe
in the old way you're using a pipeline barrier, but then just doing what I am doing
directly memcpy
hrm
looking at your new stuff
oh I just remembered a simple thing you can do
vkCmdUpdateBuffer, then barrier
it works even without n-buffering since the data stays in the logical command buffer until the command executes
right
that's what I was thinking
something to do as part of recording the command buffer
I didn't know if it was going to be blit or what
under the hood the driver probably has an arena that it allocates from when you call that function
a pipelinebarrier is way better than a wait for device to be idle right
one syncs the device with itself and the other syncs the device and the host
I was thinking a staging buffer would be nice because then the copy is all on the device
if the host and device overlap in execution (which it does if you're trying to maximize throughput like most apps) then vkDeviceWaitIdle will be bad for perf
I think that's how staging works right, you copy to staging, staging goes to device, then staging copies to actual used buffer on device
but maybe that's too many steps
I'm going to look at vkCmdUpdateBuffer
I have only done image layout transition pipeline barriers so far, so this is new concepts for me
staging buffers are usually used as a "holding space" for data that can't immediately be copied to the device to prevent a data race, but they're also used for image updates because you can't upload pixels to an image directly from the host (unless you have that one new extension)
dataSize must be less than or equal to 65536 bytes and the size must be a multiple of 4 for vkCmdUpdateBuffer hrmm
I think I'm way under
and of course it's a multiple of 4
yeah for your camera data you should be fine
validation will let you know otherwise
I love VVL
although I wish it would have messaged me on the map stuff, but how would it know I guess
yeah
it's like via vma
I think it is possible to intercept mapped writes though
somehow renderdoc can see them
maybe they turn memcpy into a macro
well not renderdoc
but SDL turns things into macros, like the main function
it works with already compiled programs though
yeah
I said a silly thing, was just thinking of how one could maybe do it, but obviously renderdoc isn't compiling my program heh
oh there's a vkCmdCopyBuffer2
that's a buffer to buffer update
I will just try vkCmdUpdateBuffer
which is totally different
I have a barrier right after I begin recording, I think if I update there I don't need another barrier? 
I think this will work, trying it
if not maybe I learn something
that works!
had had a layer message saying I need to mark the usage as VK_BUFFER_USAGE_TRANSFER_DST_BIT
but that was easy
let's see the perf impact
there's a barrier right after
anyway idk why I am narrating, just fun to work on a sync issue
I guess I'll add CSM back next
then VSM
yes then VSM
wow this review bot verified that I put the update before a barrier
it even verified the stage
this bot has saved me from so much heartache and saved me so much time by catching dumb bugs
it also makes my repo look super active 
I'm going to play some ASO before I start on CSM tbh
I did not have time for CSM as because past me was a real dummy and hard coded the swapchain image count I gave to imgui to 2 images in the past and then in the more recent past increased my swap chain image count to 3, didn't use imgui much and any interaction with imgui spewed error messages and lost the instance
I didn't interact with the ui at all while working on gltf so I didn't know it would do that, but I wanted to add ui for my csm and just everything blew up
git bisect helped me track it down
having only commits that build is so key
I literally had a commit where I only increased the swap chain count and that's how I figured it out
because I could not tell from the error that the swapchain frames imgui had were a different number than what my renderer had
and of course
I should never have hard coded those values 
fixed now though
RIP 2 hours though
added stats back to the ui, also 🚫 collapsible ui headers anymore
I want to add plot lines for frametime and triangles drawn etc
the triangles drawn plotline should be interesting once I have culling
You should check out ImPlot
CSM time?
well I am building some UI so I can see the shadow maps in the UI to debug
I am already setting up the shadow app depth images to render into
so I need to use that new vk extension so I can do the CSM in one rendering
and add a memory barrier to change the attachements
and I need to write the code to create the light matrix
and my brain needs to see what the light sees
so some camera work so I can see from the position of the light using the ortho projection
and I need to write the code so the light stays in the game's camera frustum
it's a lot and it's not easy for my brain
my brain hates ortho perspective matrices, it's a simple box, but it's still mind bending
the complexity is where the light is actually looking from being correct for where the user is looking, from the angle of the light
which is basically half a sphere
all the other stuff I feel good about, sampling, doing the actual depth pass, etc
it's just that dumb camera being in the right place at the right angle
I don't think that works
the C4 engine's CSM is incredible and I wish I could build that but I cannot, not yet. I see the code, I have the book with the math, but I'm not there yet
everyone's math is different in some way, whether it's the coordinate system - left handed/right handed, which coordinate is up etc, the matrix math or storage, their perspective matrix set up (is the horizontal or vertical aspect ratio constrained, is it infinite depth, is it reverse z, etc) how is their light matrix configured, what kind of lighting, how are they rendrering it, is it multiview, is it multi pass, etc etc, it's just a complex subject and you can't copy and paste some tutorial unless you're doing everything exactly the same, and I bet even then there's complexity
basically you have to understand the math at a fundamental level
or at least I have to
the light matrix has to be looking at what the player is looking at while staying at the same angle, so if the light is shining from the west at sunset and the player turns around it's not like the shadow perspective is just a box that rotates the way the player rotates, the box's rotation is dictated by the light's view, but the player rotates so you have move that box without rotating it so that it is casting shadows on the viewers view. The cheap way is to just center on the player, and then there's all that wasted space behind them that they cannot see, the better way is rebuild that box from the user's view frustum, that's what the C4 engine does and the math is too complex for me to get right atm
I can't simply center the light on the center of my camera frustum because it's huge
anyway it is kind of simple, but somehow not very simple for me when I write the code
the LOGL CSM tutorial builds something from the view frustum but it is hand wavy and assums opengl coordinate systems and the actual code doesn't really match the tutorial iirc and I don't like how they do it anyway
the C4 CSM layers only overlap a tiny bit, the LOGL is just fully overlaps iirc
Are we talking about a pure directional light?
The cascade matrix is often not aligned to game camera, as this would result in severe shimmering
In ASO the cascades are positioned along a line coming from the game camera
Have you looked at MJP's shadow sampler?
It's dx11 but all the math is the same
Lengyel's math goes into a lot of detail for stable shadows
so it doesn't shimmer, it is built based on the camera and the light matrix
My shadows didn't shimmer, then I introduced day/night cycles 
how do yours cascade?
Like this?
^^ this is followed by 4 pages of math to make it stable
I do 4 cascades, with a "stabilized" sphere fit
does yours cascade by overlapping in that way from the picture?
My cascades are perfectly stable under camera movement but under light movement they are not
They overlap in a slightly different way
I haven't made Lengyel's solution work for me yet
because I need to like do the math with pen or paper or something
to understand it
and haven't done that yet
his code is different from his book also, as in his code does extra stuff not explained in the book
Then again my view distance is way further than yours will be, so it's possible you just won't have shimmer
Since you are doing top down ish
yeah idk just trying to have anything atm
You will have much less perspective aliasing
MJPs thing has a bunch of different algorithms implemented so you can try them all out and look at the code
What book is this BTW?
It’s 2 books
Eventually 4
There’s no digital version
fwiw I already have a working CSM that I had last go around I can just plop in, I'm trying to do it a little better
I will look at MJP's stuff thank you
MJP's thing is cool because it allows you to compare different techniques
also hes a fellow frog
I'm starting to think that apis like SDL GPU will never replace OpenGL because OpenGL is implemented by the drivers and based on reading the vulkan proposals and reading about the history of OpenGL drivers the hardware vendors went out of their way for many years to build drivers such that their OpenGL implementation would do the very hard work of making sure AAA games performed well, probably by working directly with the studios themselves.
Things like SDL GPU may be bringing modern designed APIs but are they bringing in the same performance minded work? The idea of vulkan seems to be to free the hardware vendors from having to contort themselves from writing complex implementations that predict the best performance possible per game and give the tools for game developers to do that themselves because they best know what their game needs.
A library like SDL GPU may not be providing you with the optimizations that OpenGL drivers provided nor the tools to optimize your own application so it ends up being the worst of both options.
But for a hobby small game project probably fine though.
Idk just rambling thoughts
Would you recommend these books? I heard nice things
yes
absolutely
the book comes with a tiny bit of code, but the real code that Lengyel has actually written costs $100 to license https://c4engine.com/
I licensed it
it's great
and it it puts the work he put into the book to use
in fact in his engine he has comments pointing to chapters in his books
to explain the code
and the math
it is beautiful C++ imo
there's no cruft, no bullshit, it's like ivory tower C++
the man is from outer space or something
Didn't know about this
I read "Mathematics for 3D Game Programming and Computer Graphics" a decade ago or something, alongside studying Direct3D11
It was a good book
that book is also excellent
you can think of the foundation math book as an abridged version of that book
the 3DGPCG book refers to outdated graphics apis
like it assumes a -1 to 1 z depth and fixed functions
the rendering book adds lots of new things and goes into detail explaining things
I don't think anything replaces 3DGPCG
it's still the best reference to graphics math that I know of
the perspective/frustum math won't work anymore as written is all
How have I never heard of this
I wonder how usable the engine is for real commercial projects
As an alternative to Godot or whatever
The screenshots look neat
In terms of renderer arch?
but it is licensed by real studios
I am not really skilled enough to explain why it is dated, it is just what people have said
like that's cybereality's take he has also licensed the code
Lengyel is like the math consultant that studios hire when they have a math problem
so the math in that book and the engine is basically top tier
ok first step to CSM is adopting VK_KHR_dynamic_rendering_local_read
I'm going to do that before I add the shadow pass
This extension enables reads from attachments and resources written by previous fragment shaders within a dynamic render pass.
that's exactly what I want
If the dynamicRenderingLocalReads feature is enabled, pipeline barriers are now allowed within dynamic rendering if they include VK_DEPENDENCY_BY_REGION_BIT, and source and destination stages are all framebuffer-space stages.
nice
When such a pipeline barrier is provided, any resources specified (or all if a memory barrier is used) can be read by a subsequent fragment shader in the same render pass if they were written to by any overlapping fragment location (x,y,layer/view,sample)
These pipeline barriers cannot perform layout transitions or queue family transfers.
Reading data outside of values written by a previous fragment shader has undefined behavior.
hrm
Images used for this purpose must be in either the VK_IMAGE_LAYOUT_GENERAL layout, or a new dedicated layout:
VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR
oh maybe slang doesn't support this
[[vk::input_attachment_index(i)]]
Same as input_attachment_index layout qualifier in Vulkan. It selects which subpass input is being read from. It is valid only when used on subpassInput type uniform variables.
hrmmmm
DRLR additionally includes a mapping of attachments to InputAttachmentIndex decorations in the shader. For depth/stencil, the shader is no longer required to specify this decoration at all, in which case the corresponding API (VkRenderingInputAttachmentIndexInfoKHR) would also specify nullptr for the mapping.
ohhh
This extension enables reads from attachments and resources written by previous fragment shaders within a dynamic render pass.
This extension enables reads from attachments and resources written by previous fragment shaders within a dynamic render pass.
** by previous fragment shaders**
fml
womp womp
I love debug group coloring in render doc
pretty cool in nsight too
well I got the csm images, samplers image views and descriptors all set up, I need to set up the perspective and change the actual camera to that so I can see what it looks like, and then once I feel good about that I can start a shadow pass, once I feel good about that I can sample the CSM
probably end of weekend I hope
I will be done with this
then the engine will finally be complete, inshallah
I'm worried about the perf impact of drawing a sponza 4 times, once per cascade, once for render
I will probably need to start culling
honestly I don't think my game needs a CSM at the distance my camera will be at, just like one SM
Wait that’s a thing?
In vulkan ya
from the vulkan spec:
Khronos makes no, and expressly disclaims any, representations or warranties, express or implied, regarding this Specification, including, without limitation: merchantability, fitness for a particular purpose, non-infringement of any intellectual property, correctness, accuracy and completeness, timeliness and reliability.
Khronos is emphasizing here that the Vulkan spec is neither reliable, useful, correct or accurate 
In DirectX as well. But not in OGL :'(
This Specification contains substantially unmodified functionality from, and is a successor to, Khronos specifications including OpenGL, OpenGL ES and OpenCL.
The spec states it is OpenGL' s successor, heh
reminds me of this funny thing #vulkan message
that's such a weird thing

I just need like a way to manipulate my light before I can even work on CSM. More UI work
hrm
those should all bein tables
ok my renderer can now write to modifiable level state, just a shared pointer that the renderer is allowed to write to via ui arguments
ok so next I need a light debug visualization
I can't see the difference even though it says light direction hehe
oh
it's unused
what you can see is that it is able to maintain the state that's being modified
like my renderer couldn't previously change any state at all inside the application
but the ui obviously needs to be able to change state
so I am passing in a struct of data the ui can modify as a pointer
I pass a World& to my renderer and it can modify it to its hearts content 
(that's the whole game state)
what kind of stuff does the renderer change?
nothing lol, it just reads
right
but the UI part of the renderer does change stuff
yeah idk I am dumb and will cause horrible bugs if I do that
I think you're more principled
I'm only doing it my way because I'm relatively inexperienced and don't know of a better way
So big mutable state passing it is
It's a step above simple globals
I don't really know what I'm doing myself
You'll find out in due time whether it was a good idea
well if it was it will be a first
so my current light is actually super dumb right now. last go around changing my light was terrible. My plan this time around is to actually simulate an orbit around an origin. And so I'll have spherical coordinates around a unit sphere, but then also distance to control the CSM's light position
so the light is at origin + light position (after converting spherical coordinates + radius of the sphere)
so the light's direction should be origin - light position.xyz ?
I think that's right
It's up to you
well I want to have something I can look at and go ok I know what's happening
I always have to flip a vector somewhere regardless of which direction the light is pointing
same 
Not because I don't know what's happening, but because that's just how it be
I wish I were smart
If you make the light point at the earth, you gotta flip the direction before doing lighting calculations (otherwise the dot products will return <0)
yah
It's not smartness, it's just doing it a bunch of times
so there's the actual light, and then there' where that dumb CSM camera needs to be
yeah that sucks
and so that's what I'm trying to solve
I'm gonna draw two debug circles to simulate the lights position
and that should be where that dumb camera I hate goes
and then once I have that visualization and it is behaving as I want
then I will add UI to toggle my camera to that dumb camera
and it will use an ortho projection
and I can see what the shadow pass will render
and then I can start using it to generate a shadow map
and then I can sample
In mine I drew some debug lines in world space to represent the frustums of the csm (actually vsm) cameras
and all is well
of course when I say CSM I also mean VSM, I thought that was understood
jk
do you actually use a VSM?
I see your shadows they have such a nice PCF going on
how you debug in renderdoc 
but in my model viewer (same repo) there is vsm
oh nice, well you published an article on VSM so that makes sense
in the voxels? that's probably the screen space blur from the denoiser which ideally shouldn't touch shadows 😅
yeah the shadows are "actually" perfectly sharp when you get up close to them or disable the denoiser hehe
I use RenderDoc
I'm not using Vulkan RT
Remember, it's a simple voxel DDA traversal in a compute shader
oh I didn't know
Oh I must've told someone else
so no opaque accelleration structure or whatever
Yeah, I'm using a custom acceleration structure of my own design
(it's a two-level grid of grids)
I was reading the comments from people on the vk discord upset about RT debuggability and then devsh also went at it today in #vulkan
nice
Only the profiler doesn't work
I think there's a non-zero chance I'll have CSM by end of the weekend
since I already had it working once
I'll try not to lead you down any rabbit holes in the meantime
:P
I am weird
my debug lines got shredded by people last go around so I'm probably overthinking it as a reaction but I think I got something that works
why is it graphics?
that's the file it's in
pretty sure even nasa doesn't use that many digits of pi lol
it's just the width of the float
precision
width is a dumb word there
idk
I'll just call it pi wtf
alright this time my debug lines aren't just debug lines they are also circles and crosses, I am filling up a buffer with the vertices for one line, one cross, one circle with 100 segments, and then I have a vector of debug objects and I iterate over them in render time and the debug objects indicate what type they are, circle vs line, a transform, a color and the transform, color and bda go in a push constant for each draw, the bda is offset by the number of vertices for that debug types that precede it and then I am just doing non-instant draws with number of vertices for that debug type
I found to be sending literal worldspace line vertices last go around to be terrible
I'm not using instanced draws because I want to disable enable individual debug objects and I don't want to update a variable sized buffer storage
so I just manage that vector of debug objects per frame
I am excited to get debug circles working
I draw 1 line and 1 circle and I can go to bed
also that's the double not a float sized number
ok I got a line
now for the circle 😅
VVL really saving me man, how did I ever opengl
I gottem
trig 🤗
I sometimes forget about the timezone difference lol. It's 15.08 here
thanks!
so worth the day I spent on it
I can spam these
man also, it's so much nicer to be debugging stuff in sponza than it is floating around in an open sky with nothing but a bunch of wacky cubes
That makes sense. And also since you kind of know the layout and look of the scene, it would be easier to notice artefacts/bugs etc. I presume. I haven't loaded sponza yet
It's definitely not, single precision float is about 6 and double is about 15
The value that shows up in the popup is the precision it's rounded to for double
I should memorize those last 4 digits so that I know the full double value off the top of my head tbh that would be a cool and practical place to stop
Currently I just have it memorized rounded to 3.14159265359 since it's easy to remember
Yup I realized my mistake because it turned out to warn and fail the build
you know when I say OpenGL is deprecated that's totally
There's actually a distinction between inactive and active standards and OpenGL is an active standard
I don't know if they have like more documentation about what the difference is between active and inactive, this is just a menu on a UI
but it must have a source
it feels like maintenance mode
there's multiple press releases per year from Khronos about Vulkan and like 1 or 2 a year regarding OpenGL
hrm
if OpenGL ever does become abandoned I think it would be bad, but at the same time I could see hardware vendors not wanting support that stuff anymore
even just adding the debug draw stuff yesterday turned out to be much more work than I had anticipated because of all the stuff you have to write, which is not a big deal for a studio or a company, or even for an individual who knows what they're doing
but for someone just wanting to learn graphics programming for fun and has no idea what they're getting into it sure would be a slog I think
the SDL GPUs apis of the world I doubt are going to be able to take the place of OpenGL
I need to get over this, I don't care anymore, I'm just using vulkan
I'm not going to answer anymore questions along the line "which graphics api should I use" when people ask them, they just need to figure it out forthemselves
people can use whatever they want it doesn't affect me
im sure they will update opengl as long as "web" supports opengles
and that will be forever
ya
I am just happy I got something that is working for me and that's good enough for me and I don't need to justify my decision to anyone and nobody needs to justify their decision to me, we can all get along and I can just focus on working on my stuff, I don't know why I cared so much but I'm over it.
I do want to stop spreading misinformation so I will also just stop engaging in that kind of conversation
I also want to stop saying stuff like "how did I ever opengl" that's also not ok #1323084490997895198 message
you didnt have to justify anything before switching to vulkan either 🙂
I don't know, felt like it
and how did i ever opengl is a valid question
/me looks at the vulkan discussions in the foundations thread
given how fucked it is and how sad its state of tooling is
until today they are still fighting about a proper gl.xml 🙂
oh, I will however paste this press release here which gave me a laugh https://www.khronos.org/news/permalink/software-in-the-public-interest-announces-apple-m1-and-m2-as-being-opengl-4.6-conformant
Software in the Public Interest announces Apple M1 and M2 as being OpenGL 4.6 Conformant
ok ok I'm done
CSM time
well baby step progress to CSM time
take your time
spherical coordinates are gonna work
for my sun
ρ θ φ
this is going to be so much better than the dumb stuff I was doing last go around
lessons learned
😅
idk not worth it
you need a wide char
C++ has u8 as well
jump_sound = sound_data(u8"Resources/Sounds/luís_jump.flac");```
no in zig strings are not a thing and just are byte slices of u8[]
cool, does that work with all the apis that use strings for paths and stuff
so all this is just native in zig
filesystem::path is a wide string
it is not a u8
implementation defined
right
so it's all just byte slices in zig and every library every string is treated like just bytes
it's really nice
string are byte arrays in c++ too
they aren't, strings in C++ are a mess
you can't equate this
like
libktx
takes a char*
a const char*
std::string is a vector of bytes basically
wstring is basically the same but wider
they say nothing about the encoding of those bytes
its not a byte
std::u8string 
there is that
isn't char a byte?
ok why do I have to specify a w when I drop a utf8 character into a string, otherwise I get a vs error?
because you need to specify /utf8
its a VS thing
about file encoding
ok so in zig, it doesn't matter if I have "I like to eat a 🌮" that's just a u8
strings can definetly contain utf8, but VS doesn't do string literals as utf8 unless you specify /utf8
"I like to eat a 🌮" the len of that will be the number of bytes
I don't need to specify any encoding of any kind
there's no encoding
that's the difference
there's no wide, there's no encoding
it's just bytes
there is encoding it just defaults to utf8
that string just becomes the bytes and if you expected "🌮" to equal a length of 1 you will have bugs
that what it soudns like
utf8 is an encoding
the length of "🌮" is unlikely to be 1 in utf8
yeah it will be
is there some way to tell VS that everything is utf8 so I never have to worry about wide strings
/utf8
just give me std::string
do you have that turned on?
for literals at least
yeah
but also ask yourself why you are typing an emoji taco into your source code
ok ok thanks I will try this 🙏
I do type 'í' into my source code in a few places
so with /utf-8 the expression "luís" is a const char [6]
clang should work without the flag I think
no shadows yet but I think I got a place to put my light camera now
this is kind of dumb, I'm going to just switch to be a camera
yeah
so much easier
ok
since it's just a camera it should be easy going forward
this visual studio nav menu 
I love that thing
visual studio > visual studio code imo
this is in vs since forever
it's nice
its kinda obsolete with fuzzy finder, but yeah, its underrated
fuzzy in file finder?
ctrl+q
is that a thing?
did you press the button multiple times?
what button?
it's just cntrl t
press it once more and once more after that, and observe its title inbetween
resharper
uh ok this is really cool
vs' stolen variant is not as powerful (imho) it works, but they keep improving it with every version
another cool hotkey is alt+shift+. at least thats what i have it bound to (default in rider) - its a multi cursor tool which lets you select the next similar selection you have selected, enables multi cursor and when you let go you can just edit all the occurences at the same time - an alt+left mouse drag to draw a box-in-very-advanced
maybe I need to use better names than "ui"
and then this would be more useful
😛
actually this is pretty good I will use it more
I have been using visual studio for like 3 months now so still just learning it
woah
nice
I write go for a living
nobody is writing go in visual studio
indeed
I use visual studio code for work
i thought maybe you have before go was a thing : )
visual studio gode
I was writing python before then
hehe
and node.js
I wrote that too
imgur was a php stack that transitioned to go
idk how many hours imgur trapped me, clicking on next
best job I ever had
: )
it was amazing
my current job is all business, I can't listen to sales calls without my brain turning insideout man, it's like it's english but isn't
i know what you mean 🙂
I want to interrupt and say this is not how humans talk, but it would not go well I think
this is going well
ok tomorrow I add a shadow pass then and write to csm image and then sample
I think starting next weekend I will iterate between gameplay and graphics tasks so I can keep working on making sponza look better. So I will start on game play as per feb 1st, but it will be like, one game play thing, then one graphics thing, for a bit
and so on
i actually never stopped bikeshedding sponza. to the point that i thought: "why am i trying to make a 3d game anyway?" and then never continued
This is exactly how jai does it
Except we do have a string type which is different than u8[]
counted strings
No char type, but #char compiler directive for easy conversion
It is perhaps also worth mentioning that you can have "full-fat" strings in Zig. The std library just doesn't use any. Eg. I use the excellent zig-string library: https://github.com/JakubSzark/zig-string
You’re not working on your game anymore?
Once I have character I will lock the light to its position in third person camera
Which means in the characters space origin
I think I will likely not have camera rotation
Hrm
I am not sure I will try it with rotation
I turned on sync validation and best practices validation yesterday and realized I also had core engine work I need to revisit at some point, the ALL_COMMANDS have returned, and I have a write after write hazard still with my camera buffer, and I need to just use one giant buffer for all my meshes which should be simple, but
I am going to make progress on gameplay
also zero performance difference when went back to all commands
I just want to have a properly thought out sync and not to skip out on learning how that works so I will use the sync validation to fix my writes one at a time
I gotta focus on CSM, which I am not going to bikeshed and make perfect either
it's just making small bits of progress all over the place iteratively
I'm going to make github issues for all the memory barriers, and the meshes and the write after write hazard
Can't find enough time :(
Also thinking of making a 2D game instead but I'm no artist
I honestly don't have enough time either and I just sleep less and not do everything I am supposed to
it's fucked
Rip
I think I cannot be any otherway though, I don't want to not do this
i dont mind silly hand drawn squiggle paint graphics
as placeholders until you find someone make nice art 🙂 but make the 2d game either way, ali
so like the world can fall apart around me tbh, I need to be there for my family is all
Yeah makes sense
I didn't know I could configure validation and was only validating core functionality, but while I am dismayed at how many VVL I saw once I turned that on, I am also happy to have a tool to let me get all this stuff right
It just goes on the backlock though, I made github issue labels and everything, super organized like
I'm gonna have a good engine I am proud of one day
I'm not an artist either, but I am going to work at it. It's ok to be bad at something when we first start out.
the big camera distance crutch will help
it's going to help cut a lot of corners
like on shadows, details, artistic fidelity etc
static geometry, small levels, big camera distance are my guard rails
the camera distance will help with keeping animations small too I don't have to have many bones and weights
and I think despite all that it will still be a fun game to work on
it's just being real with myself about where I am at skill wise and how much time things take
I am also not skipping on getting my gym time in. Family -> exercise-> game dev-> everything else are my priorities
i don't really consider myself bad at hand-drawing but yeah digital art is new experience. i need a digital pen i think
thinking of a general style and how my character should look like is another challenge
you're really good at managing time ngl
heh, doesn't feel that way, I think making some kind of eventual career move will help me focus more on what's more important to me in my life now
I guess I already have a nice scheme it's just not a lot of stuff prints colors
yeah all the various linux cli apps just emit colors and powershell just doesn't I guess do that much
another raisin to switch to lunix fulltime
I'm gonna pass on that
you should be able to though, wsl2 in Windows Terminal with psh
and then there is oh my posh, oh my zshell clone for powershell
but you fly wsl
well it uses SDL and I don't import Windows.h but it is all msbuild
so it might
idk
my digital ocean droplet runs linux of course, so that's the one thing where I have a linux thing
I never use it though
or do anything with it, just donating money to DO I guess
this is probably the best job I've done on an orthographic perspective so far
Orthographic projections are only confusing from a visual standpoint
They are way more intuitive mathematically
so an ortho projection is basically a scaling and translation matrix
the volume of the projection is scaled to the ndc box
yes that makes sense, the cascade level is along the diagonal and scales the view
Say you have vector (x, y, z)
You can project the vector onto the XY plane by setting z = 0
yes
I understand parallel projections
in terms of
the what happens to the vectors
you guys aer always so serious, i need to grow up 😛
He was anticipating my diagram drawing
I'm never serious on the inside
hehe
real depiction of vector projection (1894, colorized)
that pic was the first reaction of my neuron network after seeing that hand drawing of demon
anyways the ortho projection is literally just like a columnar slice of the world with the dimensions of your box, that's why it's weird looking
there's still a box that I need to visualize and what's in it, and the orientation and somehow the depth math doesn't work as I expect and I basically have to fuck with the parameters until it does what I want
which is sad
It should work normally
i actually just wanted to ask how https://sketchfab.com/3d-models/hintze-hall-vr-tour-058b26fb31ed49df978de31af3dc091f this model looks like in your renderer, bjorn : > but then the trainituation happened
The depth is literally the linear depth between the projection plane and the object
where's the dinosaur 😞
the smooth rotation in this is so nice
I think I can just start on the shadow pass now
the camera seems solid
that's always been the hardest part
that's a 8192 x 8192 shadow map
my fps dropped by half
I think intel sponza would require some kind of occlusion culling for shadow maps
I think fps gonna have to drop a bit more to avoid all this aliasing
idk
gonna sample next
with what I got
make it better later
looking nice!
here's my in application debug viewer
the sun marker has a bug I need to fix I guess, it went astray for a second
pretty sure I am going to have shadows before I'm done today
they may look super terrible however
Maybe some kind of great PCF can help 🥹
Might be a bit overkill lol
we'll see, I have found the precision to help with aliasing
I don't want to do cascades tbh
with my camera distance
I need some kind of occlusion culling if I do cascading in a way that doesn't draw all the triangles
You might be able to get away with it if you're camera angle is more or less top down
that's why I was asking you about how much of your time budget is spent on CSM, because just 1 doubled my frame time
8k though?
8k shadow maps would probably be a big hit lol
it doesn't run a fragment shader
also if your renderer isn't doing much else, doubling the frame time isn't that bad
bandwidth isn't free
and there effectively is a generated fragment shader
what problem should I notice with the size of this map? it's always on the GPU yes
You're still writing 8x8k 32 bit floats
I never bring it to host
I'm not talking about pcie bandwidth
Yeah but gpus have memory bandwidth
yes just curious though what sort of problem I would see because of its size
so if I shrunk it down to 1024^2 and cycle back and forth I should see some perf get better/worse
yeah I am curious is all
Are you using PCF? that would probably make the aliasing alot better, without the oversized shadow map
If bandwidth is the bottleneck, yes
I plan on using PCF
The default setting for ASO is 2k per cascade btw
I can already tell it will not be great shadows
also sampling the shadow will be more expensive if the resolution is huge
rendering to such a ginormous texture will probably also make you ROP bound
4k for each cascade
Raster Op?
isn't VSM in one big buffer or something?
Raster output, the part of the hardware that makes sure fragment shader writes are atomic and ordered, does blending, srgb conversion, and probably more
it doesn't use a normal depth texture
it uses atomics and renders to virtual 4k textures
8k is a good size to use for your VSM memory backing store though 
actually 4k is good for that too
because the ideal number of vsm texels will be equal to the number of screen pixels
ah cool
it's very memory efficient
Anyway, it's possible to overload this hardware unit as it's possible to overload any other unit. gpu designers don't have infinite die space to work with
this is my PC
I have a laptop also
I just want to see how the shadows look at different resolutions
I thought I had 64GB memory, my laptop has more :/
I should get more
hmm do your monitors support refresh rates above 60hz?
Are 60hz VRR monitors a thing?
It's unrelated but windows doesn't automatically use the highest available refresh rate of monitors, which leads to many people not using them to their full potential
I think your VG27A supports a higher refresh rate (either 144hz or 165hz according to goog)
It's ok. Right click on the desktop and go to display settings
Then it should be in the config for that specific monitor
Choose the highest refresh rate
Yeah, it should be a lot smoother now
Depends on whether you value resolution or refresh rate more
I play dwarf fortress I'm not sure it matters 
Try running your app on that monitor
oh ok
I seem to have done fucked up
[2025-01-27 06:37:21.4777936] [WARN] [Validation] Validation Warning: [ BestPractices-Error-Result ] Object 0: handle = 0x2609ea4a8b0, name = rosy instance, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x53c1342f | vkDeviceWaitIdle(): Returned error VK_ERROR_DEVICE_LOST.
[2025-01-27 06:37:21.4804297] [ERROR] Failed to wait device to be idle: 252
[2025-01-27 06:37:21.5140472] [WARN] [Validation] Validation Warning: [ BestPractices-Error-Result ] Object 0: handle = 0x2609ea4a8b0, name = rosy instance, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x53c1342f | vkDeviceWaitIdle(): Returned error VK_ERROR_DEVICE_LOST.
[2025-01-27 06:37:21.5214061] [WARN] [Validation] Validation Warning: [ BestPractices-Error-Result ] Object 0: handle = 0x2609ea4a8b0, name = rosy instance, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x53c1342f | vkDeviceWaitIdle(): Returned error VK_ERROR_DEVICE_LOST.
[2025-01-27 06:37:21.5229262] [ERROR] [Validation] Validation Error: [ VUID-vkDestroyInstance-instance-00629 ] Object 0: handle = 0x2609ea4a8b0, name = rosy instance, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x8b3d8e18 | vkDestroyInstance(): VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT object VkDevice 0x2609ed19c70[rosy device] has not been destroyed.
The Vulkan spec states: All child objects created using instance must have been destroyed prior to destroying instance (https://vulkan.lunarg.com/doc/view/1.4.304.0/windows/1.4-extensions/vkspec.html#VUID-vkDestroyInstance-instance-00629)
it seems to be against best practices to lose your device
Where did it go
I tried to sample from my shadow map
and the gpu didn't like that so I enabled full sync debug and am looking through it
[2025-01-27 06:37:21.2218852] [ERROR] Error waiting for in-flight fence: 2
hrm
maybe I didn't set the descriptors up correctly for the CSM
deploying fence gif
oh no
Yeah I would not recommend losing your device
so it was fine until I sampled hrm
device lost when sampling suggests to me your descriptor is fooked
Hey I just lost my device too
OpenGL error: Unknown internal debug message. The NVIDIA OpenGL driver has encountered
an out of memory error. This application might
behave inconsistently and fail.
OpenGL error: GL_OUT_OF_MEMORY error generated. Failed to allocate memory for buffer data.
OpenGL error: Unknown internal debug message. The NVIDIA OpenGL driver has encountered
an out of memory error. This application might
behave inconsistently and fail.
Bjorn and I are on the same journey
wait wtf somehow I crashed not only my game and driver but Visual Studio as well
