← Home ← Back to /g/

Thread 106467928

320 posts 72 images /g/
t. pogeet !!b2oSUmilA2N No.106467928 >>106469082 >>106469177 >>106471778
/gedg/ - Game and Engine Development General #301
"You cannot stop Chaos!!" Edition

/gedg/ Wiki: https://igwiki.lyci.de/wiki//gedg/_-_Game_and_Engine_Dev_General
IRC: irc.rizon.net #/g/gedg
Progress Day: https://rentry.org/gedg-jams
/gedg/ Compendium: https://rentry.org/gedg
/agdg/: >>>/vg/agdg
Graphics Debugger: https://renderdoc.org/

Requesting Help
-Problem Description: Clearly explain your issue, providing context and relevant background information.
-Relevant Code or Content: If applicable, include relevant code, configuration, or content related to your question. Use code tags.

picrel sauce :
https://enginearchitecture.org/downloads/REAC_2025_Saber.pdf
https://www.youtube.com/watch?v=pBJMcXI7pMo (audio is not good)

Previous : >>106440381
Anonymous No.106467983 >>106468058 >>106468231 >>106476869
My renderer does not show any objects on Linux, argh. What could possibly be different from the Windows build?
t. pogeet !!b2oSUmilA2N No.106468058 >>106468311
>>106467998
AMAZING!!!
was every texture painted in krita?
>>106467983
>What could possibly be different
its not win32api on Linux so... a lot?
what windowing library you using and are you using the same version of it on both windows and linux?
Anonymous No.106468099 >>106468435
>>106468036
>Make a deletion queue (vkguide has this) to clean up Vulkan objects
Not who you're talking to, and I'm not using C++, but creating a kind of dependency graph/queue (so things are deleted in the correct order) and tying everything to some main timeline semaphore (so they're not deleted while still in use) seemed like an elegant way to do that.
Anonymous No.106468231
>>106467983
time to use renderdoc honey
Anonymous No.106468311 >>106469419
>>106468058
Thanks! For the textures, i grabbed a grass texture off google images, did adjustments to the color to get what i wanted (i think i did palette limiting or some other technique, too?), and hand painted the transition between path and grass in aseprite. I also went for a more pixel-art inspired approach for the leaves, and layered them with transparent masks over my grass texture.
I feel like using a diversity of techniques can make the scene way more interesting, i also have wild plums on the ground with a decal + normal map, and a 3d model to represent them also
Anonymous No.106468435
>>106468099
This is a case where elegance isn't called for. It'll just complicate your code and be a huge pain in the ass to debug when you run across some random rare issue. Simpler is absolutely better here. Just maintain a handshake step and clean stuff in a straightforward way there.
Anonymous No.106468484 >>106471001
>>106467630
Thanks. think the detail looks bad right now because the textures weren't made to work with this shader. Once I get to drawing them properly, they'll look less like those terrible vaseline pixel shaders that everyone on /vr/ hates.

>>106467325
>>106467767
I'm already using instancing and mipmapping actually. Luckily, OpenGL's default mipmapping doesn't ruin the RGBA layers, it's as if each layer got mipmapped individually. As for instancing, I use glDrawArraysInstanced to make sprite data as compact as it can be when sending to a VBO.
Anonymous No.106468625 >>106469419
>>106467630
>Mipmapping has no room in a 2D side scroller.
There is one usecase. Making the sprites look nicer when zooming out.

>>106467998
Cool. I like the palette you chose.
Anonymous No.106468666 >>106468769
>people still using opengl
I didn’t realize we had grils in here
Anonymous No.106468769
Fuck, left options auto filled
>>106468666
Using sdl or opengl would change almost nothing for my code, maybe 2%
Anonymous No.106469082 >>106469419 >>106470034
>>106467928 (OP)
>latency
>MULTIPLE FRAMES of latency
Anonymous No.106469177 >>106469271 >>106469279 >>106469334 >>106469353 >>106484810
>>106467928 (OP)
Is Pygame good to practice my Python skills?
I know Godot exists with Gdscript, but my primary objective is to build python projects, and make a game second.
Anonymous No.106469178 >>106485939
Tomorrow i will wake up and make progress. I have had divine inspiration
Anonymous No.106469271
>>106469177
Pygame or pyglet are both good for that. You can also try one of the various pygame forks, or arcade (based on pyglet)
Anonymous No.106469279
>>106469177
just make what you want with whatever, python is easy to learn
Anonymous No.106469334
>>106469177
glfw / sdl3 both have Python bindings if you're trying to do engine dev
Anonymous No.106469353
>>106469177
i got fluent in python building dumb pygame projects on an old laptop and later graduated to gdscript and godot with surprisingly few issues. it's probably a good way to move forward without committing too much to gamedev desu
t. pogeet !!b2oSUmilA2N No.106469419 >>106469430 >>106475853
>>106468311
>I feel like using a diversity of techniques can make the scene way more interesting
I'd say it'll feel very soothing to look at if the foliage in the environment you made are animated or could react to a wind simulation. Great work on color choice.
>>106468625
>Making the sprites look nicer when zooming out.
yeah, true.
But its not at all needed for a 2D side scroller where the sprites are usually of fixed scaling.
And since anon was already doing SDF shit, having mipmaps on top it would only make it less performant because computing SDF already takes care of aliasing and shimmering so its better to avoid doing that additional step.
>>106469082
>MULTIPLE FRAMES of latency
>Warhammer 40,000: Space Marine 2 passes 4.5 million sales in first month
seems to have worked out very well for them.
Anonymous No.106469430 >>106469436 >>106469450 >>106470034
>>106469419
4.5 sales to own the trannies or whtaver. has anyone actually played space marine 2?
Anonymous No.106469436 >>106469450 >>106470034
>>106469430
no nobody played it they just brought it
t. pogeet !!b2oSUmilA2N No.106469450 >>106469866
>>106469430
>>106469436
Anonymous No.106469832
>I now have to make a mega index buffer for indirect drawing
Well fuck me in the ass. At least I don’t have to do it with vertices.
Anonymous No.106469866 >>106470034
>>106469450
>played: 10 minutes
t. pogeet !!b2oSUmilA2N No.106470034 >>106470064 >>106470098 >>106475853
>>106469082
>>106469430
>>106469436
>>106469866
>played: 10 minutes
so what?
It was a huge success with no huge bugs that you'd expect form a modern AAA title and it also happens to be cross platform(windows, xbox, ps5).
I suggest you all to take a look at links in OP before undermining their effort with passion.
For the amount of stuff their engine is doing, its retarded to conclude that its shit just from viewing one pic. In terms of comlexity, this game is several folds more complex to both design and to implement than bland shit like valorant or fortnite.
So, their engine pulling it off and the studio shipping a stable and well polished game is worthy of huge respect.
Anonymous No.106470064 >>106470137
>>106470034
stop defending latency
Anonymous No.106470098 >>106470137
>>106470034
you type so much and you say so little
t. pogeet !!b2oSUmilA2N No.106470137 >>106470153
>>106470064
Though I personally don't like the existence of frame latency myself, this game pulling it off with it is making me to consider relying on it.
Though 2-frame latency is bad, a 1-frame latency when FPS is not capped at 60 will do just fine.
>>106470098
yes, that's exactly how it'll look if you don't read past the first two words of my posts.
Anonymous No.106470149 >>106470240
AAA engines trade latency for throughput so if you don't need to use 100% of all your CPUs power you should at least not have any latency
Anonymous No.106470153 >>106470240
>>106470137
>1-frame latency ... will do just fine.
ridiculous
t. pogeet !!b2oSUmilA2N No.106470240 >>106470251 >>106470262
>>106470149
>if you don't need to use 100% of all your CPUs power
maybe relying on a frame latency makes it less a complex and a more approachable method than dealing with the complexity of utilizing 100% of CPU.
When dealing with things at such low level, any bugs that pop up at the OS sys calls or at the hardware level will leave them at the mercy of the vendors when it comes to getting them fixed. Totally not worth it.
>>106470153
you missed the important part deliberately
>when FPS is not capped at 60
It you think that is ridiculous then let me tell you something more ridiculous. Most here who poll for input first and then update their renderer later(as suggested by almost all the tutorials) in their game loop don't even realize that they already are dealing with a 1-frame latency.
Anonymous No.106470251 >>106470360 >>106470409 >>106475993
>>106470240
It's a technique called pipelining where you break your frame update down into stages, each stage adds a frame of latency but it allows you to utilize threads more efficiently be removing the need for synchronization
Anonymous No.106470262 >>106470266 >>106470346
>>106470240
>It you think that is ridiculous then let me tell you something more ridiculous. Most here who poll for input first and then update their renderer later in their game loop don't even realize that they already are dealing with a 1-frame latency.
What?
Anonymous No.106470266
>>106470262
hes just posting more retarded drivel
Anonymous No.106470269 >>106470278 >>106470291
1-2 frames of delay doesn't matter when you can shit out 100+fps on a vrr display. For 60hz though I think I would notice.
Anonymous No.106470278
>>106470269
most games run at 60 or 30 fps
Anonymous No.106470291 >>106470294 >>106470370
>>106470269
according to microsoft's research on touchscreens, 10ms is the point where visual latency becomes noticeable and objectionable to everyone. considering all the other sources of latency on a current-year pc, you can't afford to just add a frame of latency here or there.
Anonymous No.106470294 >>106470335
>>106470291
>you can't afford to just add a frame of latency here or there.
its a trade off
Anonymous No.106470335 >>106470360 >>106470370
>>106470294
between what?
Anonymous No.106470346 >>106470365
>>106470262
user presses key during frame N
game handles inputs, updates, renders during frame N+1
result of render shown during frame N+2
Anonymous No.106470360
>>106470335
>>106470251
Anonymous No.106470365 >>106470399 >>106470409
>>106470346
No, you process inputs directly after they've been captured in frame N
Anonymous No.106470370 >>106470396
>>106470335
stable frame pacing by giving breathing room for the rendering / simulation when shit gets heavy in exchange for a frame of latency or two.

>>106470291
I believe you but also I've shown multiple normies the difference between 60hz and 144hz side by side and they insist there is no different, or that it looks "just a little smoother". I don't think non autists will notice or care
Anonymous No.106470396
>>106470370
You don't notice latency by observing something you notice latency by interacting with it
You will notice in fast paced action games
Anonymous No.106470399 >>106470449
>>106470365
yes, you do handle inputs that happen early in a frame, but for the rest of the frame when youre updating and rendering thats delayed until next frame.
i just assume gathering/handling input is quick and doesnt take up much of a frame.
there are methods to reduce latency, but for a simple game loop thats what you get.
t. pogeet !!b2oSUmilA2N No.106470409
>>106470251
>It's a technique called pipelining
ah, I see.
>>106470365
the question is, when is that frame presented?
Anonymous No.106470449 >>106470491
>>106470399
>but for the rest of the frame when youre updating and rendering thats delayed until next frame.
its delayed until the current frame is presented, yes, but it doesn't get any faster than that unless you have a time machine
t. pogeet !!b2oSUmilA2N No.106470491 >>106470510 >>106470515
>>106470449
you can do late polling.
present the frame first and poll for input at last.
Anonymous No.106470510 >>106470528
>>106470491
think really hard about what you just said
Anonymous No.106470515 >>106470528
>>106470491
why?
t. pogeet !!b2oSUmilA2N No.106470528 >>106470543
>>106470510
nope.
Only retards that actually can't think at all say shit like that.
>>106470515
why else?
it reduces latency.
Anonymous No.106470543 >>106470552
>>106470528
Regular game loop
poll input > update > render
Your amazing suggestion
update > render > poll input

Your posts are like literal diarrhea, no thought put into them
t. pogeet !!b2oSUmilA2N No.106470552 >>106470559
>>106470543
>no thought put into them
my amazing suggestion is very thoughtful, actually.
Feel free to try it out.
Anonymous No.106470559 >>106470563
>>106470552
It's literally the same thing
t. pogeet !!b2oSUmilA2N No.106470563 >>106470572
>>106470559
think really hard about what you just said
Anonymous No.106470572 >>106470579 >>106470740
>>106470563
do you understand how loops work you fucking retard?
t. pogeet !!b2oSUmilA2N No.106470579 >>106470585
>>106470572
Anonymous No.106470585 >>106470590
>>106470579
I hope you're 15 years old or something
t. pogeet !!b2oSUmilA2N No.106470590
>>106470585
Anonymous No.106470601 >>106470607
The proper way is to have input processed and update game state immediately, and a separate render thread copies a snapshot of the game state before rendering.
This ensures that input timestamp will always be correct. When you make rhythm games you can correctly score hits with the method no matter the rendering fps.
Anonymous No.106470607 >>106470692
>>106470601
>and a separate render thread copies a snapshot of the game state before rendering.
why would you do this
Anonymous No.106470692 >>106470709
>>106470607
When render is slow or wait for vsync it delays input handling if it on the same thread as input.
Anonymous No.106470709 >>106470740
>>106470692
rendering happens on the GPU
t. pogeet !!b2oSUmilA2N No.106470740 >>106470790
>>106470709
when to present the frame is decided by the CPU and only then does the rendering happen on the GPU.
Don't be like >>106470572 who neglects when the frame is presented and focuses on the how its presented, just so they could seethe about it.
Anonymous No.106470790 >>106470796
>>106470740
jesus christ stop posting
t. pogeet !!b2oSUmilA2N No.106470796
>>106470790
Anonymous No.106471001
>>106468484
stop using instancing. it's a legacy feature that even predates the storage buffers.

to draw quads you can use drawarrays with vertex count * 6 and inside shader
instanceData = instanceStorageBuffer[gl_VertexID / 6];
vertex = hardcodedArrayOf6vertices[gl_VertexID % 6];
t. pogeet !!b2oSUmilA2N No.106471433
@Frosch
add this to compendium https://imadr.me/pbr/
Anonymous No.106471629 >>106472183 >>106473937 >>106476467
is Game Engine Architecture 3rd Edition a good book or is there something made for the same purpose i should spend my time on instead
Anonymous No.106471638
descriptors, as they exist today, are a stupid, premature optimization (like everything else in "modern" GPU API).
in it's core, descriptors are literally just
fooDescriptor = CreateFooDescriptor(bar, baz);
foo(fooDescriptor);

instead of just
foo(bar, baz);

you don't need to keep a "descriptor object" around in cpu memory in order to bind a resource, because a gpu descriptor can be generated on the fly.
Anonymous No.106471778 >>106472036
>>106467928 (OP)
It is insane how comfy Odin is for gamedev, and you don't even have to install any third party libraries!
t. pogeet !!b2oSUmilA2N No.106472036 >>106472704
>>106471778
>comfy
>don't even have to install any third party libraries
you pretty much summed up why I shill it.
Some say its the Python on Go.
Anonymous No.106472183 >>106476467
>>106471629
it's good but consider reading the parts you are really interested in, it's pretty long
Anonymous No.106472704 >>106473044 >>106473095 >>106473328
>>106472036
Can you build a webgame with Odin? How about websockets interaction?
t. pogeet !!b2oSUmilA2N No.106473044 >>106473095 >>106473262
>>106472704
>Can you build a webgame with Odin?
yes. By using wasm(odin officially supports it and wasi too), you can port Odin to the web. You can use raylib for grahpics. Here is a template from the guy who wrote the Odin book.
https://github.com/karl-zylinski/odin-raylib-web
Here's another amazing wasm example code with opengl that comes with a demo
https://github.com/thetarnav/odin-wasm
demo : https://thetarnav.github.io/odin-wasm/

official examples:
for a more barebone example
https://github.com/odin-lang/examples/tree/master/wasm/js_wasm32
If you wish to use wgpu(always my personal preference), here are some examples on how with glfw, sdl and microui.
https://github.com/odin-lang/examples/tree/master/wgpu

Basically what's happening under the hood is that you need to have odin.js file and your compiled .wasm fileinside your website directory. Odin.js file has wasm runtime initialization code that also handles Odin's context system. Its a bit bloated but does the job very well. You build your Odin code to a .wasm file, initialize the WasmMemoryInterface class that's inside odin.js file by passing your compiled .wasm file and that's it. This is what index.js files do in the above offical examples.
t. pogeet !!b2oSUmilA2N No.106473095 >>106473262
>>106472704
>>106473044
actually, ignore the first raylib-web example. Its using emscripten and that's a huge bloat.
The second example and official ones are very light and simple comparatively because they use the official language bindings, making them a much better choice of approach for building on web.
Anonymous No.106473262 >>106473274 >>106473302 >>106473305
>>106473044
>>106473095
But raylib is kinda toy, isn't it? OpenGL is where it is at because you have more fine grained control like instancing and VAO's, so the performance can be much better.
Anonymous No.106473274 >>106473328
>>106473262
So can you do it with vendor:OpenGL too?
Anonymous No.106473302 >>106473789
>>106473262
OpenGL has a limited lifespan. Best to learn DirectX or Vulkan
Anonymous No.106473305
>>106473262
raylib is worthless for 3D but perfectly fine for 2D
t. pogeet !!b2oSUmilA2N No.106473328 >>106473765
>>106472704
>How about websockets interaction
ah, forgot about this part. That's gonna take a while because Odin doesn't have an official HTTP 1.1 library that's needed for rfc6455 compliance
>>106473274
>So can you do it with vendor:OpenGL too?
no. The web platform does not support OpenGL itself. It supports a dumbed down version of it(OpenGLES) and calls it "webgl". You need to use WebGL2 instead of OpenGL itself for the web platform. That is exactly what the second example I shared does.
Anonymous No.106473461
>>106458011
the animation should be offset a bit for each tree or something to look even better
Anonymous No.106473530 >>106473668
instead of wrapping the Slang and SPIR-V reflect libraries for the language I'm using I'm just going to call slangc and spirv-reflect through the shell and parse their json/yaml output respectively

what could go wrong?
Anonymous No.106473668
>>106473530
if you distribute the .dll / .so directly it makes it easier for hot reloading shaders during development. It's also probably faster. I'm a glsl slut so using slang is weird but I don't hate it yet

It's also very weird writing shit like
[[vk::binding(0, 1)]]
ConstantBuffer foo: register(b0, space1);


to ensure D3D12 and Vulkan both work correctly, but it does.
Anonymous No.106473765 >>106473857
>>106473328
>no. The web platform does not support OpenGL itself. It supports a dumbed down version of it(OpenGLES) and calls it "webgl". You need to use WebGL2 instead of OpenGL itself for the web platform. That is exactly what the second example I shared does.
Ah shit. Does WebGL2 have the same API at least?
Anonymous No.106473789 >>106473821 >>106485939
>>106473302
>DirectX
proprietary and windows only
Anonymous No.106473821
>>106473789
It's required to support Xbox. It's also good for the resume if you're trying to work in the industry on a rendering position. If you only care about desktop thou then yeah Vulkan is the priority
t. pogeet !!b2oSUmilA2N No.106473857
>>106473765
>have the same API
its pretty much the same
Anonymous No.106473937
>>106471629
I own a copy and I like it. It's a massive book, over 1100 pages. It's very good reference material. Probably not something you're gonna read cover to cover
Anonymous No.106474677 >>106475404
I want to make a game in a LISP-y language just for fun and practice. Would Clojure be a good one for that?
Anonymous No.106474916 >>106475247
why do all d3d12 tutorials wait on fences for frame synchronization and not on swapchain?
Anonymous No.106474936 >>106475001 >>106475218
Progress! It turns out that the bloom shader I've been using has been the source of most of the slowdown. The performance is nearly doubled now, but the game won't have that nice old film/animation flair anymore.
t. pogeet !!b2oSUmilA2N No.106475001 >>106475071
>>106474936
Animations looks amazing either way.
In fact, you did such good job at animations that are the thinned out strokes seem like a thing of the art style.
gz
Anonymous No.106475071 >>106475303
>>106475001
Thanks, that's very reassuring! One interesting problem with it though is that gradients and thin strokes tend to fade away if you zoom in too much. This may be solved by limiting the shader's perceived zoom, then it will look blurry past a certain point instead of smudged.
Anonymous No.106475218 >>106475801
>>106474936
What was the implementation of the bloom shader? High level algorithm is fine you don't have to paste the shader if you don't want to. I'm willing to bet you can keep it if you just optimize the implementation
Anonymous No.106475247
>>106474916
isn't waiting on fence bad for frame pacing?
t. pogeet !!b2oSUmilA2N No.106475303 >>106475801
>>106475071
>that gradients and thin strokes tend to fade away if you zoom in too much
ah, that's a well knows drawback of SDFs. The loss of details is one of the reasons I finalized on rendering vector graphics. Even fonts rendered with SDF texture atlas have loss of quality issues especially at the regions with sharp curves. Fixing or implementing a workaround involves a very complicated solution, making the entire thing very complex to deal with.
I could suggest you to generate a signed distance texture version for all of your animations(not multi-channeled, but a single bytemap version with varying grayness as per the signed distance as shown in picrel) but requirements like gradient colors probably don't offer much performance gains over what your are currently doing.
Gotta see.
Anonymous No.106475404 >>106475429
>>106474677
no
try fennel
t. pogeet !!b2oSUmilA2N No.106475429 >>106475455
>>106475404
>fennel
nah, Janet better
Anonymous No.106475455 >>106475509
>>106475429
this looks transcoded
t. pogeet !!b2oSUmilA2N No.106475509
>>106475455
>transcoded
it takes real guts to use such a thing.
Besides, its meant to be a joke.
Both Fennel and Janet were created by the same author and both of them somehow ended up being amazing.
Its weird.
Anonymous No.106475564 >>106475584 >>106475664 >>106480922
we need to update the op to say "yes you can use any language you want to make a game" and perhaps a summary of glfw / sdl3 / vulkan / dx / metal / webgpu / sdl3_gpu / bgfx. Most posts in each edition of this thread are just

Is $language + $gfx_api a good choice for my first game. And the answer is probably unless your first game is competing with AAA titles. Experiment and see what works for you.
Anonymous No.106475584 >>106475604 >>106475783
>>106475564
can I make a game with software rendering only
t. pogeet !!b2oSUmilA2N No.106475604
>>106475584
yes.
As long as the display is not high-res, it'll be playable as well.
Anonymous No.106475664 >>106475679 >>106475717 >>106475783
>>106475564
>we
better OP isnt going to save this trash general, all the original progress posters have abandoned it, all thats left are attenting seeking retards who reply to every post with gpt slop
t. pogeet !!b2oSUmilA2N No.106475679
>>106475664
>attenting seeking retards who reply to every post with gpt slop
t. pogeet !!b2oSUmilA2N No.106475717
>>106475664
FYI, I didn't reply to the post you replied to, that I'm supposed to as the OP of this thread.
But I'm replying twice to yours just to piss you off.
Anonymous No.106475783
>>106475664
post your game engine

>>106475584
don't ask stupid questions, and with avx512 sure but there's no point and the power usage would be insane
Anonymous No.106475801 >>106475993
>>106475218
It works just like the solution in this link: https://stackoverflow.com/questions/64837705/opengl-blurring
I even scaled down the bloom framebuffer's resolution so that the bloom would be lower quality (which is ok, since it's meant to be blurry) and faster.

