#Foundations - Learning Graphics Programming with the Zig Programming language
1 messages · Page 8 of 1
maybe
fuck it
I'm going to make a rotation matrix use it to transform the normals and rotate it using imgur controls until it looks right
with no tangents how am I supposed to use a normal map 🤔
I'm sampling from a height map to get the vertex y offset
I am not going to spend hours of effort on this learning scene
to filter the height map into proper normals, I am going to try this shortcut
it should look like this
that looks correct
idk
let's try it
I did a non uniform scale on the terrain, that's why
let me try
im sitting in a room flooded by sunlight atm, with the shades down too 😄
lol
pretty happy with it how it turned out, although the journey was fraught
there's a LOD exercise left
then I'm done with the tessellation chapter, after that is the geometry stage
I need to get sleep though
3:30 am lol
the geometry chapter looks pretty uninteresting tbh, I will do it though
now i can see it a bit better, but, its just wireframe no lod from tesselation yet, neh?
no lod yeah
that's tomorrow
I realized my bittangent is wrong in that video
I fixed it though
ok really going to bed
kind of fun to play with light attenuation with the moon terrain
that does look neat indeed
I was going to add shadows
but it's too much work
I want to set up the texture sampler array approach you suggested
before I do that
it's just too many samplers otherwise
@ivory verge can you please pin your message 🙏 #1248864886772072591 message
thank you
i was hoping you checked what i actually have pinned 😄
man
man this moon terrain is giving me a tiny game idea
I think I have an even better idea for a game now that's even smaller in scope
this is pretty cool
ya
this is a better game
I can't stop playing with this scene
idk
some kind of coordinate system issue
it's also super noticeable even without wireframe
well when moving
I'm not sure the author intended for it to look smooth when moving a camera
I don't like the tessellation shader
cannot see the vertex outs
in renderdoc
oh
I could do this differently than the book and do the LOD in the vertex shader tbh
then I could see what it's doing
no I can't actually do it there I need multiple vertices
lol
coderabbitai has a better LOD than what was in my book
uniform float u_DetailLevel;
uniform vec3 u_CameraPosition;
void main(void)
{
float distance = distance(gl_in[gl_InvocationID].gl_Position.xyz, u_CameraPosition);
float tessLevel = max(2.0, min(64.0, u_DetailLevel / distance));
gl_TessLevelOuter[0] = tessLevel;
gl_TessLevelOuter[1] = tessLevel;
gl_TessLevelOuter[2] = tessLevel;
gl_TessLevelOuter[3] = tessLevel;
gl_TessLevelInner[0] = tessLevel;
gl_TessLevelInner[1] = tessLevel;
// Pass through vertex data
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
}
that's a much better idea
less buggy
kind of cool looking
can't even tell lol

hrm
I think the change is too great
between patches
I need more patches
that's better
still noticable
idk
definitely better than completely broken
this is locked to origin just to see what it looks like

