#GrubStomper29's OpenGL Sandbox
1 messages · Page 4 of 1
these are always cool to look at
probably has something to do with padding
I HATE PADDING
You can derive frustum culling yourself
wdym
its a simple math problem
im good
It's a good bite-sized math problem for a budding graphics programmer
And there are many valid ways to solve it
i suppose
regardless
i think I have found my problem
uint transformIndex;
int materialIndex;
uint indexCount;
uint firstIndex;
int vertexOffset;
vec3 boundingCenter;
float boundingRadius;```
I think this is a bad memory layout
uint transformIndex;
int materialIndex;
uint indexCount;
uint firstIndex;
int vertexOffset;
int padding0;
int padding1;
vec3 boundingCenter;
float boundingRadius;
I added some padding and it looks a little less munted
but still munted nonetheless, so I imagine theres more layout issues
this is an array of structs, let me check struct/array alignment
or because I'm doing my math wrong 💀
i shouldnt need padding1, only padding0
"If the member is a structure, the base alignment of the structure is N, where
N is the largest base alignment value of any of its members, and rounded
up to the base alignment of a vec4. The individual members of this substructure are then assigned offsets by applying this set of rules recursively,
where the base offset of the first member of the sub-structure is equal to the
aligned offset of the structure. The structure may have padding at the end;
the base offset of the member following the sub-structure is rounded up to
the next multiple of the base alignment of the structure."
well id like to understand first
I believe the padding for an individual struct is fine, but it falls apart in an array of structs
this is what I have so far
{
uint transformIndex;
int materialIndex;
uint indexCount;
uint firstIndex;
int vertexOffset;
int padding0;
vec3 boundingCenter;
float boundingRadius;
};```
this should work
{
vec3 boundingCenter;
float boundingRadius;
uint transformIndex;
int materialIndex;
uint indexCount;
uint firstIndex;
int vertexOffset;
};```
but why
just because
you could put padding between boundingCenter and boundingRadius it would work
try it and see
Haven't you heard the saying, "give a man a fish and he'll eat for a day. Teach a man to fish and he'll eat for life?"
last time I touched alignment is 3 years
basically you want order types by their size so vec4 is first and vec3s is pain you need to put int/float in between so it can satisfy the vec4 alignment
and vec2s are fine
and scalars too
I see
and matricies are fun too
heres a tree of clocks
💀
it did in fact not work
so switching to vulkan for scalar layout when?
after the suicide
I think you are missing one more uint to complete it
this is std430 btw
Do vec4 + two uvec4 and stop having problems
wait
you are maybe correct
god I love scalar layout
pretty sure, yeah
but not vec3s!
on second thought, the array part is fine, something else must be wrong
@kind sparrow how cooked am I
Vec3 + float is okay I guess
I would imagine that
plus the additional 5 scalars
something still isnt adding up
Dumb people gamble on money, smart people gamble on memory layout
Shuffle until it works
thats 100% fine
NOT something I want to see
weird
with/without the extra components shows the same data in nsight
however with the data in, I get this result
I wonder what's wrong
Looks like fucked up indices idk
obviously but I need to figure out why
yeah, the only real difference now is the size of the cluster struct
could C++ have some implicit padding we havent thought of?
wouldnt say so
issue is going to be 100% shaders
do you have same struct def in c++ and glsl
yes
🫡
I dont understand how; NSight says the data is fine there
then some indexing stuff
try a simpler mesh
Alignment is easy you just look at the buffer in renderdoc and if RD misinterprets the data then so will GL
Oh I see it looks ok
Idk then
Is this Vulkan or GL
std430 everything is aligned to a vec4 basically
I wouldn't trust vec3s at all
I would put the scalar into the 4th component of a vec4
And then pad the whole struct to a multiple of 16B
I'm pretty sure GL will implicitly pad a vec3 to a vec4 so you can't rely on fitting a scalar into that hole
GL
ill have to try that
maybe nsight buffer readings are misleading
if representing a sphere with a vec4, it makes most sense for the radius to be the last component, correct?
Yeah
I have no idea
my pal moochoie12 drew it
its clearly not GrubStomper29, so ig it would be his son GrubStomper30
about home defense from an HOA invasion
its all coming together now
HOA Invasion Stomper
would that be bad on a resume lol
Call it "untitled game project (2025)"
“2week box”
The bug is fixed, I was only updating the cluster struct in the compute shader and not the other shaders that use it
I should really look into glsl header file equivelants
anyways the bug is fixed
now I have to figure out frustum culling, and demon has unfortunately inspired me to do it on my own
"stb include"
I've been using string_cast for quite some time and am just now getting this error?
target_compile_definitions(HowToScript
PRIVATE GLM_FORCE_CXX2A
PRIVATE GLM_FORCE_RADIANS
PRIVATE GLM_FORCE_DEPTH_ZERO_TO_ONE
PRIVATE GLM_FORCE_RIGHT_HANDED
PRIVATE GLM_FORCE_SILENT_WARNINGS
PRIVATE GLM_FORCE_SWIZZLE
PRIVATE GLM_FORCE_XYZW_ONLY
PRIVATE GLM_ENABLE_EXPERIMENTAL
)
``` 😛
Slightly working frustum culling (viewFrustum is paused here)
It does have issues
updates via pointer are considered non direct I guess
I see
I wonder what in the world could be causing this bug
anyways heres a video of it
any ideas guys
todo: test first cluster skip
Maybe fucked up hitboxes and your frustum thinks that you are not looking at bistro
maybe but im not using a hierarchy
im just testing for each meshlet for now
The batcher has no problem omitting meshlets, so its not an offset or indexing problem
it must be a calculation error
All the plane distances become positive when everything disappears
I still ahven't found out why this occurs
it only seems to happen to the top plane
SOS
the program now functions. I must never touch it again
there must be a better way
Abstract away like bindssbo to make it shorter
shame that bindless buffers is not vendor agnostic
#general message
but its so… unordered
Looks extremely ordered to me
i see
Alright its time for occlusion culling
lemme write out a little plan
FIRST BATCH PASS
Using the visibility bitmask, batch meshlets that were visible last frame
generate depth pyramid from these
SECOND BATCH PASS
if meshlet was visible last frame, update its visibility and return
otherwise, update visibility and batch if visible
bevy used a different method for knowing if a meshlet was visible last frame, because a bitmask "does not play well with LODs." I'm not doing LODs
It used a bitmask initially, before I added LODs.
I just keep the list of visible stuff
I think there was also a memory concern
but I imagine without LOD trees, I should be fine
Yeah, besides it not working with LODs, it used a decent amount of memory. It's not a ton though, 1 bit/meshlet is fine really.
lpotrick
richer or potrick maybe
yeah
are hiz tests only possible with AABBs?
i wouldn't mind using spheres, but iirc projecting spheres sucks
hmm
Spheres are easier than AABBs iirc, but you can do either
i see
When working with various forms of culling, it can be useful to project the object bounds to screen space. This is necessary to implement various forms of occlusion culling when using a depth pyramid, or to be able to reject objects or clusters that don’t contribute to any pixels. The same operation can also be used for level of detail selection...
Just keep in mind for occlusion culling you want to convert from UV to pixel coordinates
I hate coordinate systems
so I imagine that bitmask buffer is gonna be like ceil(meshletCount / 8.0f)
well I'm talking about the size in bytes
👍
nvm squid game 2 is out
I seek advice, oh wise ones
version control
purpose of multiple repo branches?
consistency of pushes?
strategies?
feel free to info dump
I'm shit at VCing assets
I don't have a good answer there
I make branches just to organize work into named segments, even if you're developing them in serial
"Oh i saw this really niche but cool feature.Idk if i want it in my project, but i might reconsider in the future.Lets implement it and check if it fits"
I push relatively infrequently (once I have a feature working, or at least compiling), maybe once a day or sometimes less often
Typically you want a commit to be a working version of the program, although that's a flexible standard
i push about once every other month
I always work on a branch
And then I just merge to master when that feature is done before making my next branch
The biggest benefit of VC is being unafraid to rip shit up and rewrite it
If you ever find yourself worrying that you might break something and have trouble fixing it you should commit
That's how I can just tear up 1000 loc and rewrite 3/4 of it without fear
that’s smart
i also want everything to compile on other peoples systems and need a good way to test this
Buy a beater laptop on craigslist and put ubuntu on it
dual boot
im probably sticking with visual c++ for builds, so it must be windows
Nah you want different HW
I was replying to lumberjack, if you're targeting windows only I wouldn't worry too much
But it would still be worthwhile to have a machine with a different GPU vendor
joking though; it struggles to run even the os
Dont think it will run opengl, imho its easier to have a vm
i might duel boot windows on a separate hard drive
even a crappy laptop is gonna be expensive if im just using it to test builds
i can probably crowdsource my testing
i would suggest a dedicated separate hard drive yeah, be it hdd or ssd or nvme doesnt matter
and then you use the boot menu of your bios to select the drive to boot from
that way you keep both drives separated and neither windows nor lunix will install any shit on the other drive
Yes you can
Many here have done so with great success
Same
that would be awesome
if you make it cmake compliant we can figure out other platforms too as well
perhaps
I didnt know Defend Your Home from the HOA would have such a wide playerbase : )
Ofc
I push every change that I do. In middle of the change I do git stash. Also I am planning to have branch from which I will cherry pick commits to master.
as long as you commit things you will be fine
keep them small and commit often if possible
that makes cherry picking or cleaning up even merge conflicts easier to deal with by a lot
I use one branch per feature/thing I'm working on, forking off of whatever the latest bevy main commit is. I push either once at the end of my programming session when prototyping stuff, or once per set of changes for more incremental stuff where I have stuff I want to save before moving onto the next part of the change.
But no hard rules, I often branch off of my branches and make random commits as I feel like it
My only real advice is don't use a single branch to develop every change, especially if you're working with multiple people and not just yourself
biggest problem i forsee is finding people for facial scans
maybe i can get hi res ones online and modify them a bit for the game artstyle
i also wouldnt mind a game in that hand drawn pencil style like that piece of art from the other day
unfortunately i already have a vision for this game
but that is something to consider for future projects
Stomping Grubs Simulator (SGS) will be my magnum opus and thus I cannot begin work on it until I master my craft
I might write my own depth buffer downsampler
You were right; I forgot glsl doesnt have 8 bit types
ill have to round it up to the nearest multiple of 32
im good
so my bitmask is an array of 32 bit uints
uint n = clusterId - i * 32; // get index within the 32 bit data
uint bits = 1 << n; // get bitmask for this cluster
if (!(visibilityBitmask[i] & bits)) // do bitwise AND against this cluster's bitmask
{
// cluster is not visible
}```
This is the code I have for testing the visibility
this is really the first code ive written alone for bitwise operations, so I am a little unsure if it works
it should work I think
i also think
Failed a shoulder roll one too many times
I think ill buy a rubber saa replica to keep the weight up but withstand more impacts
i was picturing you participating at those quick draw competitions with that old revolver thingy
nah im purely interested in cosplaying as this guy for holloween
Donald McDualWield
i tried mg1 once, for 10mins or so, i think mg is utterly boring
yeah, i am quite lame
you gotta have the patience to sneak around
i did in The Thief 🙂 and Hitman, that was enough
give it another shot
the first hour of any metal gear game is admittedly hard to choke down
that jungle scene annoyed me
it sounds like you were playing the third one?
that one probably has the longest intro
start with mgs1
nah
: (
the top downyness and switching to weird camera angles is not mine
@night shoal maybe youll like Cave Story
free 2004 Indie game by Diasuke Amaya who also made the game engine, music creation software, and even a rudimentary scripting language for the cutscenes
The bitmask batching works
I can do cool stuff like clearing it to 01010101 to omit every other cluster
right now im focused on just getting culling working, but later down the line im probably going to have to do some sync work
or at the very least giving batches some of their own buffers so im not dispatching, clearing, dispatching, clearing, etc.
in other news its snowing really hard here but burger king is NOT closing so ill still be going to work tonight
guarauntee you we'll make less than 20 sales tonight
Vulkán when
2 years ago
hi-z time 😦
@spring kelp you seem to be online right now. Would it be correct to assume I need the full mip chain for occlusion culling?
I mean you don't have to, but there's no reason not to
Just make sure to clamp your calculated mip level to the actual range of mips your hiz texture has
Can you elaborate on this please?
also, what aproach do you use for the power of two problem?
If your mip map has 10 mips, make sure whatever mip level your culling shader calculates to use is clamped to [0, 10)
so that -1 or 11 become 0 and 10
I don't, it's broken atm. But the plan is to copy granite's HiZ shader, which is a modified SPD https://github.com/Themaister/Granite/blob/master/assets/shaders/post/hiz.comp
I took a quick glance at AMD's SPD and it only support's vk/dx12
are SPDs using newer API features or do they just skip GL because no one uses it anymore?
Uhh does GL have subgroup support?
Not sure
Now that I think about it, I have no idea how SPDs work
it may benefit me to create a working prototype with one pass per mip
But I'm scared that any ^2 solution will make sampling the mip chain super complex
My app is now properly synced. I'd like to take a moment to talk about how weird fences are on OpenGL
you can't reuse them, yet still are responsible for handling their deletion
glClientWaitSync has a timeout parameter detailing how long the client can wait before moving on
glWaitSync also has this parameter, but it must be set to GL_TIMEOUT_IGNORED
Idk it kinda makes sense
The fence is just an event in the GPU timeline, it could be waited on at any time without being signaled so it can't be automatically deleted
The API needs to keep track of some pool of flags to check so having them be explicitly managed isn't too surprising
I suppose
A sailor’s worst enemy is himself when the siren sings
depth texture should probably be clamp to edge
idk why what is essentially mipmap generation is such a hard problem for me
heres a plan:
Create texture with appropriate storage for mip levels
Copy depth buffer to base mip level
For each mip level:
Bind appropriate mip level for writing
Dispatch compute to write (using imageStore) maximum depth values of last level to current level; handle edges and corner for NPOT last level
Complication—you can't bind a texture for both FBO output and shader sampling simultaneously; I need a workaround that lets me read the last level to write to the current one
My first thought is to use a separate FBO output texture and copy its contents into each respective level, but that sounds very slow
or I could use imageStore I was not aware this function existed
I have read the word "depth" too much
The down sampler compiles and runs for a single mip level
I still need to test its functionality before going down the full mip chain
I wonder if its worth it to try and slam in multiple shader invocations per workgroup for something like this
only time will tell
hiZ gen is wrong
as you can see from this depth buffer visualization
imageStore is doing nothing
perhaps because I was using GL_DEPTH_COMPONENT32F as my image format? I wonder why that would stop it from working
most of it is in place
I just need to perform the actual AABB test
saving for later
Numbers 12:3 “Now Moses was a very humble man , more humble than anyone else on the face of the earth.”
This is really funny lol
There's no textureGatherLod() in GLSL 😞
anyways the occlusion culling is completely failing
it's my sphere projection that's failing 
Every single bounding sphere fails !(C.z < r + znear) and I can't figure out why
maybe my view space is -Z forward somehow?
but that doesnt make sense
or does it
as far as i can tell, viewspace is -Z forward and glm::perspective flips the Z coordinate
alright for my sanity I need to linearize my hzb
i think
im stuck in coordinate system hell
@junior sparrow a few questions: do you linearize your hzb?
do you have any tips for debugging occlusion culling?
I dont linearize hzb or depth
I am using infinite reverse depth
and about debugging I can from gpu create AABB for debugging
wdym
I can visualize the meshlets bounds which are not getting culled, etc..
i see
i think i just need to write my own hzb sampling code
im pretty my viewspace is -Z forward, +X right, +Y up
the hzb is in texel space with (0,0) being the bottom left
depth is non-linearized
my plan is: get the projected AABB bounds of the bounding sphere use it to figure out where I need to sample on the hzb get the nonlinearized min depth of the sphere compare that against the hzb depths
i imagine the flickering issue is related to texelFetching the hzb without any bounds checks
that or my texel coord calculation sucks
anyways this is confirmed
vec4 depths;
depths.x = texelFetch(hiZ, coords, level).x;
depths.y = texelFetchOffset(hiZ, coords, level, ivec2(1, 0)).x;
depths.z = texelFetchOffset(hiZ, coords, level, ivec2(1, 1)).x;
depths.w = texelFetchOffset(hiZ, coords, level, ivec2(0, 1)).x;
this is what I'm doing
i wonder if implementing bounds checks here could cause performance issues
ill worry about that later
bounds checking did resolve most issues
still some odd flickering issues
I wonder what the issue is this time
🤨
I assume that hardware does some bound checks
not for texelFetch
I'm not using texture() because I don't think ogl has that min sampler extension and if it does I was too lazy to check
so here I just clamp it to the edge
huh intersting
Do you add any sort of padding to your bounding geometry to resolve floating point errors?
its really bad when I fly under the map
I do lpotrick trick where hiz is in image which is power of 2
which type of perspective matrix do you use?
normal one or some infinite reverse
normal
float sphereDepth = (1.0f / -(sphere.z + sphere.w) - 1.0f / zNear) / (1.0f / 10000.0f - 1.0f / zNear);
I recommend you switching
why
better precission
does glm have a projection function for infinite reverse?
I think so but I have my own
GLM_FORCE_DEPTH_ZERO_TO_ONE
and glm::infiniteXXX
or without the define and glm::infiniteXXX_ZO
vec4 depths;
depths.x = sampleHiZ(coords, level);
depths.y = sampleHiZ(coords + ivec2(1, 0), level);
depths.z = sampleHiZ(coords + ivec2(1, 1), level);
depths.w = sampleHiZ(coords + ivec2(0, 1), level);
float depth = min(min(depths.x, depths.y), min(depths.z, depths.w));```
I wonder if my texel reading is bad again
i just take the bottom left of the sphere's projected AABB, and read a square of texels there
@junior sparrow it's fully functional
vec2 coords = ivec2(((aabb.xy + aabb.zw) * 0.5f) * vec2(textureSize(hiZ, level)));
vec4 depths;
depths.x = sampleHiZ(ivec2(coords), level);
depths.y = sampleHiZ(ivec2(coords + vec2(1.0f, 0.0f)), level);
depths.z = sampleHiZ(ivec2(coords + vec2(1.0f, 1.0f)), level);
depths.w = sampleHiZ(ivec2(coords + vec2(0.0f, 1.0f)), level);```
I changed my coord calc to this, I believe it's similar to what vkguide does
I also ceil my mip level calc
bistro now mostly renders at 2-3ms but peaks at 5 with busier frames
I think I can shave this down given the unoptimized state of my code
all of my compute shaders have a 1x1x1 local size
💀
Nice
I wonder why I need to ceil the level calc
regardless, now that it works i must never lay a finger on it again
Because you round up taking the worst case scenario
That's my understanding
probably
corrected to bistro. I should probably try sponza too
Silly me! I'm running perf tests in debug!
that shouldnt change that much
changing the hi-z gen local size from 1x1x1 to 32x1x1 brought hi-z gen from ~0.8ms down to ~0.2ms
what gpu are you running?
I dont see anything wrong
@kind sparrow you were right; i shouldve tried occlusion culling on cpu first
debugging the compute shader is 30% guesswork
and as you might’ve seen, the bugs are driving me insane
you dont have hot reloading of shaders?
i do but its still not as good as break points and reading data memory
Same
I am trying to figure out the ideal methodology
I've been stalling on my foliage stuff which is similar all month
yeah
i feel as if im so close
i just need a solid hi z sampling method
i highly doubt this is floating point error and im 99% sure my sphere projection and hzb gen is sound
i just realized i call it hiZ in my code and not hzb lol
The reason mine is so impossible is because the intermediates are all stochastic
Every frame the data is a different order in the buffers
if by similar you’re saying it’s related to culling, that blog post can help
It's not culling but it's also a complex compute algorithm
It's like a 5-stage pipeline full of atomic buffer filling so there are a lot of potential points of failure

good luck lol
If I come up with any good methodology for debugging I'll let you know
Mine probably requires a different approach to yours though
Isn't yours just basically building a mip chain but with maximal instead of mean values
Mine struggle is looking for off-by-one errors in hundreds of megabytes worth of partially filled allocations
thats the working part
what im struggling with is actually testing against this
Ah
my cs teacher just dropped the biggest project on us with one day to complete it
these projects usually take 3-4 days to complete
what is it? 
some cybersecurity forensic stuff
worst part is no one else has uploaded a guide online 😭 (aside from paid sites)
and this project counts as the final, being worth 20% of the grade
What's it about?
nvm i think shes canceling this
Save it
She will probably give it to you later with minor changes, you will have more time to prepare
nah the semester practically ends today
i wonder why its this specific meshlet having trouble with the culling
and this one
okay
@junior sparrow
i THINK its fixed
but the fix makes absolutely no sense to me
I just +1 my mip level calc
int level = int(ceil(log2(max(width, height)))) + 1;
ig it doesnt matter if it works 100%; as long as it does a good amount of culling and has no visible artifacts then its good enough for this project
once i get past optimizing the unoptimized, I will finally get to do what ive been meaning to do for a few years at this point: physics based lighting
and shadows and gi and hdr and such and so forth
cascade shadows + some brdf + indirect light maps + retinal based post = grubstomper photorealism
we’ll make it
Interesting observation
local size (64, 1, 1) occluder batching compute shader is about 2-3 times faster than (4, 4, 4)
and there seems to be little gain using (64, 1, 1) compared to (1, 1, 1)
this might be related to branching
depth downsampling showed significant improvements when local size was increased, and its branching is uniform across all invocations
it could also be all the atomic writes
changed my lighting parameters and its a lot nicer looking now
it looks fresher indeed
the old lambertian diffuse I used stretched the dot product over the sphere and NOT the hemisphere
the idea was for more lighting depth, but it's not physically accurate so it had to go
I think for shadow mapping I'll need that "multiview" thing mentioned in the nanite talk
rather than batch for shadows then batch for the camera, I should batch for both simultaneously
This doesn't seem trivial for shadow cascades since I'll have like 5 different views to batch for
perhaps i perform the batching without culling first and figure it out later
todo: commit changes
developments probably gonna slow down since i made a minecraft world
todo: zorp my flongle
Any progress on the guitar learning?
havent picked it up yet
i do have free time, but it must be budgeted and that’s a little low on the list
Just pick it up and learn 3 chords. You can do alot with that
a lot of garbage
i have my eyes set on the songs i want to learn
i just need to get around to it
which is the hardest part 
Those dave matthews songs are pretty challenging ngl
so ive heard
it would be kinda like what i did with drums
i got a lot better by just picking a really hard song (#41 from under the table and dreaming) and learning that on drums
granted, it took about 2 years to do
I mean you might wanna learn some basics before jumping right in to the hard shit but it's up to you
probably
Did you ever learn any Rush songs when you were doing drums
nah i dont like rush
filthy closed hand drumming
idk if its unhealthy, but im really only interested in the drumming of Carter Beauford
Ever listen to phish?
Phish with Dave Matthews (guesting)
February 24, 2022
Riviera Maya, Mexico
Full Guest Set
0:00 So Damn Lucky (Dave Matthews Original)
5:44 The Maker (DANIEL LANOIS Cover, Often played by Dave Matthews)
10:40 Tweezer Reprise
This channel is not monetized.
This is a free video for fans of Dave Matthews and/or Phish. If you enjoy the music ple...
i also need to give the police a listen
but part of the reason i like dmb so much is because of how much they solo
some of my favorite songs are them going nuts for 15-30 minutes
Oh man you would love phish
ill check them out
Provided to YouTube by Rhino
You Enjoy Myself (Live at Madison Square Garden, New Year's Eve 1995) · Phish
Live at Madison Square Garden New Year's Eve 1995
℗ 2005 Phish Associates
Drums: Jon Fishman
Producer: Jon Fishman
Backing Vocals: Jon Fishman
Bass Guitar: Mike Gordon
Producer: Mike Gordon
Backing Vocals: Mike Gordon
Keyboards: Page...
25 minutes of jam
Will do
Pretty good yeah
i also need to look at the flecktones
Bela Fleck?
Wooten is goated yeah
I fell off guitar as a kid because chords and chord changes sucked
if you ever get tired of those you should learn shedding fundamentals and just play fast riffs
that's about all I know how to do on a guitar
For the first 3 years of my guitar career I basically just played tremolo picking power cords on black/death metal stuff
Yeah theres many different approaches you can take
That was the easy path for me since I played the drums so I already had the rhythm and muscle control for trem picking but didn't know shit about chords
this was pretty good
except for the chanting at the end
man i’m lazy
i’m starting to notice a pattern
if i’m in the middle of implementing a feature, i won’t procrastinate
but if i haven’t started any feature, i will procrastinate
first i need to do this, then implement multiview to my culling
i think i’ll just spawn one thread per cluster per view
then its just simple csm from there
I thought i would finally be able to write some lighting code but it’s back to this cluster batching shader 😔
You mean one thread per casacade?
I haven't figured out how to do multiview for the hardware raster pass, yet
No
meshlet instances times number of views
number of views does include each frustum
if thats what youre asking
every day i thank my past self for having the insight to not implement lods and sw raster
sounds like hell!
is there a reason this is so vague???
With synchronous debug output it'll trap right when the bad call happens
Once you know what API call triggered the error, you can look it up in the spec and it'll tell you what that error means for that call
Probably mixed up the enums passed for texture creation
ah I can't use GL_DEPTH_COMPONENT for my shadow map?
but GL_DEPTH_COMPONENT32F works fine
auto OnOpenGLDebugMessage(
[[maybe_unused]] uint32_t source,
uint32_t type,
[[maybe_unused]] uint32_t id,
[[maybe_unused]] uint32_t severity,
[[maybe_unused]] int32_t length,
const char* message,
[[maybe_unused]] const void* userParam) -> void {
if (type == GL_DEBUG_TYPE_ERROR) {
spdlog::error(message); // or std::print or std::cout or whatever
debug_break(); // or just put a bp in the line above
}
}
glDebugMessageCallback(OnOpenGLDebugMessage, nullptr);
glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
oh 💀
beacuase that's not an image format
🙂
ill see if i can work this into a compiling state so you all can try this technological masterpiece
windows only btw
do you all keep a “common” includes header for, of course, common includes you need?
also for when you #define something you’ll need everywhere
Not really
But you could
Nothing intrinsically wrong with it
Usually you don't need anything absolutely everywhere though except for defines, which you can handle in your cmake script
What are you using now?
Yeah me, bjorn & anicator are raw dogging msbuild too 
You can cross compile with msbuild for some platforms though
I remember I made an android app using msbuild once
Oh yeah it is
my code feels more portable
I don't like having to regenerate the solution all the time though
huh?
I wonder if there's some way to create cmake from a visual studio project though
it’ll probably be terrible
if it does exist
Yeah likely
i still have to figure out working directories
the working directory people use when they launch my executable will affect the paths to assets
ive wondered how other applications handle that
They just start in their install dir
the application itself sets it?
Usually you launch an app from a shortcut or something
Unless you intend people to launch your thing from the command line
You can put your global defines in your VS just the same
I just used cmake as an example
I need to consider manual backface culling
i completely forgot about individual triangle culling
@spring kelp do you do this in your batching?
i imagine I would need to perform the culling before the atomicadd and index buffer writes, which sounds nasty
pretty sure triangle culling is done in mesh shaders
I don't. Although with software raster I could. With hardware raster you need to either use mesh shaders, or write out a new index buffer.
Alright. I’m not doing that.
it was my understanding that mesh shaders kinda suck?
or do they just kinda suck for the meshlet cull batching
they might suck for culling but you can do culling in compute shader and then use mesh shaders
visual studio randomly decides to start building "OpenGL-Sandbox/Debug/x64" instead of "Debug/x64"? huh?
quite some time ago apparently
thats not something i understand!
You can change all those paths to whatever you want
its all in the project settings
move to cmake for God's sake
yeah I just mostly did; now only log files appear there
perhaps you switched to "Release"
and forgot to config "Release" at the start, its output is still default
nah i was on debug when it happened
ah
its all tlog stuff
yeah vs shit
it doesnt make sense to have OpenGL-Sandbox/OpenGL-Sandbox in my opinion
i must put a stop to this
close vs, delete it, open vs again see if its still there
yeah it is
its probably some setting i cant find
actually theres a ton of objs too
definitely some build output residue
yep im smart
alright we MIGHT be golden
back when i used vs exclusively with cpopo i set it out to Build\Bin and imtermediateisms to Build\Temp for both configs from le start
perchance
$(SolutionDir)Build/$(ProjectDir)Bin/
$(SolutionDir)Build/$(ProjectDir)Temp/
yeah
platform is 64bit at all times anyway and if you want you can add $(Configuration) in there too for "Debug" and "Release" in the path/name
all my third parties seem to be inside the project dir, so I don't need to deal with external linkage junk
I think you guys can finally play this
deccer, are you on binbows
not in this moment
oh okay
well if any windows user would like to give it a quick go, have at it
github desktop is elite
it used to be quite dogshit
and i never tried it again, fork, sourcetree even, and builtin git clients in all jetbrains tools are superior already next to git cli
What if I wanna compile for ARM?
Not that I do, but you technically can
then you could reintroduce $(Platform) 🙂
or you keep using that from the start
what always pissed me off in vs' configuration editor, i removed Win32 from the start, but as soon as you added a new project it was reintroduced back into the solution file, because the new project had it by default
the only true solution (when using vs only) are props files, but they are messy for c++ imho
cmake makes this much less painfullier
lol i hated cmake back then so much because it would always destroy my neat folder/solution structure for projects XD
Languages not having a standardized build tool is insane to me
C++ & C are languages I think it makes sense for
There are 3 different major C++ compilers (which is a good thing)
I'm cloning your thing btw
have you considered using submodules for your third party libs?
1>(compiling source file 'src/main.cpp')```
first issue
Yup
you should make this relative to $(SolutionDir)
I changed to
I have no explanation for that
mPos += getRotationMatrix() * glm::vec4{ displacement, 0.0f };
its this
pos is a vec3
thats weird that it compiles fine for me
mPos += glm::vec3(getRotationMatrix() * glm::vec4{ displacement, 0.0f });
this fixes that
it might have something to do with visual studio C++ extensions or something
I got the thing compiled, now I'm getting a crash on launch
looks like in asset loading
no aasets are checked in in case there are any
let me see
no need
Yeah the path is wrong
its because of a gitignore in the assets folder
its hardcoded to load bistro.glb and cubes.glb lol
The path also looks wrong though
it looks two folders up from the debugging dir
Do I need to download those myself?
probably
the exe is is solution/x64/debug, no?
so to get back to the solution dir, I use ../../
yeah but the working dir is set to $(ProjectDir)
it should be commmitted
this is just the vc++ directories, right?
alright, I just fixed those and the glm type thing
where do I get the glb files?
iirc yall told me I should gitignore that since it was some personal settings or something lol
maybe im remembering wrong
im gonna do something real dumb and upload them directly
to the repo
As long as you include the license info I got no problem with that
I think I might have it somewhere
Damn the one I have is FBX
yeah because it usually contains user related settings for your environment, jake or me might have different "preferences" but working dir should be part of the ordinary settings if you ask me
but again, prop sheets could solve that too
I never realized it wasn't
you might be able to just drop any glb file in called bistro.glb lol
Ok lets see how it likes sponza
i havent tested sponza in a minute
should be, but I just checked and its in the user settings for some reason
@plain mantle texture compression is disabled iirc, hope you have enough vram
I have 8gb
You can cache that shit
probably
Driver texture compression is pretty bad anyways
I use bc7enc and save the result on the first import
the subsequent loads are faster than without compression
Those are peformance warnings I think
I see those
What could it be
API, ERROR, HIGH, 1285: GL_OUT_OF_MEMORY error generated. Failed to allocate memory for buffer object.
Maybe you need to check the max buffer sizes
yeah not sure what i did there
are you able to use breakpoints?
synchronous debug should be on
I also really dont like the 6ms render time
I'm in debug mode so I wouldn't worry too much a bout the perf
but yeah I can set a breakpoint in the error callback
what file is that in ?
main probably
Demongod would be proud