>>106475303
Indeed, I'm seeing this first hand. The problem is that the gradients and weak strokes are getting sharper, and it ruins them. There may be a way to fix this however. Some of the RGBA layers get assigned with a multiplicative blending "color", those are always used for shading (helps increase color variety). All I have to do is ignore the multiplication layers, then the outlines and fills will get sharper but the gradients will not.

Ugh, now it looks just like an adobe flash animation. I kind of hope no one plays this game in 4K.
Anonymous No.106475853 >>106475993
>>106469419
>>106470034
>it made a lot of money so that's all that matters and it excuses everything
No, fuck off.
t. pogeet !!b2oSUmilA2N No.106475993 >>106476025 >>106476042
>>106475853
read >>106470251
Its a legit technique with a trade off you don't happen to like.
Even I think 2-frames lag is bad but when the FPS is not capped, its becomes an considerable option.
>>106475801
this is kinda unpleasant to watch.
Facing loss of quality is one thing but its upsetting when the loss of quality results in a bad quality.
Even if I put all my time into my vector renderer development, it'll take a little over a month for it to be usable for your game and a few more for it to become feature full. Gotta see.
Anonymous No.106476004 >>106476081
I realized making engine systems is more fun than making a game
Anonymous No.106476025
>>106475993
>Even I think 2-frames lag is bad but when the FPS is not capped, its becomes an considerable option.
That would be fine if the average modern A-AAA game targeted 120fps+ on normal (e.g. not a 5090) hardware.

