#GrubStomper29's OpenGL Sandbox
1 messages · Page 3 of 1
doesnt matter
2d is 3d
the important bits are that you can explain how the graphics pipeline works
api doesnt matter
or how you would implement certain things to achieve certain things, like effects or techniques
nobody really cares about the contents of your personal projects unless they are directly pertinent to the job duties
Otherwise it's just another software engineering project
which is still looked at favorably, it's just not going to give them a "wow this is precisely what we need" response
I see
btw, you may want to pack every has****Texturefrom your MaterialUbo into single uint to reduce size a bit
do you like the code so far
too raw imho, I started loading models only after abstracting buffers,vbo and such stuff
Personal preference
I don't abstract that stuff much
I have a
struct Mesh
{
std::vector<Vertex> m_vertices;
std::vector<uint32_t> m_indices;
};
and a
struct GPUMesh
{
GLuint m_vao;
GLuint m_vbo;
GLuint m_ebo;
};
and that's it
talking about this stuff
What about it
If that's in a function and not copy/pasted then it's fine, I do the same
I have a function that just takes in a Mesh, does all that stuff, and spits out a GPUMesh
in main, multiple times creating and filling buffers by hand, I abstract that stuff into single line
exactly
I know, but as of now -its raw to me
I find it preferable to start with everything out in the open and create abstractions around emergent patterns
the effort to make some sort of abstraction is higher than just copy and pasting and changing what i need
if it gets to the point where it does obstruct and cause confusion then ofc its bad
thats why I put "imho" in there
yeah
you do have a valid point to an extent
i hate making it seem like “im right and smart and youre wrong and stupid”
just different coding styles
i have one variable named vertOffset and another named vertexOffset 
i hope you pick the right one after that incident
it didn't matter because I just needed to add both together
i believe vertOffset the amount of vertices already in the buffer
vertexOffset just says something abuot some vertex Offset
the amount of verticles should be vertexCount
and vertexOffset is a parameter to add to each index, used for the amount of vertices already in the scene aside from just the model
so its more like local and scene offsets
it do be conchfusing this way
indeed
ill fix it later™️
just switched to 8bit indices and im saving ~120mb with bistro, now its time to do this
I hate trying to name things
maybe just mPrimitiveUniforms and mBlendPrimitiveUniforms
how about mTransparentUniforms
transparent is too vague, especially since alpha masked primitives can go in the opaque pipeline but blended primitives can't
how so? It makes sense transparent means that you can see through it
you can also see through alpha masked triangles but not in the same way
I mean yeah but it's not like a glass
i'm wasting development time bikeshedding names 😭
I would separate masked from opaque and have own shader for masked. Discard is not cheap
In this area you are head of me. I treat every primitive as opaque 
drawcall-time resolvable if-statements completely do away with this as far as I can tell, and it's not slow, so I don't care lol
once you implement deferred shading, adding weighed blend IOT will probably be pretty easy
std::vector<PrimitiveUniforms> mPrimitiveUniforms{};
std::vector<PrimitiveUniforms> mBlendedPrimitiveUniforms{};
settling with this
yeah, for weighed blended at least
that sucks, but there isnt any other way
I hated every second of what i just did
still searching for gi solutions
scene voxelation is unacceptable imo
unless i can do it dynamically somehow
RSM
you can do it dynamicaly
strong cope with this one
Light Propagation Volumes is much nicer
okay
@oak moat quick question. The result of these culling shaders is not only the new index buffers but also an array of parameters for the MDI?
no it's just one mdi parameter
wouldn't that make it just di then
yes
and you gain meshletID
per vertex
void main() {
const uint meshletId = gl_VertexIndex >> 8;
const uint primitiveId = gl_VertexIndex & 7;
}```
oh ig you could pull it that way
but i think meshopt doesn't consistently deliver meshlets with X amounnt of vertices
ig i could store padding vertices
huh?
yes
oh well same thing
vulkan brainrot
but yeah same thing, but ze compiler will not know it
if I can't specify it's value, then I don't understand how that data is packed in there anyways
let me think
if you bind an index buffer, gl_VertexID is whatever the contents of the index buffer are
otherwise it's just counting the vertex index
you can read Jasmine's blogpost on meshlets
zeux?
i need to learn this too at some point
you can do it quickly? 
I've done this a trillion times so it would be weirder if I couldn't 
legit it's muscle memory at this point
my dreams are haunted by meshlets
-meshlets +metis
let me see if this blog is enough first
i see, subcommands scale badly
bevy has a nice naming scheme
better than gltf's "primitives"
this is what i was looking for https://jms55.github.io/posts/2024-06-09-virtual-geometry-bevy-0-14/#result-writeout
ohhh I forgot im decoding the indices
so I can just put whatever in there anyways
I get it now
So in conclusion I need to use compute to build a single indirect draw parameter buffer and a large index buffer that is later used to decode meshlet/material IDs an whatnot as well as the actual vertices
now I just need to implement this yikes
what about an sdf bvh, can those be dynamic?
sdf takes time to build there is a sdk from amd that should be fast https://gpuopen.com/fidelityfx-brixelizer/
voxelizing scene is rendering scene from 3 axis and writing color to 3d texture and thats it
you can also just build the sdf itself offline and then just combine them in a global sdf at runtime
also a option
i see
would this fare well with skinned meshes?
perhaps
perhaps is scary
maybe i can mix BVHs?
sdf for static and something else for skinned
there is also this option
i imagine that would fail catastrophically and cause lag if the user just spun around really fast though
as some of you saw, I am now pulling vertices from an SSBO
I am getting this warning now though API, PERFORMANCE, MEDIUM, 131218: Program/shader state performance warning: Vertex shader in program 12 is being recompiled based on GL state.
I believe it started once I took the VBO out of the VAO
It's probably fine
It doesn't sound like it's saying there is a performance issue, just that it is specializing your compiled shader for performance reasons and that this message is of medium-grade importance
It's probably medium because it's recompiling it on the fly which could cause hitches if it's happening at random points during gameplay or something
What are the advantages of pulling vertices from ssbo instead of vbo?
encoding additional info in indices
the second you start doing something complex you die
hard to manage vertex types
How many vertex types do you need? At this point I have like 2 and cant imagine how you can overcomplicate that
I mean even 2 is too much
do you suballocate buffers?
if you don't then you have no issues of course
Suballocate buffers for additional data?
One for animated and one for non animated objects, to spare some memory on joints and weights
lvstri is a terminal bikeshedder he doesn't do animation
Perhaps he was referring to vertex buffers themselves rather than pipeline layouts
You can still have all your vertex data in one VBO even if you have multiple layouts
I am doing that, vertex type is getting automatically desided based on number of available animations in gltf and then my model structure receives that one vbo
(the code is a mess and anims still dont work)
I mean allocating one VBO for the whole application and allocating chunks of data out of that pool
Im really only doing it to put some extra data in the bits of the indices
the code is a mess
yes exactly
Im planning to do that too eventually
What data?
material/meshlet ID stuff
The code is a mess cause I have no clue how to properly implement animations, two vertex types have almost zero influence)
I could give more concrete examples, but once you get to buffer suballocation then you'll get what I mean
im trying to break this draw batching into smaller steps since i dont have the time to write it all in one session
i think the next step could be to get the compute shaders up and establish their inputs
i think it’s two compute passes—meshlet culling then triangle culling
I think first the triangle cull pass
it would probably be easier to build off of that
@oak moat I need advice
are the meshlet cull and triangle cull in two different compute passes?
regardless I need to build the trangle buffer anyways
well yeah I plan to skip the cull step for now
but still, don't I need to batch all the index buffers together into one big one so I can do the single renderpass?
then
no thinking now
right right right
however
building the trangle buffer needs a compute pass
do you recommend one thread or whatever the right vocabulary is per triangle?
yes
i see
thank you very much for your help
alright i wrote 5 lines of code im done for the day time to relax
XD
all in on black
good luck
i lost 😢
back to coding then

i think
one invocation per triangle, as many invocations per work group as possible?
ill need to research
“After reading these section quite a few times over I find the ‘best’ solution is to maximize local invocation size and minimize number of work groups because you then tell the driver to omit the requirement of invocation sets being independent. Fewer requirements mean fewer rules for the platform when it parses your intent into an execution, which universially yield better (or the same) result.”
@oak moat Why don't I use a thread per meshlet and loop through all triangles from there? that sounds far easier and looks like what bevy does
sorry if my constant questions are annoying
i see
im not sure how to go about organizing workgroups and invocations
i might be able to do workgroup per meshlet, but since each meshlet doens't consistently have X triangles, could it waste occupancy?
sure you could have idle threads
wouldn't that suck though
what do you do?
having idle threads does suck yes
does it suck more than having N * 3 memory ops per thread?
as far as I know no, but you can test both approaches
I just use mesh shaders 
I mean
I would definitely have to look and see how often meshopt gets close to 124 tris per meshlet
just go with the easier approach for you currently and profile
nah
you can simply define a lower bound and use that as workgroup size
i.e 64
and process MAX / 64 + MAX mod 64 triangles per thread if threadId < MAX mod 64
which is the correct approach and the fastest one, but as you said it's harder to think about
so just go with one thread per meshlet and big loop
in that example yes (kinda)
alright
it's just some threads will do 2 tringles and some will do 1
yeah that seems easiest
and im sure my gpu wont have much trouble rendering bistro
Oh!
should I worry at all about trying to use subgroups here
no
at best you'll probably do worse than what the driver can optimize for you because they're tricky
plus there's only one usage for them in what you're trying to do
which is atomic scalarization (done automagically by drivers usually)
what do you mean?
right
You can pack into those or use an ext
vulkan has one 😉
I assume this is implemented and not just a proposal
this looks like exactly what im looking for
now I have to figure out what exactly I'm writing to
bevy mentions "reserving space" and never elaborates, and I'm pretty sure dynamic allocation is impossible here
maybe they have a large index buffer able to fit every scene triangle, but that seems wasteful
for a hobby project its fine
I thought so
im bikeshedding too hard rn
but I want a comprehensive plan before implementing anything
At load time:
Have transforms (per primitive) and materials on GPU
Need array of all clusters
Generate empty index buffer large enough to store every single triangle in scene
Generate empty indirect draw buffer
At run:
Upload per primitive array that notes what clusters need rendered
Loop through each cluster and add all its triangles into a large index buffer, each index being encoded with material/transform data
Update indirect draw buffer
i am still alive btw
base 128
I need a new way to organize my desktops
I just have one for the main task and the other for internet browsing, discord, and music
and a lot of times the main task becomes this:
i have downgraded from 3 to 1 screen
i dont mind many windows alt+tab works well for me
since it can toggle windows back and forth i always know which window was last or know how many tipes i have to press alt+tab (or shift alt tab)
but yeah 🙂 nvidia nsight doesnt make this better
Whenever I get this project in a good enough state, I want to remake my vulkan forest scene on here
- It will hopefully look much better with pbr and csm or vsm, and hopefully will have some gi approximation or at the very least ibl
- it should be a solid testament to optimization techniques mattering much more than choice of api, since the original had no frustum/occlusion culling or gpu driven rendering
we have triangles
closer
I'm messing up on reading the cluster id from the indices
uint index = (clusterId << 6u) | indices[clusters[clusterId].firstIndex + i];
writeIndices[bufferStart + i] = index;
thats the encoding
this is the reading:
uint clusterId = bitfieldExtract(gl_VertexID, 0, 26);
Vertex vertex = vertices[bitfieldExtract(gl_VertexID, 26, 6) + clusters[clusterId].vertexOffset];
@oak moat does this look right?
oh
ig bits are read right to left, not left to right
look at this
before and after optimization
~6 times faster
i still need to get it working with oit but this is very cool
next is culling
@night shoal @oak moat how cursed would it be if i kept ogl but integrated vulkan just for hw rt
no idea
👍
just stay with raster
i was looking at radiance cascades
which i dont think benefits from hardware rt in most implementations
ill need to dig deeper
will meshlets not work with rt?
darn
a user in this server
i dont remember who, he had fox in his username and was german
iirc he recommended radiance cascades with sdfs, reusing sdfs from the last frame
what are you doing for a gi approximation?
ddgi might be a good place to start
it's nice and shrimple
it does
i see
are you guys proud
I should probably upload a picture to this thread thumbnail somehow
@night shoal Do you know how I could achieve this
if you modify the first message
I think if you just edit the first message to contain a link to a picture it'll work
yeah or even ctrl+p should do the trick
looks like we never pinned the first message
let me fix that too
you can also fix the first post by uploading a "social preview" image to your repo
turns it into https://github.com/deccer/Hephaestus/
(updating might take a while) and you need to remove the link from the first post and put it back once the social preview is updated
i see thank you
any suggestions for what picture i should take with my engine?
i can load most gltf models, but the lightings kinda bad
Yeah but “GrubStomper” is in there too
maybe i make a scene of a foot stepping on grubs
What do you have against grubs anyways
29 dead, 8 wounded
the real reason
I play a little unknown survival game called “rust”
while foraging you can get grubs, which are useless
so me and my friends hate on grubs now
yall wanna help me find agartha
What's that
funny conspiracy hollow earth city place
oddity in the implementation of this algorithm
6 bits was not enough for vertex indexing, which is very odd
6 bits gives the number range 0-63 iirc; and the max vertices in a meshlet are 64, so there should be no problem
yet when rendering with 6 bits there were evident off-by-n errors that were only fixed by upgrading to 7 bits
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, scene.ibo);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, scene.indirectDrawBuffer);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, scene.clustersSsbo);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, scene.writeIbo);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 4, scene.indirectBlendDrawBuffer);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 5, scene.writeBlendIbo);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 6, scene.materialsSsbo);
Code like this makes me glad I'm using ogl
I always remember making any data usable to shaders was a huge headache in vulkan
everything is a huge headache if you use raw vulkan,thats why wrappers exist)
fake
.PushConstants(
_sceneInfo.MeshletBuffer.GetHandle(),
_sceneInfo.MeshletInstanceBuffer.GetHandle(),
_sceneInfo.TransformBuffer.GetHandle(),
_sceneInfo.PositionBuffer.GetHandle(),
_sceneInfo.IndexBuffer.GetHandle(),
_sceneInfo.PrimitiveBuffer.GetHandle(),
_virtualShadowPass.VisibleMeshletBuffer.GetHandle(),
virtualShadowClipmapInfoBuffer.GetHandle(),
_virtualShadowPass.VirtualPageTableImage.GetHandle(),
_virtualShadowPass.PhysicalMemoryImage.GetHandle(),
static_cast<uint32>(_sceneInfo.MeshletBuffer->GetSize())
)
.DrawMeshTasks(
DivideRoundUp<uint32>(_sceneInfo.MeshletInstanceBuffer->GetSize(), 32),
VIRTUAL_SHADOW_CLIPMAP_COUNT
)
There is an error in the way im getting material indices
oit works again
noite
now i need to lock in sync and overall cleanup my code
after the compute batch, i use glFinish for sync 💀
for some reason mapping my indirect draw buffers for reading adds 32ms to my frame time 
Yeah feedback is no bueno although 32ms seems excessive
Unless that's how long it takes to flush the pipeline
Maybe you need to double buffer the readback
What are you reading back anyway
Is it a persistently mapped buffer
no
maybe i should try that
only problem is
there are thousands of atomic operations done on this exact buffer from compute
im scared persistant mapping could ruin that
You don't want to be reading back GPU-local buffers afaik you should make a separate host-visible one
On Vulkan you wouldn't even be allowed to attempt to read back a buffer like that unless you explicitly set it up to be
You want to make a second GPU buffer for the small info that the CPU wants to read back
And hope the driver puts it somewhere that's faster to access
Or create it as immutable storage with the host visible flag
If you want to avoid flushing you can make it a ring buffer of two or three slots and only read back last frame's value not the current one
It's basically what you'd do for everything in Vulkan
that was why i avoided vulkan 😭
Just don't read back then
Have a compute-powered debug text output and print it to screen from the GPU 
Or just try making a second small SSBO for the readback value and do everything else the same as what you're doing now
That alone should make it a lot better
Although reading back the same frame will still require flushing
i can defnitely read back the last frame
why do you need to readback? Isnt there way to issue indirect draw using "argument buffer"
yeah I do that
its just for debug info
but honestly this is a lot of effort when I can just use nsight
sounds bad, no thanks
welp, meshlets are complete
I just need to clean code and then I can move to culling
thanks for your help @oak moat
good job chief
Should I count a gpu dispatch as a drawcall in the performance counter?
is it a drawcall
The significance of draw calls kind of goes away when you're doing MDI
You can shit out tens of thousands of indirect draw calls just like you can with Vulkan regular draw calls
i mean not really but its a pretty significant command to the gpu
yeah but its there for a flex
especially since theres no hidden extra indirect multi draws
its just 4 drawcalls
I would just stop using drawcalls and dispatch count as meaningful metrics
and instead use actual timings counters for each pass to show the frame's breakdown
yeah, rendering 1000 tringles or 10000000000000 doesnt matter
important is that you stay within your frametime budget
indeed
This project is like 3 months old lol
Remove "clean code", not gonna happen
its more likely than skeletal animation
it feels more like 6
its closer to 4 😔
i think i want to use csm for now
vsm seems time consuming
My project is 3 years old lol
it is time to do some work
coding in mornings > coding at night
biggest todo: cleanup my resources
i have a habbit of creating them and then not deleting them at program close
looks much better than gobi's sad breads 🙂
who?
Gob posted a picture of two baguette ends on a toaster tray that looked a little well done lol
lol
i need to clarify that these loaves are very large
a little under a foot and a half each
yeah perfect for a decent sandwich 😛
ill spend hours baking bread but 10 seconds to wash lettuce is too much for me
relatable
#off-topic-🐸 message is that what you were trying to make? 🙂
no that looks gross ngl
if i could get some seasoned chicken breast with bacon and ranch
dynamic voxelization of skinned meshes
very busy, have not touched project in a while
I seek advice
My friend learned Roblox Lua and via networking (career networking, not software networking) managed to make very good money
I know I know
sorry i got busy before i could finish
i should probably stop breaking up my points over multiple messages 💀
no need for excuses 🙂
much more than ive been able to make cashiering for bk
so im wondering
would i be able to try the same thing with C++/GP?
nobody can answer that for you
but you seem to be able to implement a renderer with some fancyisms, which isnt really a typical borgir flipper skill, gp isnt trivial
right
work on some portfolio
but i lack a degree, adulthood, and knowledge in build systems and git
that doesnt matter
most men never grow up anyway
git and build systems knowledge comes from using it
alright
the degree could be important to companies, but when you make cool shit then it matters less
important is that you show interest in
and are able to explain a few things
this question is about the now
before college
and also more importantly be able to read code, as you wont be writing a new engine from scratch, you most likely will use existing code
and fix shit in it, or implement a new technique with it
maybe. maybe not, your github profile says clearly no atm as you dont publish anything, you dont write about your achievements either
oh are all my repos private
show off the shit you do when it comes to GP so that you have something to talk about in an interview
you dont have to
just publish my repos?
and make them look presentable 🙂
and not just "This is a renderer"
make them work also, so that people dont have to manually install or move shit around. clone, and F5 should just work out of the box
shows that you care and some sort of "professionalism"
alright, thats the first step
you assume they compile on my own pc 😔
I demand that they work on your machine too
C++ jobs are much less likely to come by happenstance like the kinds of jobs you get from learning lua though
im sure its even more impressive when you can see how you progressed in the GP journey as well
this is my problem
know at least one programming language somewhat well, doesnt matter really which one it is
i dont think im even going to be able to find anything part-time
But with your C++ knowledge you could get a non-C++ job
yeah
while you cant find anything, improve on your shit, exercise (not leetcode nonsense), make stuff
There aren't part time software jobs there are gig jobs and full time jobs
He freelances and writes Roblox scripts
if you are just after the money, you could do the same, question is if you will enjoy it for longer
this is what got me jobs at 2 companies part time(still in high school so sadly cant do full time) ones doing something completely else than C++
i personally find roblox absolutely boring and horrid. and the audience is a fucking nightmare
for sure
there is load of money in there and perfect for free lancing
But the alternative is working in retail at minimum wage
nah
which is both mind numbing and terrible for money
the roblox "sidequest" could also be an entry into actual roblox engine work, if the company picks you up because you made something cool with it
Done that its fine...
right
factorio modders got hired by wube, minecraft modders same
and same shit happened elsewhere
you just need to keep showing interest in that stuff, and when you have enough to show for, apply at where you want to work at
right
in the meantime understand how git is used, commits/branching/rebase/perhaps exercise a bisect once or twice if possible so that you heard it once at least
same for your code, make it readable, make it runnable out of the box
yeah check how you do merge conflicts
you will encounter this when you start working at company but never in personal projects if you dont do different branches
learned that hard way 😅
Yes although imo I wouldn't worry about it too much
yeah
depends on the work in the end, but i wouldnt want a singleplayer in my team whom you never talk to, hear from, or see at all
External motivations for projects like making something profitable or that targets specific experience can take away from the interest in the project
external motivations are a big factor indeed
I just do whatever tf I feel like without specific reason lol
yeah, you are unlikely to create something profitable as how bad it sounds. I wouldnt worry about it. making it as goal or your source of motivation is stupid
I see
I tried numerous times in school to get my friends to do projects, but they could never stop getting hung up on the desire to make something useful
also because you prooved yourself already at some point and people know what you are capable of
They always came up with technically boring ideas that would be like a startup idea
Rather than something useless and interesting like they should
I'm just talking about projects for projects' sake
oh
If you do those then the rest follows
heh, thought you mean at work, my b
At work I also do whatever tf I feel like lmao but that's because I sort of have my pick of projects to work on
in my real life circle of people there is also nobody who is interested in anything gp or related
But even not GP like one of my friends was into basketball and I tried to get him to make some little CLI basketball team manager simulator
i also mean computerwise in general
But he never did
Yeah
Well these were my CS study mates
So they were already experienced programmers
But still no personal projects
i know some who have some personal projects like football betting thingy
Programming?
yeah
some crude web stuff which they started when they were teens
maintained and updated per season
but i have 0 interest in football, or any other sport really
Me neither but if it interests them
One has to find projects that suit your own interest
It's hard to recommend projects for others
one of my friends is running some sort of newegg kind of thing
hehe
at my school we had "company day" basically companies came to our school and had presentations, recruiters and bunch other stuff. They were saying to students the personal projects are really important and also internships(we have those mandatory)
yeah internships usually suck though
ive seen it in various companies too how they dragged these poor sods through the departments for a week or two or a month
companies pick students from our school and everybody said that they had great experience
most companies or teams where they end up sitting are not even interested in having interns/trainees, because it means work and effort and nobody got time for that
Public facing jobs are good experience
you might find a future sugar mommy, who knows 😄 (jk)

man i think im growing a corn in my left eye
its teasing me for the whole day already
never heard that
eye barley its called in engrish i think

already have
but yeah i am taking a break from programming as of right now because this first semester + marching band has me extremely busy
maybe i can please you all with this piano solo i found https://youtu.be/rzEaHmggVGE?si=LUSJVqWL9R0OcF9S&t=854
Provided to YouTube by Bama Rags Recordings, LLC
Seek Up (Live at MGM Grand Garden Arena, Las Vegas, NV 03.23-03.24.07) · Dave Matthews Band
Live Trax Vol. 9: MGM Grand Garden Arena
℗ 2007 Bama Rags Recordings
Released on: 2007-06-05
Main Artist: Dave Matthews Band
Auto-generated by YouTube.
oh you are at collage now. I thought you are in high school. gl
so last year of hs?
hopefully you dont have same painful school leaving exam as me
probably not
Be glad. In my country we have it mandatory and it's painful
Standard is your native language 2 essay, grammar exam and read 20 books and they will ask you questions about everything even authors. Then English or Math, English is an easy essay and grammar and oral. Math is self explanatory. But I am in computer science high school so I have additional programming, databases, networking, hardware and some stuff about boolean algebra, processors, etc... and then also high school thesis(basically bacholar)
yeah
this hs is not very challenging at all
i maintain a 3.9 gpa without trying very hard
The American education system is much more relaxed than other countries, you don't specialize until adulthood and you can basically take whatever courses you like as long as you eventually satisfy your degree requirements
It's great tbh
You can enter the tertiary education system at any age too
Kind of jealous but specializing in adulthood is kind of stupid tbh
You should be able to do it early
Idk I didn't know what I wanted to do until I was like 20
I mean you can choose electives all the way through school so you have some choice starting at age 12 or 13 but everyone takes the same core classes until university
I switched majors 3 times in university
In my country after 9 years of elementary school you have to choose what specialization you want
There are some specializations that are universal but majority aren't
I also did another half a degree just for fun on the way to my main degree
Since I had the credits
you can
6 million dollars in loan debt
Nah $0
I still finished in 4 years
I mean it still cost money but was paid out of pocket
how in the world do you pay for college out of pocket
2 years community college and then transfer for a university for the last 2 years
- familial education savings fund
It probably cost about $70k altogether or something
With whose money lol
Lmao
how about you move somewhere where university is free for all 
where
anywhere in 🇪🇺 except ireland
sounds like a risky move
like it might cost more than staying in the US
besides—you couldnt pay me to live in the UK, and idk if any other countries would have all english speaking professors
idk I paid 136 euros total for my 3 years in university 
UK isn't EU anymore and also they weren't really on board with free education
so anywhere in the EU except ireland is still true
grocery costs have gone up but for a single person rent + food + utilities shouldn't go past 2k euros per month anywhere
it's ok because we have scolarships
where housing and food are free
but you need to find unis that have those services
i see
what about this
just learn the lang they're all either germanic langs like english or romance langs like latin 
there are classes that are taught in english
in collages/universities
okay
while were on the topic, i need to write my college essay and id like to make it about this project
@kind sparrow thoughts and opinions
yeah but one of them is pretty much “whatever you want”
“For the past X months, I have worked towards writing a 3D renderer.”
I would focus on the why's not the what's
Of all the things you could be doing with your time, why do you specifically choose to spend it on graphics programming, or playing the drums, or whatever it is
What do those pursuits reveal about you as a person
"because reasons"
because i just like doing it lol
because uhhh
its a very intellectually challenging hobby
its very productive and applicable to the real world
and the results are beautiful and very visible
at least other people’s results are 
i’m sure this can be made into an essay
“why I GP”
I should use this project thread to preach sermons
Alright, time for peer review
@kind sparrow what do you think?
I do want to expand upon the end a bit more
My ancient mobile discord won't let me view that but I can read later if I get a chance
Idk if I'll have service but we'll see
okay
@kind sparrow are you an EST pleb? now might be the time
No I'm in PST I'm just on a road trip and going to stay somewhere without electricity tonight
oh okay
Maybe I could put this up in resume-review
I suck at essays but avoid repeating yourself and generally forcing stuff on paper. I would make it a story. They would expect something like this
I see
This came from chatgpt and make it your template and sometimes consult chatgpt along the lines try to improve it, rewrite it, rephrase, etc...
Alright thank yoyu
I refactored it based on your advice @junior sparrow
You too @kind sparrow whenever you get the chance
*refactor 🤓 ☝️ (this song came to my head)
https://www.youtube.com/watch?v=SETnK2ny1R0
Provided to YouTube by The Orchard Enterprises
Refactor · Espen Sande Larsen
Refactor
℗ 2019 Espen Sande Larsen
Released on: 2019-01-17
Producer: Espen Sande Larsen
Auto-generated by YouTube.
GrubStomper29 theme song
(except I always get a full 7-8 hours of sleep)
@junior sparrow refactored
it is bit better but still you need rewrite it. Try to take look at what I send you in DMs and make it the same way
Hook comes last
do I really need one
yeah
you hvaent sent anything yet
@junior sparrow you cant leave me like this 😢
I sent you something on Tuesday
oh okay
man it sucks seeing everyone elses thread be active while mine is dormant
i wish i had time to work on this
Consider that I never even started coding until university
yeah but the reason i dont have timr is marching band
and our band is a joke
im the drum captain this year and
- half of my drummers cant play at a fifth grade level
- the other half of my drummers cant play at an 8th grade level
@kind sparrow one of them couldn’t plays 8ths even with a metronome
Have them record themselves playing to a metronome and then listen back to it
Noobs typically can't hear their own timing in real time
but in a recording they'll be like "wow I suck"
“playing” is generous, most of them cant read music either
none of them fully know the first part of the field show despite having the music for months now
and i dont even mean memorized, i mean know
its very bad
my only objective is to survive the season because its so unsalvageable
Here is the video of my old HS's marching band lol, not in a year I was there though https://youtu.be/G1fm32R3BTY&t=116
linked right before the cadence for maximum drums
oh they sound good but i cant help but notice one of the snares using match grip while the rest use traditional
no worried though; thats what i did in my freshman year 💀
das is a lot of people for a band
my mother’s hs was nuts, they filled the field
ive got nothing to do this afternoon, i think ill try and figure out how to record my e drums and show yall
Drum Simulator 2025
For whatever project I make next, I want to have better source control on git
i’ll get real fancy and have a test branch
I am sad to announce that I am making a Scratch project
A terminal illness it seems
indeed
#showcase message
Crazy lol
My old original algorithm took 3 minutes for that same model
500ms is a big upgrade
Why not just program in assembly it's basically just as obtuse of a tool but actually powerful
Handwritten AVX
I have a following on Scratch for some reason
Ah
people actually make 3D games with Scratch for some reason
they need Nanite too methinks
im going to make a separate thread for this
Grubbi is the Jasmine of the Scratch world
who’s that
#1090390868449558618 message
oh yeah him
no followers in my other thread 😦
It takes time for them to build a following
yeah
dont you worry, we will wait for your return
Alright I have a drive to do this this morning but I can't even remember what needs cleaning
when in doubt, rewrite
i really need better var names

THREE CONVENTIONS
no prefix, global prefix, and scene prefix 😭
im too lazy to rewrite the miniscule 500ish lines of code, so im just going to rename everything and clean the code
the code itself isn't terrible
When in doubt - rewrite in hungarian notation
when in doubt - get rid of primitive type obsession
wdym
dw, ive upgraded it to GLint 
VertexOffset_T vertexOffset, GlobalOffset_T globalOffset, MaterialOffset_T materialOffset 😄
(its an actual thing, primitive type obsession, but im just pulling your leg here)
i really wish discord would stop automatically unfollowing this thread
theres nothing to post
the project remains untouched
Then why shouldn't the thread fall off the list lol
bc i dont want it to 😦
samplers, textures, texture handles, need dealloc
already done
nice job, past me

The model class is finally cleaned
now theres a ton of resources in main.cpp to dealloc
i dont want to touch main.cpp
@junior sparrow you have a point, this file sucks
Btw visual studio has an automatic todo list aggregator
Her* 🙂
that actually makes a lot of sense lol
i think that project may interest you, consider following the thread
Which one?
put it on the bulletin board of todo items : >
Maybe instead of a “render graph,” I use a “bulletin board”
i will certainly need a scene class
transparent objects have dissapeared lol
I dont like these numbers
I don't theres 1.1 billion indices for blended models
especially given that the only blended model is 6 cubes
smells like uninitialized variables
has to be
this is a very bad sign 😭
always initialise or assign value immediately
I do, so its probably offsets
yeah index count for the opaque indirect draw is absurdly high too
either im messing up when mapping it for reading, or im somehow feeding the compute shader rediculously high numbers
i should most certainly be using nsight rn
Alright, the drawindirect params do have correct values as far as I can tell
its most likely bad vertex/index offsets
?!?!?!?!?
all of a sudden the project refuses to compile because intellisense thinks my shader files are C
looks like a debug line renderer to me : >
@kind sparrow do you think lab internships have the same value as workplace internships?
does this question make sense
No but they are still valuable
I'd say they're like 80% as good overall, and in some ways better, in others worse
I worked in a lab after graduation for 18 months since the internship I had lined up was cancelled when covid lockdowns hit
And my current employer found that experience to be a positive
i see
i know i change my mind a lot about the lighting plans for this project, but right now baking seems like the smartest idea
spherical harmonics for diffuse gi
relationship between scene and model is interesting
in my engine at least, a model must belong to a scene so the indices are appropriately offset
it would make sense for each model to store a pointer to its scene object
@kind sparrow @night shoal I’ve never used pointers in this manner, so I’m going to consult the wise
im already thinking how to reply before you pung me 🙂
i was think weak_ptr?
i dont think thats necessary
I see
a "scene" is just a "group" of entities/gameobjects/actors idk how you want to call it
and entities/gameobjects/actors - let me stick to entitity
are just a "container" of "components"
where a component will describe what the entitty is made out of, a name perhaps, some sort mesh, a material, and a transform, perhaps a collider shape for fisiks later, perhaps a healthcomponent and more
it does store helpful data that entities would need to access, such as aforementioned offsets
the offsets are stored elsewhere
the renderer will take care of all that
lets assume a scene
a tree and the deccercubes
and your camera is looking at the 2, but slides to either side and that will make the tree go out of sight
then the main loop, will collect all visible things from the scene, in this case the cubes
that means you go through the scene, and compare each enttity's - lets use the fisiks collider here, as it most likely will be an AABB box pretty much -
so it grabs that component and does a camera frustum vs aabb test to cull objects
the tree doesnt survive that test, but the cubes are, that means the cubes go in a silly list
which the renderer iterates over
woah woah woah hold on
there are 100 different ways how you can do that or in what detail you can do that
holding on
renderer should store that state?
yeah
the scene doesnt care about mesh offsets or whatever
the scene is just a high level descriptor of what objects live in your world
and what behavioouir is attached to them (potentially scripts in form of script components)
i see
scene doesnt know nor doesnt care about how it is rendered to screen
that way you could use those "scene"graphs on a server too where you have no render capabitlitlitlies
lets keep it naive for now... now as you iterate the scene - we could even leave the culling part away for now - its just a minor optimization anyway
so you feed the scene to the renderer ... void Render(RenderContext& renderContext, Scene& scene); perhaps
rendercontext contains timinginfo, camera stuff perhaps, and other things which may be relevant for rendering something, window size or so ... anyway
the renderer walks through the scene, plucking mesh/material/transform information from the entities
and then it checks, did i see that mesh before? yes or no
if no, then grab the name from the mesh, look it up on disk, load it, then create an intermediate structure, inside the renderer, lets lets call it gpumesh, which has vao, vbo, ebo
you load that mesh into your usual vbo/ebo and you create a vao according to what you need, and assign it all to that gpumesh, then you throw that into a list
no offset required
you do the same for material
and you do the same for transforms
if we keep it super super naive, you could even store the material and the transform information in that gpu mesh too
lets do that for now
material means here you load diffuse and normals perhaps, so you load the textures as usual too, stbi et al
and then you keep the texture ids as attributes on the mesh, and the transform is a shrimple mat4
lets ignore hierarchies too for a second
the renderer then just loops through that list of gpu meshes, and does
bindvao(mesh.vao);
bindvbo(mesh.vbo);
bindebo(mesh.ebo);
bindubo(globaluniforms); // usually camera information, proj/view/inversedthisandthant/windowsize/deltatime/...
programuniform(mesh.transform);
bindtextureunit(mesh.diffuse, 0);
bindtextureunit(mesh.normal, 1);
drawelements(...)
if you add hierarchies... like parent and children, you simply brute force the parent's transform before feeding it to the gpumesh, like gpumesh.transform = parent != null ? parent.transform * transform : transform;
interesting
from there you can optimize further if you want/need to
if you want to go with mega buffers for mesh/material/instance data, you can just stuff all the data into one buffer per domain, and store the offsets on gpumesh
just to confirm my understanding—your example goes scene->entity->mesh->gpu buffers?
scene contains "strings" for mesh/material and 3 vectors for your transform, pos,rot,scale (in form of those components, meshcomponent, materialcomponent, transformcomponent, perhaps a namecomponent too that never hurts)
oh i see
those strings are turned into the actual model and that model is deconstructed into mesh buffers (vbo/ebo) inside the renderer
the renderer is storing all the gpu stuff and the scene is the high level overview
yeah
thats hot
thats the demongod way, which keeps shit simple
yeah
might not be the most advanced or most reasonable way, but its a good start, its the most reasonable way to begin such a thing
when you load a model, and its meshes, you can also either calculate it yourself or read it from the model already if present, is its bounding box, you could also store that on the gpu mesh
right
and since you have camera information in your renderer too, you can combine the too for a cheap cpu culling mekanism already
problematically, if I want this structure in my project I’ll have to do a ton of rewriting
or you start from scratch with a version 2 of your thing
not happening
make sure to use version control 🙂
well my point is that this is a rendering only application
so i dont think the rewrite would be worth it
i can probably continue my project with the structure it has
are you facing any problem right now?
you can also preload all your meshes
stuff them in a dictionary by name, and that name is the one on your components
then when the renderere goes through the scene, it just grabs the mesh/material from those
not necessarily, id just like for my models to have a reference to the scene that owns them
how would that let me reference the scene from within my models?
☝️
You're right; I do not need it
i should be storing the offsets elsewhere
ah
I see deccer evangelized you so my assistance is unneeded : )
But yeah the relationship between model and scene is: model lives in a map/array somewhere, scene object stores a name or array index of the model it uses, and that's it
I do have models in the engine side since I need to access it for physics but the actual GPU mesh with the vertex buffer offsets or vao or whatever is a separate array/map stored in the renderer
the demon method
this shouldn't cause memory leaks
if (!shaderProgram.computePath.empty())
{
auto computeShader{ compileShader(shaderProgram.computePath, GL_COMPUTE_SHADER) };
glAttachShader(shaderProgram.program, computeShader);
glDeleteShader(computeShader);
}
glLinkProgram(shaderProgram.program);
GLint success{};
glGetProgramiv(shaderProgram.program, GL_LINK_STATUS, &success);
if (!success) {
GLchar infoLog[512]{};
glGetProgramInfoLog(shaderProgram.program, 512, nullptr, infoLog);
std::cerr << infoLog << '\n';
}```
the glDeleteShader before glLinkProgram flags the shader for deletion, which hopefully happens after glLinkProgram
shouldn't you query size of info before getting info log?
probably but it doesnt matter
you delete the shader after linking
idk why visual studio formats like this
anyways, the major code cleanup is complete : )
onto meshlet culling
you ackchually dont need all of that 🙂
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);
debug_break();
}
}
I think it's important to point out that while this may be the by the book "idiomatic" way of writing C++ nobody in real life actually writes it this way with all the attribute spam and stuff
i didnt mean to flex those, they just calmed the static code analyzer, the important bit here was that you only really need the error type
Ah yeah
and i dont write idiomatic c++, but idiotic c++ 😛
hehe
Hopefully hiz too 😉
yes
I have developed an IMMACULATE piece of art that perfectly encapsulates the image of the Grub Stomper. I will permanently, if it is the Lord’s will, use it as my profile picture as soon as I can obtain a high quality photograph of it.
proceeds to not show it
If the hype is too much to handle, I can reveal the art style first

what do you have against grubs anyways
The Grub Stomper gets a euphoric feeling from the titular act
maybe when the metal gear solid spree slows down a bit lol
this unfortunately lacks the frustum culling chapter