This looks great TBH
thank you, it uses camera position and distance, I think that would be ok if I cull to the view frustum in a real map in a real game so that I don't include all the geometry out of view that might be LOD 0 right behind the camera
Additional experiments with tessellation shaders applied to my procedurally generated terrain with hydraulic erosion.
Again, I used a grid with 128x128 patches with max tessellation level = 16 and procedurally generated heightmap and normal map of 2048x2048 pixels.
Heavily inspired by this very useful tutorial by Dr. Jeffrey Paone hosted on Le...
the frog who made this is also on the server
How are you transitioning between lods? is it continuous?
i attempted continuous. I tried to make it more continuous by increasing the patches and creating a finer grained function that would produce a continuous lod
I think I have a lot to learn on how to do that better.
The lod has some variables, patch count. Instance count, a detail constant in my tessellation control shader and the distance from camera
What I do is squish alternating edges together as you get far away so that the patches match the next patch, so you don't see sharp transitions
That’s cool I think that’s something I could try
this is just all from a book
that I'm following along to learn with
although I improved on what the book says to do or change it to make it work in my zig x up LH system
I think I will have a moon like satellite in my game though as the main area of the game
will you be able to go to the moon?
have not
while I was playing around with that light up there on the moon terrain it made me think of the beginning chapter of fire upon the deep
a vinge book
there's this "zones of thought" thing in this series of books
where intelligence different zones in the universe can run at different speeds
we're in the slow zone
Like time dialation?
sort of, only the speed at which computations can happen
and in the fast zone, super intelligence can exist
which is basically god like to us slow small brain types, and we cannot survive there
but things sort of fall out of the fast zone int our zone and sometimes slow zone lifeforms like us find those things and get into trouble
like advanced tech
so I was thinking maybe a game where you trying to scavange some advanced intelligence tech via a top down from some hostile moon
a top down isometric 3D scene I mean
something idk
still thinking about it, but this game seems way easier to make then where my escape game was going
in terms of the amount of art and animations I'd have to make and the quality at which it would have to be made
and the amount of physics etc
#1248864886772072591 message
^^ that right there I kept doing that and thinking about, what if I was looking for something as part of a game
I think that would be fun, at least for me
"The Ascent" shows that it's possible to make a game like that really nice looking too
I was thinking a strategy game when I read that, but the ascent looks more like a tactics game
I just mean more ascetics
ascetics? you mean aesthetics?
Asceticism is a lifestyle characterized by abstinence from worldly pleasures, often for the purpose of pursuing spiritual goals. Ascetics may withdraw from the world for their practices or continue to be part of their society, but typically adopt a frugal lifestyle, characterised by the renunciation of material possessions and physical pleasures...
so is it gonna be like a strategy game?
like are you gonna have multiple units or do you control one character
Ooh RTS plz!
I had a college semester my grades dipped due to brood wars heh
I stopped playing after that
Did you ever play SC2?
yeh
Let's have a look at how the development of Traction Point went, during the past year. Read more in the development blog at https://www.madrigalgames.com/
The original demo checklist video: https://youtu.be/jJd68MoVkwo
Video recorder: https://youtu.be/zBhhckL5Q4k
Video coded and player: https://youtu.be/cgFCS9t41vU
uninvestigate is so inspiring
!remindme 30 minutes look at dis
Alright gpgpu, I'll remind you in 30 minutes about:
look at dis
steampilled 
a few bits of it are fucky wucky but overall it looks a lot better than I expected
it is a really nice theme
Thats a nice graph at the bottom, what are you using to draw it?
implot
I need to start using that
ok ok last one top down, it's kind of cool I thought
I really like that video 
anyway
time to end this chapter
https://github.com/fstrugar/CDLOD/blob/master/cdlod_paper_latest.pdf
I myself use a variety of cdlod. It's a bit on the older side but works pretty good still
ogldev has a 4 or 5 parter series on terrain lodding with skirts
This is an announcement video for an upcoming series on Terrain Rendering. In this series we will follow along "Focus on 3D Terrain Programming" by Trent Polack. We will develop algorithms for procedurally generated heightmaps, add terrain lighting and texturing, continuous level of detail using geomipmapping and also outdoor effects such as sim...
Oh so I think I can use a single texture array per point light with glFramebufferTextureLayer for shadowmaps
I still have to create multiple framebuffer objects but attach one layer of the texture array and then I can just have one sampler per point light’s shadowmaps
That’s better than what I had
Would be cool to have just use one framebuffer per point light though and reuse for multiple passes but that wasn’t working for me when I tried it
You can also use an atlas instead of a texture array
I have the atlas transform built into the shadow matrix
I see what resolution is your atlas?
do you have any point lights in your game that you're generating shadows for?
the dream would be a single framebuffer with a single texture to generate all the shadows for all the point lights
Right now its used for cascades mostly, so each cascade is 2048x2048 (at default settings, the user can increase or decrease shadow detail) so for 4 cascades you need at least a 4096x4096 atlas (or 2048x8192 if you prefer)
theres potentially a way to further pack things in an atlas that you can't with an array http://the-witness.net/news/2010/04/graphics-tech-shadow-maps-part-2-save-25-texture-memory-and-possibly-much-more/
I may try this in the future
cascades are usually done with directional sunlight and not point lights yes?
I have another suggestion for saving memory
VSM?
perhaps.gif
I mean saving memory is nice, my problem has just been with the ergonomics of having to deal with so many objects, which is fine if that's normal, but I am wondering if I am being inefficient about it
I haven't tried to optmize anything, some scenes load pretty slow because I just serial read big textures and .obj files because I just don't care right now
yes : )
I wouldn't worry about optimizing it just yet
hey zed build on windows for me without errors for the first time ever :O
maybe time to switch editors
geometry shader stuff 
too bad its clangd/clang-tody integration is still shit
It’s zig integration isn’t great either
I had a rather long break from Discord, but I see you've been busy 🚀
Welcome back! Always busy!
a wip
A comet? 🤩
RGB spermlet 😛
I don't think the geometry shader is all that useful tbh
the chapter is using the geometry shader, this scene here I'm just coming up with to see if I can spam a bunch of particles and make them more interesting with the geometry shader idk
I don't want to spend too much time on it, but I have already learned stuff by going off the reserveration like there's 60 max vertex limit for my gpu
I thought I could just spam 1K
yes that was unfortunate, not at all what I was going for lol
hehe
I will put a little bit more effort into it today
otherwise it gives AccumBuffer vibes from the gl legacy ages
There was a time where the geometry shader was the only way to do layered rendering. But we have alternatives now
The driver usually had special code paths for that specific scenario. Because normal geometry shader usage was slow AF
ah, what do you mean by layered rendering?
For example rendering all sides of a cubemaps in a single pass
So you could send in a bunch of geometry and have different bits drawn to different targets
ah the cubemap I render is just in the one rendering pass I have for the whole scene
I mean like without having to bind to different targets
So you can do like an instanced draw call and have each instance appear on a different layer
this is for a color buffer right?
a color target
on a framebuffer
attachment
these names are all still new to me
Could be depth or color it doesn't matter
no I don't think so
you can only have one depth attachment
I would love to be able to MRT depth
how do you do that?
you can only attach one layer at a time
oh well that's good to know, how do I attach multiple?
I couldn't figure out how to do this
I don't want to do 6 passes for a pointlight
This is exactly the motivation
I saw I could attach to a framebuffer one layer with one depth target
when I attach a texture
yes but the glFramebuffer... only accepts one texture and one layer arg
I forget the actual function let me look
I'm on my work computer
glFramebufferTextureLayer
But instead of binding a layer you bind the whole texture
I don't know of a way to do that
would be happy to learn, I was happy enough to just be able to have a single texture with layers but my current method still needs a separate framebuffer per layer each with its own pass
I don't have my code rn so I can't show you, but I think you just call glFrameBufferTexture no layer
The magic happens in the shader
I don't do anything in my shader that's target aware, also how would it know which camera to use?
like my code assumes the camera is per pass
this is very interesting
There's a gl_Layer variable in glsl
oh
It can be assigned in the geometry shader, or more recently in the vertex shader
That defines which layer of the output texture it goes to
oh searching for gl_layer unlocked a lot of knowledge
thank you!
In the geometry language, gl_Layer is used to select a specific layer (or face and layer of cube map) in a multi-layer framebuffer attachment. The actual layer used will come from one of the vertices in the primitive being shaded.
it's usable in the fragment and geometry stage
Learn OpenGL . com provides good and clear modern 3.3+ OpenGL tutorials with clear examples. A great resource to learn modern OpenGL aimed at beginners.
They do cover it in Logl!
I think the vs shader requires a ubiquitous extension
GL_ARB_vertex_shader_layer or something like that
I am really happy that there’s a better way to do this
Chances are if you thought there should be a better way, someone else did too
Luckily this person was john khronos
Good ol johnny K
I have to learn how to do all this in vk soon so just getting a high level gl understanding works for me, I'm honestly more interested in the general sense of how stuff works that's more api agnostic. I got four chapters left in this book and then I'm just going heads down on moving to vk
if it turns out I don't like vk I think I will actually not come back to gl but start using SDL's new gpu
api
which is about as stable as zig is so, perfect for a hobbyiest like me
🤣
sorry I was just sort of talking to myself and I don't really know how stable SDL GPU is
it is very new is all