The problem is they don't, you'll be lucky to get 60+ (with DLSS) which means 2 frames of latency is ~30ms.
Anonymous No.106476042 >>106476049
>>106475993
I wish you good luck on the vector renderer. Making an engine is hard and sometimes your efforts aren't quite rewarded, but you must never give up.
t. pogeet !!b2oSUmilA2N No.106476049
>>106476042
Anonymous No.106476081
>>106476004
Next you'll realise that making libraries for engine systems is even better
Anonymous No.106476155 >>106476351 >>106478371
>his "engine" doesn't run on the Dreamcast
Anonymous No.106476351 >>106476850
>>106476155
I would have loved to make games for the Dreamcast when it was new. Such cool hardware. Too bad I was busy being 5 years old then.
Anonymous No.106476467
>>106472183
>>106471629
okay cool, that's good to hear. time to dive in.
Anonymous No.106476850
>>106476351
And you weren't already an accomplished programmer by that age? ngmi.
Anonymous No.106476869 >>106478712
>>106467983
If you're not already, check all your error codes, and use glGetError / gluErrorString in the main loop.
Anonymous No.106478371
>>106476155
>his "engine" doesn't run on the Mega Drive
ngmi
Anonymous No.106478712
>>106476869
glGetError only helps with stacktraces for gl debug callbacks (which are helpful). the code itself is cryptic (I only use the code to check for errors during initialization).
the actual errors are shown with the debug callbacks (which is called whenever the callback feels like it, leading to weird stacktraces).
Some gl tutorials have a macro that wraps every single function (the macro is similar to how vulkan validation layers work, I think?, except vulkan validation layers are implemented transparently and errors can be printed by a 3rd party instead of vendor locked with the awkward behavior, but I have heard that validation layers are slower than GL debug callbacks, but that probably depends if you use the macro since glGetError is a sync point, and the vendor).
Anonymous No.106480250
Well I made my uber index buffer and got multidraw indirect working. I don’t see myself keeping this though with the exception of foliage. It requires juggling the index buffer which can change whenever. My architecture just isn’t ready for that kind of abstraction yet.
t. pogeet !!b2oSUmilA2N No.106480922
>>106475564
Yes.
We seriously could use a a /gedg/ FAQs.
It'll take a while since there are a lot of questions to cover.
Anonymous No.106480949 >>106480990 >>106481047 >>106481329 >>106482018 >>106482070 >>106484135
Actually an interesting question: how far could we push software rendering today if we don't want to push realistic graphics? I guess the main problem is resolution having increased by an order or magnitude (and most people expect to run at native).
t. pogeet !!b2oSUmilA2N No.106480990 >>106481031
>>106480949
MoΠΉ Π΄pyΠ³ Π·oΠ·Π·ΠΈΠ½Π³ Π·aΠ±Ρ‹Π» Ρ‡Ρ‚o CRT-Ρ‚eΠ»e ΠΌepΡ‚Π²Ρ‹.
t. pogeet !!b2oSUmilA2N No.106481031
>>106480990
oops.
I meant my friend zozing forgor that CRT monitors are dead.
Anonymous No.106481047 >>106481999
>>106480949
>how far could we push software rendering today
you might be able to get basic 3D running at 60 fps on a 2k resolution but not much more than that
Anonymous No.106481310 >>106481424 >>106481979
how do you guys do multithreading? I have been reading up on it for days now but it all feels like dogshit once you need your threads to share data and ping pong some objects. Any suggestions for c++/c#? Mostly trying to build a toy parallel model of the dungeon sim I have..
Anonymous No.106481329
>>106480949
pretty sure thats not going to work because of the "high" resolution we use nowadays. Doing something in 360p is much faster than 1080 or 2k.
Anonymous No.106481424
>>106481310
I have one main thread and a thread pool, the main thread can throw a list of jobs at the thread pool and it will distrubute the jobs amongst the threads until they're all done
I use this for stuff like simulation, I have hundreds of discrete maps all simulating at once, so I each map update can be a threaded job. If you have a dungeon sim maybe you could do one job per floor
Also do it for animation where it splits animation jobs up
This isn't the most efficient model because there's still sync points but it's by far the simplest because you don't really have to change your architecture from a single threaded model at all
Anonymous No.106481979
>>106481310
multithreading is cope for poor optimization
single thread is enough if you're not retarded
Anonymous No.106481999 >>106482037 >>106482094
>>106481047
4k is only 81x of the pixels of 360p and today's cpus are like 1000x faster then the 1990s ones
Anonymous No.106482018 >>106482042 >>106482094
>>106480949
I never really understood this. Dealing with multithreading is more annoying than dealing with graphics APIs. Not to mention having to write your own rasterization code, and having to use a bloated math library instead of a kino succint shader lang.
t. pogeet !!b2oSUmilA2N No.106482037 >>106482170
>>106481999
>4k is only 81x of the pixels of 360p
yeah, sure.
Shit goes down when that 81x of pixels have to be dealt with for at least 60 times per second.
Modern CPUs are gonna struggle just for displaying the output.
Running a bloated OS like windows on top of it might truly put the PC on fire.
Anonymous No.106482042 >>106482095
>>106482018
>Dealing with multithreading is more annoying than dealing with graphics APIs.
Have you tried D12/Vulkan?
>write your own rasterization code
Graphics APIs and libraries didn't spontaneously spring out of the ground.
>kino succint shader lang.
HLSL/GLSL are about as far from "kino" as it gets.
Anonymous No.106482070
>>106480949
Not an interesting question at all. This guy's a midwit.
Anonymous No.106482094
>>106481999
>cpus are like 1000x faster then the 1990s ones
No, they're only about 10 times faster