model loading stuff is either gonna be in model.cpp or scene.cpp
What's going on
He put everything in main.cpp
Ah
anti-bikeshed
Raw opengl calls in main.cpp
Tbh I don't really do that because my projects explode in size at the start since I am so productive with my anti-bikeshedding that it doesn't live in main for long
it compiles now on your very own pc
running though? probably not
Its running for me rn
missing walls though
uh oh
wait I don't know if thats an error
but we hit the callback
you formatted your switch weirdly
so the breakpoint was in the wrong place
it was actually formatted very nicely, then vs messed it up and i havent taken the time to fix it
Ok I am getting an error there GL_INVALID_VALUE error generated. <size> must be positive.
???
mBlendIndexCount == 0
maybe it was my fake bistro
nah
it just always expects some alpha blended materials
i did push cubes.glb to the repo, those are blended. Try those
sponza has the plants
maybe those are alpha mask
I had the deccer cubes in there
is that the only error?
id like to know where this was
I just put in your cube file now I'm getting a crash
Its the place I was showing before
crash in glMapNamedBuffer
might be a sync error
single frame, or multiple
definitely sync
No errors any more though
everything’s working?
It crashed before I could screenshot though
bruh
yeah not erroring proabably helps
empty console
What do you have?
3050
nah its desktop
anyways, both the occluder_batch and cluster_batch perform an atomicAdd to that buffer
just toss a glfinish in front ig
before glMapNamedBuffer?
probably
Nope
still doing it
Maybe you should test with my sponza
I gotta get back to my project
No worries
is this version available online or can you share it?
I shared it before
#1234659747291201587 message
its the crytek one, I just converted it to glb
oh i didnt see that sorry
running it now without error
so it must be sync
or ub that crashes your gpu but not mine
I really wish the bug would happen for me so I could debug it
especially if this doesn't fix it
Do you have another gpu you can test on? Possibly there's an iGPU in your system?
If there's UB it can pop up anywhere
nah
something makes me think the actual error is happening before that loc
i dont see anything on that line that would throw
could this be it?
making a draw call, then copying that draw's depth buffer
@plain mantle if you get time, could you try adding this line to main
This did not fix it
darn
If you run RD with "verify buffer access" enabled what happens
thats not an option due to bindless textures
maybe i can somehow disable them
or if nsight has an equivalent
this project is only possible because of n sight
The reason I suggested that option isn't because of the bounds checking but rather because it clears all your buffers to 0xDDDDDDDD
So if you access bad data it'll break your program
But you can just manually clear your buffers to that value
i dont ever remember opengl throwing exceptions though
It doesn't
With renderdoc you can attach a debugger and it'll trap on an OOB host access
And then with the debug clear value it'll just cause crazy UB that gives you some signal as to whether things are working
whats oob mean?
Out of bounds
there are a few newer ones, yeah
but the latest 572.. doesnt seem to be that stable yet
either way I doubt GrubStomper29’s OpenGL Sandbox found an rtx driver bug
Probably not
@kind sparrow quite literally makes a cameo here https://youtu.be/Bmx7kup3gpo?si=jTWjEjff0kv1S0k-
Minecraft game development has peaked in 2024. But in today's audiovisual presentation (2024), game development will continue.
Music list: https://pastebin.com/H64mUxHY