did you guys know stuff can fall in space
the geometry shader is really slow
I wanted way more particles
some of those particles have a drop velocity close to zero so it creates those columns of particles
idk I was just experimenting, this wasn't in the book
I'm on to new stuff now
I do all the particle simulation in the VS, and use point sprites
these are points that I turned into quads in the geometry shader
instanced draws were ruined by that
you can just use point sprites
how do you send texture coordinates with a point
you get gl_PointCoord
you can rotate and scale that however you like
gl_PointCoord is basically just the UV space of the particle
ah the vulkan spec definese how points are rasterized https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-points-basic
neat
whenever I run into some gl thing I go look at how it's handled in vk since I'm doing that next
I looked at layered rendering in vk yesterday too
I never get a good answer why people use something other than 4.6 unless they're working on a minecraft mod I guess
by good answer, one that I understand and makes sense to me
I don’t understand GL4.6 personally
Also apple doesn’t support 4.6, only supports up to 4.5
Apple doesn't support opengl at all
deprecated means unsupported
it exists because someone hasn't removed it yet
they're just going to pull the rug on it at any moment
it's been deprecated for like 10 years now
they removed the xcode support for it
it's not supported
do you feel supported?
is removing core debugging functionality, putting a big deprecated warning on the docs and building their own API feel like they support it
I also don’t have apple device that is not a phone, so I don’t really care about debugging support 
I only care about is able to run
I wish they would just pull the rug on it
I wonder if minecraft java is the only reason
I wonder if apple GPU devs are on the call with Mojang all the time begging for them to use metal
apple can only run gl 41 natively
gl45 and gl46 are other things via emulaton layers or asahi, but thats not macos
Apple better be making those JNI bindings if they want that
maybe apple will just fund mojang's moltengl bill
should be using UBOs for the most part tho
I just ignore the existence of apple tbh
Metal is a great api, I stand by that
I have no ability to try metal
me neither
I have no doubt, but it may as well not exist, unless I was trying to target iOS
yup
so my approach to vulkan is: finish the vulkan 1.0 programming guide book, read the spec, then using all these pakt books I will try and piece together rebuilding my existing scenes starting with the point and triangle scene, then my procedural geometry mesh scenes (cubes, pyramid, spheres etc), then my obj scene, then shadows, tess and geometry and I should be back where I was
the vulkan memory incoherence and unordered command queue seems like the most challenging thing about the API
and not the apis's verbosity
The spec is like 1500 pages lol I would just read vkguide and port your project to Vulkan in-place
That will teach you most of the practical aspects
I already mostly went over it
Each section has a header I will read carefully
So it’s actually not a lot
I will read vkguide at some point just to review it as part of transitioning my existing scenes
I read through the spirv spec too
mostly because zig has a spirv target and std.gpu
at some point I can just write zig for shader code
and I was wondering how my GLSL would translate and reading through the spirv spec makes it actually pretty clear
like gl_Layer is std.gpu.Layer https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#BuiltIn
zig's spirv target isn't ready for rendering yet though
why not?
because the main compiler dev is just making it work with opencl atm
I guess this is what the spec means by "client api"?
cl, gl, vk and dx are all different client apis?
is this real? directx is going to support spirv?
this is an effort at Microsoft?
lol
this is basically just making directx better
because now you have a better compiler and can accept more shader types
it means less duplicated compiler effort, if they eventually sunset dxc
well they need a good hlsl compiler so nvm
the hlsl to spirv is no good? :(
it does work fine afaik
I wasn't thinking
If they sunset dxil that would be cool though
But their spirv support would need to be very mature first
next week it will be my 1 week anniversary doing game dev daily
looking at the zig server and my github history I started around first week of nov
my first project was an opengl snake game
I didn't know anything
I just made two triangles and copied them and moved them around
to make that game
How come the snake occasionally moves slowly? I'm used to it moving at a constant rate or a slowly increasing rate
it's moving fast because I'm holding the key down to move it
the base speed increases as the snake grows
but at the beginning the snake is too slow so I have a key to make it move fast
so when I get near the food I stop making it move fast
:D thanks
I almost said "your snake" but realized how that would sound
lol
you already figured out the most important thing, aesthetic is #1
I like using a limited palette of colors, and for those sprites I was using aseprite which makes it look 8bit
quite a good looking snake game though tbh
Rosy looking over the bay at San Francisco
Smells a lil smoky over here
#1147711082702589973 message
Not sure if from this or from somewhere else
lol I tried profiling my zero optimized project with intel vtune
you can't even see my code in this
it's all just dear imgui and that's just the menu bar showing
my code is just loading assets
I just load it all serially blocking the whole frame
I kind of like vtune
Yeah lol you have to work pretty hard to make anything slow
fog
I also used a skydome the same color of the fog
hadn't used a skydome before

I'm gonna experiment with something
I have made a lot of stuff in this engine since June, this is just one out of four lists heh
blending
noice, you sort the spheres?
yes
or is that oit? ah
initially unsorted that's why it popped initially 😅
heh
easy to fix
those are instances
instanced draws
I sort the buffer data
those spheres are themselves indexed draws
ok sorted from the start now
idk how to do order independent
I know nothing about oit
I'm just going to have static geometry anyway
maybe some vehicles
with some transparent windows
some water
also static
idk
oh?
this is something I want to understand but have no comprehension of
It uses the parameterized plane equation
An infinite plane can be defined by a surface normal and a distance from origin
4 values
Once you have those 4 values it’s like 3 lines if code
ohh
which order does it come in though?
xyzo or oxyz?
However you want
You take a dot product of the normal and vertex and add the distance
If the result is negative the vertex is clipped I believe
You write the value to the index of the gl_clipdistance array you enabled when drawing
Just wait until next weekend. I'm in the middle of porting all my hlsl shaders to zig
that sounds great!
how'd you find that in the scrollback on this thread? did you search for zig?
I always do 
it's just mostly me spamming this server with zig :P
Also been following this post for a while
you should make a community thread yourself, what are you building? besides working on Mach I guess
Just putting random GP techniques together
that's cool
I don't get enough time to continue it tho. Only keep it up to date time to time
I haven't worked on mach recently either. Maybe more than a year since last contribution
oh
yeah it takes a lot to contribute to other projects I don't do any of that myself
just work on this
Specially when your goals doesn't match 
oh, yeah that's important
I have a few projects I contribute to that aren't my own
looking forward to your next zig thing though, I hope you have time for some zig anyway
I have to work with others for my job, so I really enjoy the peace of having a solo project that I can do whatever I want with
Like just look how sysaudio is bit rotting. Working on Sysgpu was fun but uhh all that effort to build a wgsl compiler. How did I even thought that would be a good idea lol
If I owned those, the state would be very different
that's too bad, it sucks when hard work is tossed
I rolled my own little horizon effect :D (I have no idea what I am doing)
doing something useful with the skydome I guess
3D texture
I did some noise stuff to build a marble 3d texture but is unbelievably slow
So I think I will add yet another zig buildup step so I can just build 3D textures with it and save the bytes to use at runtime
Instead of waiting 15 seconds for the scene to load
I am using stb_perlin
I think runtime noise is not gonna be a thing for me unless I integrate fastnoise2 via a C++ wrapper at some point
I love this take from flut on zig game dev 3 weeks ago about Vulkan #634812978994085888 message
I think about it a lot, and convinced me about my current path
I am not planning on giga barriers or copy pasting an init though
That whole conversation is great
imho you should go with either Vulkan or DX12 and not any of those wrappers like WebGPU and SDL. those are the real waste of time. sure vulkan is verbose but not harder than those apis
Yeah going with Vulkan
It took me a moment to realize rosy’s silhouette wasn’t an anthro, lol
She is very fancy looking in that picture
I really like 3D textures
They are fun
she is
sync is the main thing with vulkan that's annoying
because if you mess up sync, you're going to have all sorts of issues
can confirm that pic
its the approach vkguide uses for a reason
and for what ive been able to see, gigabarrier spam works completely fine because the gpus are going to do a full sync anyway on most stuff
Nice
shit, don't tempt me to try Vulkan again
actually tempted to do both directx and vulkan
have front end just be hundreds of method stubs
yeah I mean dx12
(method stubs are basically just ralux's equivalent of function pointers)
For a hobby project I don't really see the point of DX12
forget vulkan, opengl, and directx. I use cuda and opencl as my graphics pipelines now /s
I am nearly done with this 3D texture stuff, then there’s a water chapter and two ray tracing chapters and I am done with the opengl book and I will be switching then to vk
i would really like to get that srs DLC where you simulate soldiers off time, randomly they follow their dreams and hobbies.... and one of the hobbies is becoming a
frog, working on some graphics engine, with endless battles in #bikeshed
lmao
Is there a way to run graphics in a tty
ofc
how does it work
also let's talk in my thread lol although I appreciate that you used Bjorn's thread to discuss my game lol
tty is at least a screen with a resolution of 80x25 pixels
There’s a zig tui library where someone wrote a doom clone for it so yes
you dither colors into ascii characters 😛
Software Used: https://kronbits.itch.io/pixatool
Follow me on Twitter: https://twitter.com/DavitMasia
Play my games here: https://kronbits.itch.io/
******************* VIDEO INFO *******************
Just playing with this ASCII art converter in my old 3D ...
lol what
srs is demon's project 🙂 shooting range simulator 2023
i keep teasing him with new dlc ideas
we're all actually living in a srs universe sym dlc and don't know it
since I'm just building for a hobby and for myself I am going to just use shader objects I think https://www.khronos.org/blog/you-can-use-vulkan-without-pipelines-today
Pipelines require every desired combination of shaders (all stages when using conventional “monolithic” pipelines, or certain pre-defined combinations of stages when using pipeline libraries) to be compiled together, whereas shader objects allow stages to be compiled in arbitrary combinations, including compiling every shader individually.
With pipelines, linking is an explicit step that creates a new object with its own lifetime that needs to be managed by the application. With shader objects, linking is simply a creation-time promise from the application to the implementation that it will always use certain combinations of shader objects together.
Pipelines must always be linked before being used, whereas linking shader objects is optional.Pipelines allow implementations to require some state to be statically provided at compile time, whereas with shader objects all state is always set dynamically and is independent from shaders.
Pipelines require rendering attachment formats to be specified at pipeline creation time, whereas shader objects don’t. Shader objects can be used with any valid combination of attachment formats supported by the device.
With pipelines, compiled shader code can be retrieved and reused by the application in the form of a pipeline cache, but this data is not usable by itself to create new pipelines. With shader objects, compiled shader code can be retrieved directly from any shader object and is guaranteed to be usable to create an equivalent shader object on any compatible physical device without the need to provide the original SPIR-V.
seems worth it
although maybe renderdoc doesn't support it
fuck
Implemented by Nintendo in #3364 - I believe they will be primarily maintaining it going forwards.
lol
Nintendo?
that's bad ass
that's the freaking last name I expected to see there, lol
renderdoc is amazing though the industry should throw its weight behind it :<
oh yeah I agree but like
I just wasn't expecting to see nintendo of all things there
$ zig build ft3d -freference-trace=11 -- --type striped --output texture3d --name striped.vol
Starting ft3d.
args:
--type ft3d.Args.texture_type_opt.striped
--output texture3d
--name: striped.vol
ft3d finished.
$ ls .\texture3d\
Directory: C:\Users\swart\projects\foundations\texture3d
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 10/27/2024 3:40 PM 67108864 striped.vol
🎉
let's see if actually loads the bytes
hrm
I should probably generate them to the app cache directory
and not commit 64MB 3D textures to github
that means writing a 3D texture loader, but before that I'll just check if they're actually correct by just embedding them
I hope you have LFS configured
I am not going to commit, in fact I'll add a gitignore for .vol :P
probably for all asset types png, gltf obj etc
lol I can't embed these, the stack is 8mb
it works!
now it doesn't take 30 seconds to load the scene any more 
still has to read all that data from disk though I should compress, some other time though
I need to generate a wood texture and a cloud texture and then I'm done with this chapter but before that I have to pay property taxes and carve pumpkins and walk Rosy
I need to add shadows to this scene too
it looks really dark also
is glEnable(GL_FRAMEBUFFER_SRGB) in?
not seeing any bumps hehe
those dark areas are bumps
and they're facing the light direction
the scene was taking 30 seconds to load so I never noticed it before
now it's correct
Where'd the shadows go
I have to add those still
I have to manually add shadows to each scene atm :(
I am going to make shadows generic and just easy for each scene to have
like just each scene needs just a directional light with shadows out of the box
that would actually require rewriting how I load objects in, which I should do
I just want to get through this book honestly
so I can just rewrite it all in vk anyway
Pumpkins carved, taxes paid let me do proper shadows so my scenes just have it
where have I seen that texture before... 
I just wanted some grass :<
hehe
I didn't realize it was the same until you said that
Bjorn can stake his claim to it when his game surpasses yours in maturity
jake will have launched 10 successful games in that time
he'll have a full team of phds in grass rendering working for his studio and won't care about the texture by then
I don't care about the texture now lol
Just thought it was funny we used the same one
it's pretty good
Yeah its from freepbr right?
A pretty decent chunk of my textures are from there
they have a nice viewer too, it's a nice site
A familiar carving on that nearby pumpkin
is this CSM already?
VSM 💪
I don’t what those mean
Oh no
This is just a simple shadow map
Built in a reusable way
I do not have any good system yet
Every new scene is a blank canvas and to add each thing I still have to do a bunch of scaffolding
I don’t know what CSM means but I know what you meant
Making this better is work for after switching to vulkan
Cascaded shadow maps basically larger and larger shadow maps to cover more distant shadows at lower resolution
VSM is doing the same thing but with pages of virtual texture memory
Oh I am not going to get to that until I read more about shadows
I understand point lights shadows quite well now, but cascaded shadow maps for directional parallel light that follows the view frustum using an orthographic projection seems way harder, just even this was a struggle.
It just honestly doesn’t look right even now
I am just missing some key thing. It hasn’t clicked yet
The books all cover shadows in great detail though
It’s all blocked by the vk move and three more chapters in my opengl book
The shadowpass I added is tied to the camera and I added the shadows mvp to the camera ubo and it can update whenever the camera moves at least
I am still manually calling draw commands for individual meshes, this reusable shadowpass is like my first draw a bunch of stuff system
I remember discussing VSM in here before actually
I’ve mentioned it at least once… I think
And jaker has probably talked about it here
wood block
3D texture cloud effect
Nice, how do you get the texture?
I generated it
At load time?
noise
You could forgo the texture and sample simplex noise in your shader
Brainworm level 2: add ray marching
How are you sampling it?
with 3d coordinates
I rotate it the coordinates based delta time and change the depth
it's a technique from the book
it's all in a branch still
Where do the coordinates come from?
the sky dome
Ah, that makes sense
it's hard to link to it
that's it
it's really basic :/
that generates the texture
it's a bit different from the book
they rolled their own perlin noise I just use stb
the one in the book is too slow
yes that makes sense
it's kind of interesting how the sky dome is just a 1 unit radius sphere, and you're just basically walking around with a bubble around your head. I forgot about that, I set an effect to use the sphere's world space x(up) to do a frag shader thing and it changed dramatically as I walked around
maybe I'm just going to make 3d textures from now on
I'm going to use this for a disintegration animation
did you already use your clipping thing to look into these volumes?
oh
just thinking about it makes me crave cake, lol
well the geometry is hollow
I could scale it
if I clip it it doesn't look into it unless I draw a surface where it is clipped
which I could do
scaling would distort I guess
3D textures really cool
it is very cake like
there's actually all the data for the texture that fills the volume
the disintegration is the last part of this chapter
I gotta get through this book
I'm gonna knock it out even though it's 1 am
my sleep schedule has gone to shit
consequences of being on this server
somehow I still have a job
I woke up this morning, well yesterday morning, and had a meeting in my pajamas
zoom camera on lol
My double precision port had me up until 2am for the last 3 days I'm trying to fix mine by going to bed now at the early early hour of 1am
This morning I slept through my alarm and woke up at 11am
sometimes people on my team sleep in and miss morning standup, but I can't, I'm the manager lol
I just, get less sleep 
starting out on a simulating water scene, there is no water yet, just a floor and a skybox. this is just an in progress share
I like seeing my progress
I'll make more progress tomorrow
i like how this checker board is not as plagued by antialiasing as it usually does when a frog starts out with naively rendering a checker board 😛
Nice dissolve
Is it geometry shader?
Skybox reflections are cool too
Acerola has nice videos on water, with references listed in descriptions if I'm not mistaken. May be of help.
Looks to me like vertex hashing to generate alpha, discard fragment if alpha > threshold
Hmm yeah it looks organic, not geometric
Discord compression got the better of me
or alpha < threshold, both ways would work the same if values are configured correctly for the given operator 🤷
or bayesian dithering
the wat
float Bayer_matrix[8][8] = {
{0.0/65.0, 32.0/65.0, 8.0/65.0, 40.0/65.0, 2.0/65.0, 34.0/65.0, 10.0/65.0, 42.0/65.0},
{48.0/65.0, 16.0/65.0, 56.0/65.0, 24.0/65.0, 50.0/65.0, 18.0/65.0, 58.0/65.0, 26.0/65.0},
{12.0/65.0, 44.0/65.0, 4.0/65.0, 36.0/65.0, 14.0/65.0, 46.0/65.0, 6.0/65.0, 38.0/65.0},
{60.0/65.0, 28.0/65.0, 52.0/65.0, 20.0/65.0, 62.0/65.0, 30.0/65.0, 54.0/65.0, 22.0/65.0},
{3.0/65.0, 35.0/65.0, 11.0/65.0, 43.0/65.0, 1.0/65.0, 33.0/65.0, 9.0/65.0, 41.0/65.0},
{51.0/65.0, 19.0/65.0, 59.0/65.0, 27.0/65.0, 49.0/65.0, 17.0/65.0, 57.0/65.0, 25.0/65.0},
{15.0/65.0, 47.0/65.0, 7.0/65.0, 39.0/65.0, 13.0/65.0, 45.0/65.0, 5.0/65.0, 37.0/65.0},
{63.0/65.0, 31.0/65.0, 55.0/65.0, 23.0/65.0, 61.0/65.0, 29.0/65.0, 53.0/65.0, 21.0/65.0}
};
...
uvec2 viewport_pos = uvec2(gl_FragCoord.xy);
if(outFragColor.a <= (Bayer_matrix[viewport_pos.x % BayerMatrixDim][viewport_pos.y % BayerMatrixDim])) discard;
...
Is it like a post-processing kernel, to mask opaque pixels I guess
it provides a dithered transition of textures with alpha
you can see it in action when you load old sponza
and look at ze plant pots
It’s sampling a 3D noise texture and discarding fragments when a float uniform that is time delta is less than the sampled noise
I have no idea why it’s not. I just use a modulus of the interpolated z and y axis values in the frag shader
Was just the first idea I had
I actually see a bit of antialiasing could just be image size
yeah it definitly has but moiree is less obvious than usual, thats good
Oh, yeah. I got rid of that by managing the scale of the tiles. The real fix I think is inverse depth perspective as I believe it is a floating point precision problem?
i have no idea tbh, there are papers and or blogs about it, similar to inifinite grid thingy
The book covered the problem early on where more actual detail than sampled distorts distant textures
i see
More efficient than the checkerboards I make 
It has a nice picture explaining the issue
(I tend to do every square as geometry, because usually I don’t have textures yet when I’m doing a checkerboard and a flat color would be pain because I’m doing stuff with VR)
In this case it’s not a texture, I did my own checkerboard and didn’t follow the example
ah
I can’t do half the stuff in the book due to x up and zig
you can fix that
So frequently have to solve my own way
by switching to c++/c# 😛
and by using a transformation matrix which turns +x up to +z forward
Oh also
Found out recently
Rider has become free without a student license (assuming you have data collection turned on)
So I’ll probably begin using C# more often in the near future ig
their datacollection is purely functional
and yes im aware
all editions are free btw, when you use the early access versions, but they crash quite often
I don’t want to transform my light and model spaces all the time just to follow the examples verbatim and I like coming up with my own solutions
i was just teasing
I have data collection on for IDEA by choice, so I don’t really mind the data collection regardless, lol
been watching marmoset toolbag videos on youtube, going to start watching houdini videos too and then an animation creator too at some point. I think I will be able to create ok custom DCC
switched my label emojis to for textures to be 🖼️ for regular texture, 👤 for a shadow map texture, 🎨 for a color attachment framebuffer texture and ⏬ for a depth attachment texture
:D
there's so many emojis
Wait that actually worked? The emojis in renderdoc thing?
yes it's so great
Lmao wild
that's incredible
This is going in the iceberg @late jackal
What is
This madness
what's an iceberg
2023 seemed fun
I just add stuff to the iceberg every time
It's a historical record of all the insane shit that goes down in this server
I like this server
Me too
I'm sorry but my emojis are so helpful
I am doing nothing wrong, untoward or unlawful
but I had to write a convert quaterion to euler representation to flip my camera ^^ and that may be
ok let's try and sample these textures if it works I will cry if it doesn't I will also cry
Yeah that’s a sin
Especially if you wanna do vr stuff
I have actually used a gimbal locked camera in vr once
Upon entering the gimbal lock, my mind automatically tried following the curve of the gimbal lock causing me to nearly fall off my chair… twice
man, working on a VR game has to be the worst job
in the industry
do they just have to wear the thing all day long
no
my euler conversion accounts for gimbal lock
I'm not rotating using euler angles
I'm just trying to extract the pitch
and it works I think
Was a weird experience
Like I just instantly lost control over my body because my eyes saw the world moving in a weird way
I'm sure there's a better way but this one I can understand
I bet!
:<
I'm not claustrophobic or anything, but I can't wear a VR headset
I could do AR
the game devs have a skill issue if their vr camera can have gimbal lock
VR headsets are obnoxious, yeah
I’ve done VR dev stuff and it is a lot of taking off and putting on the headset, which is really annoying
Trust me, that’s not the problem with vr 
Newer headsets have features to let you see outside of the headset
oh how does that work
The headsets rely on on-board cameras for motion tracking
Might as well add a button to view their image and a feature to do that automatically if the person leaves their play area 🤷
I didn’t really know what a quaternion was at the time 
oh I thought you were referring to a game you played 
btw the gimbal lock issue is a property of euler angles. quats and matrices can represent any rotation, so you just need to construct them correctly
aware
at this point I can get beta minecraft running in VR in like 3 days
which requires weirdly bodging lwjgl 3 into an lwjgl 2 game without updating the lwjgl 2 game to use lwjgl 3

I think the meta quest 3 even has support for AR
… which makes me really disappointed that I only have a 2
quest 2 only has grayscale cameras
I believe quest 3 has color ones
The way the clouds come with you as you move feels bizarre
in the book this scene only lets you go up and down, I have a free moving camera
I think once I add surface waves it will look less weird though
The clouds moving with you is accurate
it probably looks weird because you're expecting more surface variation to convey the motion
so yeah surface waves will help
Clouds also aren't stationary irl ideally they'd be moving
I think what it is
is just,
Object A is clearly behind object B but object B reflects object C, so it then looks like object C is behind object A while also looking like it’s infront
But yeah surf var will prob help
what is object a b and c in this?
the view of the clouds is from a reflected camera beneath the surface
The color does also look a bit weird
I don't think tinting the reflection is the right thing to do
Or if it is not quite so strongly
I also thought it was weird but I had totally forgotten I made water material, the book doesnt' ahve it
I totally had forgotten about the material 
I must blind "there's no tint"
jfc
maybe I shouldn't be graphics programming
yes
The tint is what you'd expect from transmission not reflection that's why it looked weird
Yeah I'm stealing this
I think it is really helpful
I am still figuring out the right emojis
I think in the resource browser the vao being a blue box work but not in the event browser
I think maybe more valuable to have an emoji per object type drawn
Far better 
is this made by a frog https://github.com/DiligentGraphics/DiligentEngine ?
this is cool https://github.com/Caerind/AwesomeCppGameDev
no
i believe it existed before discord.
https://github.com/DiligentGraphics/DiligentEngine/tree/bf128deefa7d51132d2530ee0ec5f80538412671
from 2015, still being actively updated, and I’ve never heard of it
wow
Dude’s username is accurate
so
I had a typing issue in go today that took me a long time to resolve
I had a []byte slice I was passing into a function that took a string
the thing what I read it from called itself a string type, it's complicated go abstraction at my job
anyway this thing was .pem key and was failing to work
I think I had a string, it wasn't, the fix turned out to be to just string() the thing
I hate it
you know zig would just not have compiled
there's no implicit casting at all ever
and a lot of people hate all the manual casting
but I fucking love it

and why didn't the implicit casting do the sting thing? why does an explicit string() behave differently? I don't know and I don't want to read up on it just right now
I am spoiled by zig, I should not write zig, I just expect everything to be as good
I like auto casting in some cases
not all
but when you don't like it, you really really don't like it right
primitive types and hierarchy compatible
also string concat and print statements
... usually I'm not in a scenario outside of that for auto casts though
I see
I don't know what happened to that image when you uploaded it, but I can't read it, it's heavily pixelated
ok I put on some better glasses
it's-
fine on my end
ok it could just be my eyes
🤷 I use minecraft font for ij most of the time on my laptop
my eyes are just better at making sense of the mc font on my laptop than a smooth font for some reason
I got new glasses, but I got them with the blue light blocking and they have an issue I see double with them
so I need to get them replaced
huh
I have a lot of commits that are like "idk"
I pulled the latest zig nightly and just have a ton of build errors
because of this
Hey bjorn, have you ever dealt with meta shapes?
I have read about metaballs
it's in the game math book I think
https://cdn.discordapp.com/attachments/1183993413083865108/1302034686402367488/2024-11-01_18-19-47.mp4?ex=6726a5cb&is=6725544b&hm=becfba349d34955b3908ce9f02c7c4fc274a120c5616bf76ccbb4e6676dd2ead&
would advise fooling with them; actually very nice way to create shapes
(This is sorta just an approximation but it’s still a lot easier to work with than regular brushing in places)
Certainly feels like it could be
Also pretty good for organic shapes
yeah, like alien plants
I think maybe zbrush is good at that
I improved my underwater experience a tiny bit, still a ton of work to do on this scene
Getting there; slowly but surely
this is a college textbook, I bet this used to be the final project
in this version they added 2 chapters for ray t*racing
at the end
they are huge chapters, like 1/4 of the book are just the last two chapters
(*tracing)
but anyway this scene feels like a test of everything the book had been about
oops typo, I meant tracing
I read ray racing and my mind went to racing the beam
that thing that really old video games would do
I just typed faster than my keyboard can handle sometimes
hrm
this needs to be better
still a lot more to do
I am going to timebox this scene to this weekend, even if I don't get it perfect. I can't spend forever on it, I'm not getting any medals or awards for getting it just perfect
I clearly still have learning gaps I need to fill
there's still a bunch to do though on it
I am watching these houdini and marmoset youtube playlists whenever I have time https://www.youtube.com/playlist?list=PLhyeWJ40aDkUDHDOhZQ2UkCfNiQj7hS5W https://www.youtube.com/playlist?list=PLDnx_izeQbePhgnSVHRFpPzVPcpV8Tr52
houdini's ui is so ugly
ya
ive seen it in a few videos, never used it myself
I watched a bunch of videos where people have made amazing things in just a tiny bit of time
so that's why it's appealing to me
yeah
and marmoset toolbag's ability to generate normal, bump, texture colors and height maps with a brush and built in easy baking is also really neat and makes sense to me, whereas I often feel lost in blender
baking in blender feels cumbersome, but i also only done it twice
I like these more specialized tools in addition to using blender
they are also affordable imo
like I would love to use adobe cloud but I can't justify the expense
it costs way too much
but a couple hundred dollars for tools I plan to use all the time I am willing to pay that idk
yeah
i pay for the full jetbrains suite, i think its worth the money, and its good stuff
I used to
I think for desktop application software intellij is great, if you want to work on remote servers it really falls flat and I can't use it for that
so I stopped paying
ah i have no reason to write code or compile shit remotely
my job requires it
i write it locally, and have it deployed via cicd
I can't run our dev env locally, it's a full kubernetes cluster
I am going to switch to zed
for my editing
now that it compiles on windows
vscode has ssh/docker/wsl capabilities too
yeah I use vs code for work, it's very good
I use vs code for everything right now
zed is getting remote ssh too, but it's in beta and didn't work well last time I tried it
personally i think zed is a waste of time, but its written in rust so everyone is flocking to it 🙂
I just want software that isn't running in a browser 
vscode is very optimized and backed by a multibillion dollhair company
although they seem to push this copilot bs quite a bit now
yeah I don't have any performance issues with vs code
if I don't think zed is good I can just go back
Im going to try and attach visual studio to my running executable to see if I can use it to monitor memory usage
it's the one thing I haven't figured out yet
a good tool to spot memory leaks and usage
you are on windows neh?
yes
when are you moving to arch? 🙂
like demon, he does it for the cool valve looking uisms 😄
hehe
It should be comfortable enough to dev on though
It's not completely trivial to get things working cross platform
It's the programming toolchain
its quite simple on windows actually, to get a whole linux chain going, including X11 if you want window-windows
ah yeah that's true
I would just use an old laptop and make a native install though
I liked xfce and windowless managers when I was using linux
yeah
xfce is what i fly too
ah alright
it's been awhile, last time I had a linux desktop was in 2007 and it was slackware
jfc visual studio takes forever to update
also it's confusing that some things are nu packages, and other things are visual studio installer updates
it's weird
actually there is the visual studio installer packages, the visual studio extension system, and then nu package manager
instead of there just being one thing there's three
I guess I get a package system being different, that's more project dependencies and not part of the ide
but that's mitigated by visual studio installation changes being needed to build projects, so they are project dependencies though
that gives me nightmares
i have a work laptop for the shop i work for atm
took a good 15 minutes
and its locked down with some BeyondTrust bs root kit
whenever i want to update VS, i have to enter my credentials, n amount of times vs uninstalls all packages and then n amount of times it installs all those vs packages. its ~350-400 times
yeah I have to use a yubikey to do stuff on my work macbook
I have a locked down macbook, and then even more locked down chromebook for access to production systems
yeah
and I have to carry both around with me all the time
it does make sense but it also doesnt make any sense at the same time
I hate that chromebook
but access to production system is hardware linked + yubikey + my credentials
the joy of working at a security company
all the banks i had access too 😄