>>106482018
It appeals to the "just do everything yourself" crowd but there really is no practical application of software rendering, he is a midwit
Anonymous No.106482095 >>106483387
>>106482042
>HLSL/GLSL are about as far from "kino" as it gets.
XMVECTOR v3 = XMVectorSet(1.0f, 2.0f, 3.0f, 0.0f);
XMVECTOR v4 = XMVectorSet(10.0f, 20.0f, 30.0f, 40.0f);
XMVECTOR v4_zyx = XMVectorSwizzle<2, 1, 0, 3>(v4);
XMVECTOR result = XMVectorAdd(v3, v4_zyx);
XMFLOAT3 output;
XMStoreFloat3(&output, result);

>kino
vec3 v3 = vec3(1., 2., 3.);
vec4 v4 = vec4(10., 20., 30., 40.);
vec3 result = v3 + v4.zyx;

>not kino
Sure anon, whatever makes you happy
Anonymous No.106482170 >>106482203 >>106482208 >>106482210 >>106482216
>>106482037
>Modern CPUs are gonna struggle just for displaying the output.
Literally skill issue. My software renderer renders to screen at 4k120fps on a single thread without problem.
Anonymous No.106482203 >>106482289
>>106482170
how are you actually writing to a framebuffer with a "software renderer?"
Anonymous No.106482208 >>106482289
>>106482170
>4k120fps
You're gonna need to post some proofs, that's a lot of pixels.
Anonymous No.106482210 >>106482229 >>106482289
>>106482170
your software renderer renders 8 million pixels at 120 fps on a single thread huh
t. pogeet !!b2oSUmilA2N No.106482216 >>106482289
>>106482170
the fact that you failed to mention what kind of game it is makes it obvious that its a dead simple one so rending a handful of quads over a blank screen might be doable but still, very unlikely.
Anonymous No.106482229 >>106482234
>>106482210
the only way I see it possible is if he's got really low damage rects or something and only needs to twiddle a fraction of those pixels per loop.
Anonymous No.106482234
>>106482229
It's not possible, he just made it up
Anonymous No.106482246 >>106482261 >>106482270
>retards instantly take the bait
I'm sure he also didn't use any of that there SIMD bloat
t. pogeet !!b2oSUmilA2N No.106482261
>>106482246
>SIMD bloat
he'd have mentioned it if he did because that's a lot of work to even accidentally forget.
Anonymous No.106482270 >>106482284
>>106482246
>retards instantly take the bait
trolling is against the rules, retard.
Anonymous No.106482284
>>106482270
>If it's illegal then no one can do it
Gun owners BTFO
Anonymous No.106482289 >>106482305 >>106482321 >>106482352
>>106482203
There are ways to render images to window without any 3D API in all of the platforms. Things like bitblt. Of course β€œgamedevs” know none of these since you’re coaxed into thinking 3D APIs are the only way of rendering.
>>106482208
>>106482210
>>106482216
It just a simple program that moves a 4k image around in the window. You said CPU is too slow for even simple things like this.
Anonymous No.106482305 >>106482314 >>106482334
>>106482289
>It just a simple program that moves a 4k image around in the window
That's not what a software renderer is, that's just software
Anonymous No.106482314 >>106482323
>>106482305
It is β€œdisplaying the output” just like the post I replied to said.
Anonymous No.106482321 >>106482385
>>106482289
>Of course β€œgamedevs” know none of these since you’re coaxed into thinking 3D APIs are the only way of rendering.
software rendering is too slow to be practical so that's basically true
drawing a single image is the best case scenario because you can get 100% usage out of SIMD but even then that's still a million operations, it's really slow
Anonymous No.106482323 >>106482334
>>106482314
I agree with your response as it pertains to the post you replied to, but you opened up a new conversation by calling it a "software renderer"
Anonymous No.106482334 >>106482380
>>106482305
>>106482323
The program does blitting with color conversion so it’s definitely a 2D renderer, even a minimal one. A 2D renderer is like this just with lots of sprites.
I have never claimed my software renderer is 3D.
t. pogeet !!b2oSUmilA2N No.106482352
>>106482289
>You said CPU is too slow for even simple things like this
Anonymous No.106482380 >>106482452
>>106482334
https://en.wikipedia.org/wiki/Software_rendering
Anonymous No.106482385 >>106482394 >>106482441 >>106482504 >>106482520
>>106482321
It is practical for 2D. there are several 2D games released with software renderer, I saw one that in practice achieves 1440p 60fps with real gameplay and graphics running.
Anonymous No.106482394 >>106482434
>>106482385
It's possible but it's not practical
Anonymous No.106482434 >>106482438
>>106482394
Define β€œpractical”.
Anonymous No.106482438
>>106482434
You are paying a huge performance cost for no reason at all
Anonymous No.106482441 >>106482449
>>106482385
>It is practical for 2D
it isn't practical at all.
hardware accel 2d graphics libraries are easy as fuck.
2D web
skia
etc.

it'd be more work to make a CPU renderer that isn't complete shit. It's utterly ridiculous to think people ITT are actually fucking drawing pixels with a CPU. not even old timey game hardware was this fucking primitive. wtf?!
Anonymous No.106482449 >>106482457
>>106482441
>not even old timey game hardware was this fucking primitive
it was how it was done before 3d accelerators
Anonymous No.106482452 >>106482560
>>106482380
Wikipedia definition is retarded as usual. So anything that’s not 3D isn’t β€œrendered” even when the final image comes from several background and overlay layers and sprites?
Anonymous No.106482457 >>106482465 >>106482478
>>106482449
no, it wasn't. you had special hardware for transforming bitmaps. maybe if we go really really really far back.
Anonymous No.106482465 >>106482475
>>106482457
not on PC you didn't
Anonymous No.106482475 >>106482482
>>106482465
I mean, what "PC?" for one.
even shit like drawing text was done with "special hardware" and texture atlases of bitmap fonts.
Anonymous No.106482478 >>106482520
>>106482457
And these β€œspecial hardware” are so limited that developers back then practically software render lots of effects themselves.
Anonymous No.106482482
>>106482475
normal PCs, IBM compatibles
Anonymous No.106482504
>>106482385
>I saw one that in practice achieves 1440p 60fps with real gameplay
What game?
t. pogeet !!b2oSUmilA2N No.106482520
>>106482385
>1440p 60fps
maybe but 4k120fps with only a single thread is just impossible.
>>106482478
ROM magic
Anonymous No.106482560
>>106482452
>So anything that’s not 3D isn’t β€œrendered” even when the final image comes from several background and overlay layers and sprites?
Yeah, that's pretty much just compositing
Anonymous No.106482728 >>106482740 >>106484766
If it was actually possible to do real time software rendering with advanced graphics in 2025 people would be doing it instead of dealing with the cluster fuck that is the current state of graphics APIs. Just admit you hate working with them instead of making up lies that you can do cutting edge graphics in real time at 144hz1440p. It's NOT possible, it will never be possible.
Anonymous No.106482740 >>106482789 >>106483002
>>106482728
It's possible it's just really slow and not really any easier than using hardware
Anonymous No.106482789
>>106482740
Then practically not possible?
Anonymous No.106482803 >>106483002
https://registry.khronos.org/vulkan/specs/latest/man/html/VkPipelineStageFlagBits2.html
https://registry.khronos.org/vulkan/specs/latest/man/html/VkAccessFlagBits2.html
kinda crazy that GLbabies think they can let the driver handle all of this and still write performant code
Anonymous No.106483002 >>106483011
>>106482740
>uh akshually it's possible to get 45fps on a $10,000 threadripper so you're wrong
cool why even make this post other than to be a contrarian? software rendering for game development is not wide spread for a reason. The only time I ever use software rendering is in CI/CD when I want to test the correctness of generating a single frame and I don't care about performance.

>>106482803
Vulkan is honestly easier than OpenGL to me because the second you fuck up the validation layers spit out a novel explaining what you did wrong. It's only hard until you build the initial abstraction for your project.
Anonymous No.106483011 >>106483027
>>106483002
>The only time I ever use software rendering is in CI/CD when I want to test the correctness of generating a single frame and I don't care about performance.
What the fuck are you even talking about
Why would you write an entire software renderer just to do this?
Anonymous No.106483027 >>106483036
>>106483011
I don't, we have shit like llvmpipe / swiftshader. I said I "use software rendering", not "I write a software renderer". Reading comprehension anon.
Anonymous No.106483036 >>106483056
>>106483027
ok why would you use an entire software rendering library just to do this?
Anonymous No.106483056 >>106483072 >>106483081
>>106483036
If you're running integration tests for your game on a cloud server or some other headless device without a GPU it's a requirement. It's overkill for most devs but big studios do something similar, e.g you want to test that modifying a shader doesn't break mac / windows / linux / switch / xbox / android simultaneously without manually testing all those platforms every commit.
Anonymous No.106483072 >>106483133
>>106483056
>If you're running integration tests for your game on a cloud server or some other headless device without a GPU
why would you be doing this? you have your own computer
Anonymous No.106483081 >>106483090
>>106483056
I'll also add that you can use it to verify correctness of your rendering implementation. In particular with NVIDIA vs AMD, NVIDIA tends to be more permissive of UB, so I've ran into situations where testing on NVIDIA is fine, and then the game runs on another amd gpu and explodes. You should try to test your game on as many vendors as possible to catch platform bug and shitting out a single frame in software can help with that.
Anonymous No.106483090 >>106483133
>>106483081
How is rendering in software going to help you catch a hardware bug?
Anonymous No.106483133 >>106483148
>>106483072
To make sure it works well on devices other than your test machine. The game could be perfect on your machine and then a stuttery mess for others.

>>106483090
Because if you're running the same test on AMD,NVIDIA, and llvmpipe or swiftshader you get multiple points of data to compare to. If the same error appears in all renders its probably your fault. If the error only appears on one vendor, then there is a chance you are relying on UB, or there is a driver bug on that vendor. And with that information you get better clarity on where to look. It's called "debugging"
Anonymous No.106483148 >>106483221
>>106483133
When you are writing graphics code you have a machine with a GPU and your code works on that machine
When it fails on another machine, you debug it using your home build as a reference
Why do you need a software renderer?
Anonymous No.106483221 >>106483243
>>106483148
I literally just said, so you can have automated testing without a physical gpu, like on a vps. Swiftshader is literally just putting the dynamic library into the executable path, and then telling Vulkan to use the CPU instead of the GPU. The rest of your code doesn't change, its not a big commitment to setup and anyone can do it. Now you can instantly check if errors rendering a frame are gpu specific or not. You don't actually release the game with this dll because it would run at a snails pace, its a debugging tool only. You sound slow because you keep asking variations of the same question.
Anonymous No.106483243 >>106483265
>>106483221
Your answers do not make sense and it sounds like you're making shit up
The software renderer will have its own bugs, it is not a single source of fruth, it's just another target (a totally artifical one)
Nobody at game studios is ever lacking a machine with a GPU to test on
I've never heard of anyone doing this before
Anonymous No.106483265 >>106483272
>>106483243
>I've never heard of anyone having basic bitch testing in code bases ran by CI to make sure retards don't push broken shit.
literally what the fuck?
Anonymous No.106483272 >>106483279
>>106483265
I have, but they don't use software rendering because every computer has a GPU
Anonymous No.106483279 >>106483284
>>106483272
and on a computer that does release builds that doesn't have a GPU?
Anonymous No.106483284 >>106483298
>>106483279
I said every computer has a GPU
Anonymous No.106483298 >>106483300
>>106483284
kek, no they don't. wtf?
Anonymous No.106483300 >>106483319 >>106483392
>>106483298
They do in game development buddy
Anonymous No.106483319 >>106483327 >>106483339 >>106483392
>>106483300
Literally not true, though. Headless machines built for compiling wouldn't have a GPU
Anonymous No.106483327 >>106483350 >>106483373
>>106483319
I don't think you've worked in game development
Do you think every graphics API has its own software emulator that people debug on?
Anonymous No.106483339
>>106483319
He's retarded anon stop arguing with him.

"REAC 2024 DAY 1 Testing Rendering Code at Frostbite" is a cool video for any anons who are interested in setting up automatic testing for their rendering pipelines.
Anonymous No.106483350 >>106483413
>>106483327
...anon, you're actually retarded.
Anonymous No.106483373 >>106483401 >>106483453
>>106483327
https://learn.microsoft.com/en-us/windows/win32/direct3darticles/directx-warp#enabling-rendering-when-direct3d-hardware-is-not-available
Anonymous No.106483387 >>106484197
>>106482095
um nigger you know you can just XMVectorset(1, 2, 3, 4); and you know that XMVECTOR doesnt exist in hlsl, in hlsl thats a float4
t. pogeet !!b2oSUmilA2N No.106483392
>>106483300
yes, and that is why software rendering is dead for real time video games developed for desktop PC hardware.
But VFX studios have been doing software rendering way before RTX graphics cards came out and most studios are still relying on offline rendering for high precision .
>>106483319
true.
Serves well for crypto mining or servers. Maybe for offline rendering too.
Anonymous No.106483401 >>106483465
>>106483373
I'm talking about the propietary console APIs
Anonymous No.106483413 >>106483465
>>106483350
Not as retarded as the guy who introduced a new, totally artificial target to test on for no reason when you've got perfectly good hardware to do it on right there
Anonymous No.106483453
>>106483373
The guy is this video literally talks about having a farm of hardware with various GPUs to test on which is exactly what I was saying
Anonymous No.106483465 >>106483497
>>106483401
D3D12 is a proprietary console API supported by WARP. Microsoft literally reiterates the use case I just said:

> Ideally, graphics drivers would be perfect pieces of software, but in the real world, drivers or even GPUs can have bugs or quirks. By supporting a trivial switch to run on WARP, it can let developers or users try to isolate unexpected behaviors to determine whether they're coming from their own code or from the underlying graphics driver. There are also places where API specifications allow undefined behavior, which can take different forms across different vendors or generations of hardware, and WARP can help provide a more deterministic or debuggable result in some cases.

>>106483413
>totally artificial target
What does that even mean, it's a conforming software implementation of Vulkan, if you use the API correctly you will get the correct frame generated with it, albeit very slowly. And like I said you try to test on as many vendors as possible. You test with software for correctness, you test on multiple real gpus from different vendors for performance and correctness. The point is to ensure your software is robust as possible, using llvmpipe or swiftshader or warp is purely for dev benefit and not something you expose to users. It does not preclude you from testing on hardware. I cannot make this any clearer for your retarded ass. A normal person would say: "Oh I understand cool but I still don't want to do it." And not dig their heels in and insist because they've never heard of it, it must not be real, and everyone is a liar.
Anonymous No.106483497
>>106483465
I'm not saying I don't want to do it, I'm saying I don't understand
How do you know you'll get a correct frame with swiftshader? It's its own piece of software that's going to have its own bugs just like other targets will have their own bugs you have to figure out aswell
Anonymous No.106484135
>>106480949
>how far could we push software rendering today
Pretty far actually, check this out
https://www.youtube.com/watch?v=s-fTSUsuyls
https://www.youtube.com/watch?v=jF3BAPIAXW0
Anonymous No.106484197 >>106484257
>>106483387
>XMVECTOR doesnt exist in hlsl,
Yeah that's the point retard, in shader langs you don't need to jump through hoops to get SIMD and vector math.
>in hlsl thats a float4
Are you a unityfag posturing as a graphics programmer? You've never seen GLSL before?
Anonymous No.106484257 >>106484341
>>106484197
nta
>calling anyone a unity fag over using the industry standard derivative of cg shaders, as popularized by nvidia, microsoft, sony, and every major engine ever

Please god, allow for mere single day for there to be a thread that isn't just a containment zone for self-projecting street shitting invaders. Does anything ever happen in this shithole?
Anonymous No.106484341
>>106484257
>using
You are a dishonest retard, that anon tried to "correct" me for posting glsl code, completely unaware of its existence. I never said anything about using one language or the other, he literally didn't recognize "vec3" as valid shader code and is larping as something other than a turbonoob
Anonymous No.106484766
>>106482728
You can it’s called DLSS. I’m able to play Black Ops 6 on extreme settings at 1440p with DLSS.
Anonymous No.106484810
>>106469177
Nah, write your own engine instead.
Anonymous No.106485377 >>106485411 >>106485689 >>106486584
Got a good idea for a clickbait headline to Vulkan tutorial: "All other Vulkan tutorials are WRONG"
Thumbnail image is a big red arrow pointing to the Hello World RGB triangle with an X mark over it.
Semi tongue in cheek but the thesis is that rendering a triangle to the screen is not actually the Hello World of Vulkan, copying data between buffers is. Before you even touch shaders you should thoroughly understand how to efficiently schedule a graph of memory transfer operations involving buffers/images. Then you can do compute and after that graphics. This is the most natural pedagogical progression I've come up with but I've never seen it proselytized.
Anonymous No.106485411 >>106485622
>>106485377
How many lines to first triangle?
Anonymous No.106485552 >>106485669
bros... i still cant beat vulkan....
Anonymous No.106485622
>>106485411
For me, it was 1300 or so.
Anonymous No.106485643
>learning mvvm is painful spaghetti
how the fuck do people keep track of the flow of data when everything is hidden from you?
Anonymous No.106485669
>>106485552
I just hate how all tutorials I've found don't explain the actual workings. It's just "uhh yeah we copy the images to the swapchain so we can swognle it". What's a swapchain? How does it work? What does the copy image function actually do?

This was the exact same issue as with programming tutorials when I started learning programming. I suspect most people who make these tutorials don't really know how thinks actually work themselves.
Anonymous No.106485689
>>106485377
It's called "Hello Triangle", not "Hello World of Vulkan"
Stop smoking so much god damn weed and get back to fucking work already.
Anonymous No.106485939
>>106469178
I did it. Here's my progress


vector>> insertionNodes;
for (auto const& model : worldGeometry)
{
for (auto const& mesh : model.m_mesh)
{
insertionNodes.push_back(make_pair(mesh.m_boundingBox, mesh.m_mesh.get()));
}
}
auto tree = BVH::BuildTree(insertionNodes.data(), insertionNodes.size());


>>106473789
>proprietary and windows only
Windows is the only PC platform that matters for games. Linux users can use Proton and mac users can go out and buy a real computer
Anonymous No.106486577 >>106486714 >>106486813
I kinda feel hyped guys. I wanted to dive into graphics programming a while ago, but I'm feeling more inclined focusing only on gamedev for a while.
I'm writing a breakout clone with odin + raylib for now. Slowly picking it up!
Anonymous No.106486584 >>106486776
>>106485377
Vkguide has it right. The hello world world of Vulkan is a clear image.
Anonymous No.106486714 >>106487618
>>106486577
Hell yeah brother! Break them bricks!
Anonymous No.106486776
>>106486584
Clear image is simply a special case of a memory transfer (vkCmdBlitImage)
Anonymous No.106486813 >>106487618
>>106486577
Cool, have fun. Gamedev is lots of fun.
Anonymous No.106487600
>qwen3-code can generate imgui debug window functions
very based, very useful for rapid development
Anonymous No.106487618
>>106486813
>>106486714!
Thanks anons!
Anonymous No.106488145 >>106488346 >>106489771
neat shader thing
Anonymous No.106488346
>>106488145
Cool.
Anonymous No.106488654 >>106488689 >>106488705 >>106488909
How do I convert this
#include
#include

int main(int argc, char* argv[]) {
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
return 1;
}

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);

SDL_Window* window = SDL_CreateWindow(
"Triangle",
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
800, 600,
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN
);

if (!window) {
SDL_Quit();
return 1;
}

SDL_GLContext glContext = SDL_GL_CreateContext(window);
SDL_GL_SetSwapInterval(1);

int running = 1;
SDL_Event e;

while (running) {
while (SDL_PollEvent(&e)) {
if (e.type == SDL_QUIT)
running = 0;
}

glClearColor(0.f, 0.f, 0.f, 1.f);
glClear(GL_COLOR_BUFFER_BIT);

glBegin(GL_TRIANGLES);
glColor3f(1.f, 0.f, 0.f);
glVertex2f(-0.5f, -0.5f);

glColor3f(0.f, 1.f, 0.f);
glVertex2f( 0.5f, -0.5f);

glColor3f(0.f, 0.f, 1.f);
glVertex2f( 0.f, 0.5f);
glEnd();

SDL_GL_SwapWindow(window);
}

SDL_GL_DeleteContext(glContext);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}

into vulkan?
t. pogeet !!b2oSUmilA2N No.106488689 >>106488705
>>106488654
you should replace SDL_WINDOW_OPENGL with SDL_WINDOW_VULKAN to tell sdl that you wish to use vulkan and remove all the OpenGL related stuff(basically, anything with _GL* in the name)
The rest, you can proceed normally as you would.
t. pogeet !!b2oSUmilA2N No.106488705
>>106488654
>>106488689
there are only a handful of Vulkan related calls https://wiki.libsdl.org/SDL3/CategoryVulkan
and as per the docs,
> Use SDL_Vulkan_GetInstanceExtensions() to get platform-specific bits for creating a VkInstance, then SDL_Vulkan_GetVkGetInstanceProcAddr() to get the appropriate function for querying Vulkan entry points. Then SDL_Vulkan_CreateSurface() will get you the final pieces you need to prepare for rendering into an SDL_Window with Vulkan.
is all you gotta do.
Anonymous No.106488909
>>106488654
This is bait so when someone posts the 1000 line triangle example you can complain and say it's bloat. We are onto your tricks.
Anonymous No.106488968 >>106489360
How do I create and manage these so called β€œhandles” for bindless resources? I know people fancy unordered_map but all my stuff meshes, textures, materials are in vectors and needs to be in such container for Vulkan purposes (mainly textures). I import a gltf on startup but obviously deleting and changing things would break everything without some kind of handle system to properly guide resources to each other.
t. pogeet !!b2oSUmilA2N No.106489360 >>106489634
>>106488968
>all my stuff meshes, textures, materials are in vectors and needs to be in such container
Vulkan resource handles are mostly uint64_t values.
Your graphics drivers implicitly creates and maintains the memory for your resource via a dispatch table that is present within a dispatchable handle. That is why we need to pass a dispatchable handle like VkInstance or VkDevice everytime we deal with their respective non-dispatchable handle for creation, destruction and all other operations. We do not have control over this memory.
We only need to bother with how our application manages the raw bytes of texture images or buffer data. That's the only thing within our control.
>deleting and changing things would break everything without some kind of handle system
just rely on tress for it.
N-ary tree are very easy to implement and use as a scene graph. You can just allocate and deallocate memory recursively for your resources in the scene graph when you add or remove a node.
Don't think of it as an handle system. Its not good for performance. Our graphics drivers already maintain a dispatch table, it is not optimal but works well as a generalized solution and we do not have to resort to such means for our application as well.
Anonymous No.106489634 >>106489641 >>106490288
>>106489360
I’m talking about the application layer. How can I reference objects to each other other than their raw index? My scene nodes perceive their child mesh as an index in the large meshes array and have nothing else to go off of, if that array changes it would break the nodes.
Anonymous No.106489641 >>106490288
>>106489634
then you need a lookup table that can take a handle and resolve it to the array index
Anonymous No.106489771 >>106491312
>>106488145
neat. voronoi algorithm? I was working on something similar recently for world map generation (colour clipping zones and geometry are two intersecting voronoi grids)
t. pogeet !!b2oSUmilA2N No.106490288
>>106489634
then the simplest solution is as mentioned by >>106489641, which is kind of what the dispatch table is.
Or you could manually manage the memory of objects within an arena(this is what I do) and take care of fragmentation and alignment yourself while performing allocations, deallocations and updating the slices/pointers referring to the arena in the scene graph.
Its a bit more complex but this operation will only will be done once when the scene graph is updated while the lookup table will be called every frame. So choose for yourself.
Anonymous No.106490389 >>106491204 >>106491248
Did any of you guys get any takedown notices because you used copyrighted/non-free sfx in your commercial games? What is the general consensus on sfx usage free/non-free.

I'm not talking about music, just generic sounds like gunfire or door opening. Can/do companies really go after indie devs or there's a popularity/money made off of it threshold below which you're safe?
Anonymous No.106491204
>>106490389
Maybe? Didn't Roblox have to remove their "oof" sfx because they sampled it from an old game called Messiah?

I think I might just use AI for sfx.
t. pogeet !!b2oSUmilA2N No.106491248
>>106490389
This is how I put sfx in my games
*pew pew*
https://www.youtube.com/watch?v=d4cLCopfa-s

Can/do companies really go after indie devs or there's a popularity/money made off of it threshold below which you're safe?
that entire depends on how the company in question wishes to proceed so there is no one answer to that.
Honestly, just record punching an A4 paper as if you want to make a hole in it like in never back down 2 movie. Then fire up a DAW like Reaper, trim, high pass filter and boost. That will be good enough.
You can also just get some sound from a royalty-free game sound effects, google search will pop up a few.
Anonymous No.106491312
>>106489771
that's probably how it was originally generated, but I'm just using 2 premade textures from:
https://screamingbrainstudios.itch.io/noise-texture-pack

and doing some math with them
Anonymous No.106492439
Bump. Currently overhauling my level editor.
Anonymous No.106493041 >>106498406 >>106498585 >>106498689
how do i profile my vulkan code programmatically (not with stuff like renderdoc)
Anonymous No.106493582 >>106493621 >>106493679 >>106498411
Best 208 pages of my life.
Anonymous No.106493621
>>106493582
What a sad life ...
t. pogeet !!b2oSUmilA2N No.106493679
>>106493582
>208 pages
>covers basics
>barely touches algebraic geometry
meh
Anonymous No.106495125 >>106495151 >>106495290 >>106495362 >>106497772 >>106498337
wagm
Anonymous No.106495151
>>106495125
Stuff like this reminds me the world is full of people would go out of their way to keep you down.
Anonymous No.106495290
>>106495125
that's like winning the lottery, bru
Anonymous No.106495362
>>106495125
I agree with the statements and won't play it.
Anonymous No.106495512 >>106495603 >>106495795
just adding audio to my engine. pretty boring, but needs to be done. I am going with OpenAL + ogg + opus or vorbis (haven't decided yet).
Anonymous No.106495603 >>106495733 >>106495795
>>106495512
I'm using SDL_mixer. It's a bit disappointing because there's no way to put loop points afaik. If there's a better one lying around please tell me. Preferably something that also supports .mod files.
Anonymous No.106495733 >>106495777 >>106495795
>>106495603
OpenAL is all I ever used, so I can't compare it to anything else. I experimented with OpenSL a bit, but ultimately went with OpenAL. it's very basic, but has some basic 3D sound stage support. it can loop samples, but I don't think you can add custom looping points. it doesn't do any audio files loading, so you would need to use something else for mixing mods to PCM.
Anonymous No.106495777
>>106495733
Ah, I see. That's too bad.
Anonymous No.106495795 >>106495844
>>106495512
>>106495603
>>106495733
>game engine development thread
>not writing your own audio mixing and looping engine
ngmi
Anonymous No.106495844
>>106495795
I'm not a music autist sadly. Wish I had the time to learn that properly. Studio Pixel might be the only developer I know that created the audio system from scratch.
Anonymous No.106496719 >>106497396
Just changed my renderer to use reverse-z with an infinite far plane setup. All my flickering disappeared instantly. Is this going to bite me in the ass? seems too good to be true.
Anonymous No.106497301 >>106497390
https://docs.vulkan.org/spec/latest/chapters/formats.html
why are there so many
Anonymous No.106497312 >>106497390 >>106497435 >>106497460 >>106498396
VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 specifies a three-component, 32-bit packed unsigned floating-point format that has a 5-bit shared exponent in bits 27..31, a 9-bit B component mantissa in bits 18..26, a 9-bit G component mantissa in bits 9..17, and a 9-bit R component mantissa in bits 0..8.

nigga WHY
Anonymous No.106497330 >>106497390 >>106497648 >>106497849
why is this thread 90% Vulkan and rendering discussion
t. pogeet !!b2oSUmilA2N No.106497390
>>106497301
>>106497312
this is why
https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html
things are more complicated than they seem.
>>106497330
Blame Khronos for not updating OpenGL specs since 2017
Anonymous No.106497396
>>106496719
So let's think this through a bit, you only have a 5 bit exponent, so -16 to 15, assuming that each component of your vector are within those orders of magnitude, you can scale the mantissa values such that you can find a common exponent between all three components using 9 bits each, you've now reduced your size by 66% versus using three separate 32-bit floating point values.
Anonymous No.106497435
>>106497312
So let's think this through a bit, you only have a 5 bit exponent, so -16 to 15, assuming that each component of your vector are within those orders of magnitude, you can scale the mantissa values such that you can find a common exponent between all three components using 9 bits each, you've now reduced your size by 66% versus using three separate 32-bit floating point values.
Anonymous No.106497460
>>106497312
sometimes you know that your floats are going to be always-positive (e.g. color), and that storage precision doesn't matter too much, so you pick a smaller datatype to optimize.
Like, a 1080P screen has two million pixels, so doing this takes you from a 6MB buffer to a 2MB buffer, and then any post processing done on this buffer has much better cache performance
Anonymous No.106497598 >>106497640 >>106497648 >>106497779 >>106498585
How would I go about making this type of background? I'm making my own engine with C++ and SDL, and I know basically nothing about shaders.
Anonymous No.106497640 >>106497661 >>106498033
>>106497598
SDL doesn't give you access to shaders, so the first thing is to learn how to set up an OpenGL context in SDL. In which case, go to learnopengl.com to learn how to set them up. I'm sure you can find something on shader toy that is close to this.
Anonymous No.106497648 >>106497659
>>106497598
voroni noise + blur + blending, checkout creative coding tutorials there are a bunch of shadertoy and processing examples of this shit

>>106497330
because rendering is so hard I think most game devs get here and then never move on. Personally I only give a shit about real time graphics programming and not game engines but there is enough overlap I post here.
Anonymous No.106497659 >>106497696
>>106497648
>rendering is so hard
It's not, you're literally just following tutorials to do what everyone else has done 100 times before
But I suppose that does filter people because they do it first and never get to the interesting part
Anonymous No.106497661 >>106498033
>>106497640
SDL3_GPU supports shaders now. If he's using that. It's just a wrapper around D3D12 / VK / Metal and you have to supply the DXIL / SPIRV / Metalshader yourself.
Anonymous No.106497696 >>106497708
>>106497659
It is hard once you get past the tutorials and have to actually implement novel shit yourself. There are no tutorials for when you start implementing novel shit. This is a stupid take in general, all programming work can be reduced to "well someone has written about how to do this before so it can't be hard". Combining written resources and tutorials to create new things is the hard part and the skill. Spoken like someone who has never had to debug a black screen in their 3D app in their life.
Anonymous No.106497708 >>106497756 >>106497764 >>106498585
>>106497696
Nobody is implementing novel shit though they're all making my first renderer
Anonymous No.106497756 >>106497759
>>106497708
I am though?
Anonymous No.106497759 >>106497873
>>106497756
What are you making?
Anonymous No.106497764 >>106497783
>>106497708
That's proof that 3D rendering is hard. If everyone could get a fancy rendering engine with proper gi going the thread would be filled with pics of them.
Anonymous No.106497772
>>106495125
it is a shitgame though
Anonymous No.106497779 >>106497794 >>106497804
>>106497598
some kind of noise function
some kind of distortion function
yadda yadda there are a million examples on shadertoy
the limit of the probability that you re-create it exactly approaches zero with the inverse of the number of years you spend learning hacky shader maths
Anonymous No.106497783 >>106497828
>>106497764
That's because the thread sucks and nobody competent posts here not because it's hard
Anonymous No.106497794
>>106497779
This is just the background of the balatro screen. It's not open source but the developer of it didn't put any drm in the game (because he's based) so you can just unzip balatro.exe and see what shader fuckery he did
Anonymous No.106497804
>>106497779
>the limit of the probability that you re-create it exactly approaches zero with the inverse of the number of years you spend learning hacky shader maths
i don't understand this at all
Anonymous No.106497828 >>106497838
>>106497783
ok anon, what's the cool rendering technique you've been working on then?
Anonymous No.106497838 >>106497869 >>106498585
>>106497828
I only made a bog standard renderer, I'm not interested in rendering I'm interested in games
Anonymous No.106497849 >>106497869 >>106498595
>>106497330
vulkan has ruined everything
Anonymous No.106497869 >>106497880
>>106497838
You don't think rendering is hard because you're not trying to do anything interesting.

>>106497849
Vulkan itself is not hard. Generating pretty graphics in real time is.
Anonymous No.106497873 >>106497880
>>106497759
Some of the things I did that I couldn't find a tutorial on:
>manually manipulate mipmap textures, including saving them as external files
>getting instancing to work on a web build
Anonymous No.106497880 >>106497897
>>106497869
I never said rendering wasn't hard, following opengl / vulkan tutorials to make your first renderer is not hard

>>106497873
that's easy
Anonymous No.106497897 >>106497911
>>106497880
Ok, then. What's something that's not easy? What are you working on?
Anonymous No.106497911 >>106498005
>>106497897
Someone mentioned GI, that's probably not easy
Working with different mip levels is literally just another parameter in texture operation functions and it's right there in the documentation
Anonymous No.106498005 >>106498015
>>106497911
Lots of things in OpenGL seem easy until the details bite you on the ass and you get a black screen. In short, I was trying to get a tilemap to work flawlessly with mipmaps, getting the bugs fixed on that was a nightmare.
Anonymous No.106498015 >>106498038
>>106498005
let me guess, you were having issues with the edges of tiles bleeding the wrong color
Anonymous No.106498033 >>106498052 >>106498111
>>106497640
>SDL doesn't give you access to shaders, so the first thing is to learn how to set up an OpenGL context in SDL.
My game is already well into development using SDL's built-in renderer. Switching to OpenGL at this point would be impossible (especially since I barely know anything about OpenGL).
>>106497661
It's SDL2.
Anonymous No.106498038 >>106498045
>>106498015
Yep. It works flawlessly now. I would even say elegant if it wasn't for this mysterious bug where small enough tile sizes causes mipmaps to shit themselves and whine and moan. Just annoying as shit, I'm glad it's over.
Anonymous No.106498045
>>106498038
mipmaps actually won't work for tilemaps because they don't have the appropriate information, i would just forsake them entirely and do a shader based solution
Anonymous No.106498052 >>106498062 >>106498086
>>106498033
>Switching to OpenGL at this point would be impossible
Goddamn it anon, you're missing out on the fun part of creating a renderer lol.
Anonymous No.106498062 >>106498073 >>106498086
>>106498052
god forbid anyone actually make a game instead of following opengl tutorials
Anonymous No.106498073
>>106498062
Your best bet is a canned animation if you can't create it procedurally.
Anonymous No.106498086 >>106498111
>>106498052
>>106498062
I tried learning OpenGL a while back, because I wanted to make a game with fancy 2D lighting effects, and because (from what I hear) OpenGL is significantly faster than SDL's renderer. Unfortunately, I wasn't able to wrap my head around it very well, so I gave up, and the game I'm making now uses much simpler visuals. But I'd still like some cool looking effects.
Anonymous No.106498095 >>106498139 >>106498255 >>106498595
How do you guys represent screen-space UI coordinates?
Having the origin at the top left makes the most sense to me, since that's sorta how a window is defined in practical terms. Or do you have the origin in the center? Do you normalize the width/height or operate directly in screen pixels?
Anonymous No.106498111
>>106498033
>>106498086
If you're using SDL2_Renderer it means you're doing 2D only. Just bite the bullet and learn a basic graphics api that gives access to shaders.
Anonymous No.106498139
>>106498095
Origin on the center makes things easier. Especially if you plan on handling other resolutions.
Anonymous No.106498255
>>106498095
origin in the top left, pixel units
Anonymous No.106498337 >>106498340
>>106495125
I remember seeing that post when it was made and thinking "I better check back on this game after it releases". Time flies
Anonymous No.106498340
>>106498337
I remember getting an email from Guinsoo about his Dota clone "League of Legends" and laughing at it because it looked gay
Anonymous No.106498396
>>106497312
That’s the ideal format for HDR and is what Apple uses. Desktop HDR is far far behind.
Anonymous No.106498406
>>106493041
Tracy, using debug utils extension
Anonymous No.106498411
>>106493582
Geometric algebra is a scam
t. pogeet !!b2oSUmilA2N No.106498585 >>106498596 >>106498669
>>106493041
check out VK_LAYER_LUNARG_api_dump validation layer
>>106497598
https://www.shadertoy.com/view/3sXBRB
https://www.shadertoy.com/view/lffyWf
>>106497708
>Nobody is implementing novel shit though they're all making my first renderer
just because you are stuck being a noob doesn't mean everybody will be as well.
>>106497838
>I'm not interested in rendering I'm interested in games
go back to /agdg/
/gedg/ will always mostly be about rendering
if you think you know OpenGL and believe that rendering is easy, you are just a noob about to get filtered.
t. pogeet !!b2oSUmilA2N No.106498595
>>106497849
>vulkan has ruined everything
Vulkan was created to fix what OpenGL ruined and it did a good job at it by pushing the responsibility onto the application, which was exactly what gamdevs wanted.
>>106498095
I do not use matrics because its a bloat for UI.
I have my origin at top left, deal with setting up scaling, transformation and rotation on the CPU and compute them on the GPU.
Anonymous No.106498596 >>106498745
>>106498585
>just because you are stuck being a noob
im probably the only person here who has actually made an engine instead of giving up after implementing half a renderer
Anonymous No.106498669 >>106498745
>>106498585
>user asks for a profiler
>gets told to use a scuffed validation layer
>...
>tells another user they are a noob, a word thats had a sudden uptick this past few days
when are you going to hurry up and kill yourself, you obnoxious stinky street shitting retard?
Anonymous No.106498689
>>106493041
do you want to profile the CPU part or the GPU part?
t. pogeet !!b2oSUmilA2N No.106498745 >>106498867
>>106498596
>im probably the only person here who has actually made an engine
no you're not.
Stop thinking that. Only noobs do that.
>>106498669
validation layer with custom logger callback is the simplest way to profile vulkan code.
>you obnoxious stinky street shitting retard
soonβ„’
Anonymous No.106498867 >>106498905
>>106498745
>no you're not.
Never seen anyone else post one in all the time I've been in this thread
t. pogeet !!b2oSUmilA2N No.106498905 >>106498908
>>106498867
how oblivious.
very befitting a noob.
Anonymous No.106498908
>>106498905
you really dont know when to shut the fuck up
Anonymous No.106499732 >>106499869
I'm reposting my noob question here if anyone wants to give advice. Thanks in advance >>106496190
Anonymous No.106499869
>>106499732
It sounds like you're using godot so coming here is a little overkill. If you really want to learn game programming you should set godot aside for a couple weeks and make a traditional software application for practice, use a tutorial if you're still a beginner. Then, go back to godot and binge some tutorial series for that