[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


"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
>>
My renderer does not show any objects on Linux, argh. What could possibly be different from the Windows build?
>>
>>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?
>>
>>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.
>>
>>106467983
time to use renderdoc honey
>>
>>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
>>
>>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.
>>
>>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.
>>
>>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.
>>
>people still using opengl
I didn’t realize we had grils in here
>>
Fuck, left options auto filled
>>106468666
Using sdl or opengl would change almost nothing for my code, maybe 2%
>>
>>106467928
>latency
>MULTIPLE FRAMES of latency
>>
>>106467928
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.
>>
File: 1000024447.jpg (199 KB, 719x894)
199 KB
199 KB JPG
Tomorrow i will wake up and make progress. I have had divine inspiration
>>
>>106469177
Pygame or pyglet are both good for that. You can also try one of the various pygame forks, or arcade (based on pyglet)
>>
>>106469177
just make what you want with whatever, python is easy to learn
>>
>>106469177
glfw / sdl3 both have Python bindings if you're trying to do engine dev
>>
>>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
>>
>>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.
>>
>>106469419
4.5 sales to own the trannies or whtaver. has anyone actually played space marine 2?
>>
>>106469430
no nobody played it they just brought it
>>
>>106469430
>>106469436
>>
>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.
>>
>>106469450
>played: 10 minutes
>>
>>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.
>>
>>106470034
stop defending latency
>>
>>106470034
you type so much and you say so little
>>
>>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.
>>
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
>>
>>106470137
>1-frame latency ... will do just fine.
ridiculous
>>
>>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.
>>
>>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
>>
>>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?
>>
>>106470262
hes just posting more retarded drivel
>>
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.
>>
>>106470269
most games run at 60 or 30 fps
>>
>>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.
>>
>>106470291
>you can't afford to just add a frame of latency here or there.
its a trade off
>>
>>106470294
between what?
>>
>>106470262
user presses key during frame N
game handles inputs, updates, renders during frame N+1
result of render shown during frame N+2
>>
>>106470335
>>106470251
>>
>>106470346
No, you process inputs directly after they've been captured in frame N
>>
>>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
>>
>>106470370
You don't notice latency by observing something you notice latency by interacting with it
You will notice in fast paced action games
>>
>>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.
>>
>>106470251
>It's a technique called pipelining
ah, I see.
>>106470365
the question is, when is that frame presented?
>>
>>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
>>
>>106470449
you can do late polling.
present the frame first and poll for input at last.
>>
>>106470491
think really hard about what you just said
>>
>>106470491
why?
>>
>>106470510
nope.
Only retards that actually can't think at all say shit like that.
>>106470515
why else?
it reduces latency.
>>
>>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
>>
>>106470543
>no thought put into them
my amazing suggestion is very thoughtful, actually.
Feel free to try it out.
>>
>>106470552
It's literally the same thing
>>
File: 1756163779973224.jpg (45 KB, 225x225)
45 KB
45 KB JPG
>>106470559
think really hard about what you just said
>>
>>106470563
do you understand how loops work you fucking retard?
>>
>>106470572
>>
>>106470579
I hope you're 15 years old or something
>>
>>106470585
>>
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.
>>
>>106470601
>and a separate render thread copies a snapshot of the game state before rendering.
why would you do this
>>
>>106470607
When render is slow or wait for vsync it delays input handling if it on the same thread as input.
>>
>>106470692
rendering happens on the GPU
>>
>>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.
>>
>>106470740
jesus christ stop posting
>>
>>106470790
>>
>>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];
>>
@Frosch
add this to compendium https://imadr.me/pbr/
>>
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
>>
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.
>>
>>106467928
It is insane how comfy Odin is for gamedev, and you don't even have to install any third party libraries!
>>
>>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.
>>
>>106471629
it's good but consider reading the parts you are really interested in, it's pretty long
>>
>>106472036
Can you build a webgame with Odin? How about websockets interaction?
>>
>>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.
>>
>>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.
>>
>>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.
>>
>>106473262
So can you do it with vendor:OpenGL too?
>>
File: i-nHLNLHx-X3.jpg (1.13 MB, 1600x1200)
1.13 MB
1.13 MB JPG
>>106473262
OpenGL has a limited lifespan. Best to learn DirectX or Vulkan
>>
>>106473262
raylib is worthless for 3D but perfectly fine for 2D
>>
>>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.
>>
>>106458011
the animation should be offset a bit for each tree or something to look even better
>>
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?
>>
>>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> foo: register(b0, space1);


to ensure D3D12 and Vulkan both work correctly, but it does.
>>
>>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?
>>
>>106473302
>DirectX
proprietary and windows only
>>
>>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
>>
>>106473765
>have the same API
its pretty much the same
>>
>>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
>>
File: 考える.gif (1.87 MB, 590x720)
1.87 MB
1.87 MB GIF
I want to make a game in a LISP-y language just for fun and practice. Would Clojure be a good one for that?
>>
why do all d3d12 tutorials wait on fences for frame synchronization and not on swapchain?
>>
File: 2025-09-03 14-42-07.webm (1.46 MB, 800x600)
1.46 MB
1.46 MB WEBM
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.
>>
>>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
>>
>>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.
>>
>>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
>>
>>106474916
isn't waiting on fence bad for frame pacing?
>>
File: NewItem1.png (182 KB, 925x491)
182 KB
182 KB PNG
>>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.
>>
>>106474677
no
try fennel
>>
File: janet-big.png (20 KB, 512x524)
20 KB
20 KB PNG
>>106475404
>fennel
nah, Janet better
>>
>>106475429
this looks transcoded
>>
>>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.
>>
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.
>>
>>106475564
can I make a game with software rendering only
>>
>>106475584
yes.
As long as the display is not high-res, it'll be playable as well.
>>
>>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
>>
File: 1747073894890253.png (722 KB, 826x827)
722 KB
722 KB PNG
>>106475664
>attenting seeking retards who reply to every post with gpt slop
>>
>>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.
>>
>>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
>>
File: 2025-09-03 16-25-18.webm (877 KB, 800x600)
877 KB
877 KB WEBM
>>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.
>>
>>106469419
>>106470034
>it made a lot of money so that's all that matters and it excuses everything
No, fuck off.
>>
>>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.
>>
File: frog.jpg (54 KB, 976x850)
54 KB
54 KB JPG
I realized making engine systems is more fun than making a game
>>
>>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.
>>
>>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.
>>
>>106476042
>>
>>106476004
Next you'll realise that making libraries for engine systems is even better
>>
File: aqua.gif (2.46 MB, 640x620)
2.46 MB
2.46 MB GIF
>his "engine" doesn't run on the Dreamcast
>>
>>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.
>>
>>106472183
>>106471629
okay cool, that's good to hear. time to dive in.
>>
>>106476351
And you weren't already an accomplished programmer by that age? ngmi.
>>
>>106467983
If you're not already, check all your error codes, and use glGetError / gluErrorString in the main loop.
>>
>>106476155
>his "engine" doesn't run on the Mega Drive
ngmi
>>
>>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).
>>
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.
>>
>>106475564
Yes.
We seriously could use a a /gedg/ FAQs.
It'll take a while since there are a lot of questions to cover.
>>
File: 1751593705922305.png (126 KB, 892x515)
126 KB
126 KB PNG
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).
>>
>>106480949
Moй дpyг зoззинг зaбыл чтo CRT-тeлe мepтвы.
>>
>>106480990
oops.
I meant my friend zozing forgor that CRT monitors are dead.
>>
>>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
>>
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..
>>
>>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.
>>
>>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
>>
>>106481310
multithreading is cope for poor optimization
single thread is enough if you're not retarded
>>
>>106481047
4k is only 81x of the pixels of 360p and today's cpus are like 1000x faster then the 1990s ones
>>
>>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.
>>
>>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.
>>
>>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.
>>
>>106480949
Not an interesting question at all. This guy's a midwit.
>>
>>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
>>
>>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
>>
>>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.
>>
>>106482170
how are you actually writing to a framebuffer with a "software renderer?"
>>
>>106482170
>4k120fps
You're gonna need to post some proofs, that's a lot of pixels.
>>
>>106482170
your software renderer renders 8 million pixels at 120 fps on a single thread huh
>>
>>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.
>>
>>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.
>>
>>106482229
It's not possible, he just made it up
>>
>retards instantly take the bait
I'm sure he also didn't use any of that there SIMD bloat
>>
>>106482246
>SIMD bloat
he'd have mentioned it if he did because that's a lot of work to even accidentally forget.
>>
>>106482246
>retards instantly take the bait
trolling is against the rules, retard.
>>
>>106482270
>If it's illegal then no one can do it
Gun owners BTFO
>>
>>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.
>>
>>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
>>
>>106482305
It is “displaying the output” just like the post I replied to said.
>>
>>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
>>
>>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"
>>
>>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.
>>
>>106482289
>You said CPU is too slow for even simple things like this
>>
>>106482334
https://en.wikipedia.org/wiki/Software_rendering
>>
>>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.
>>
>>106482385
It's possible but it's not practical
>>
>>106482394
Define “practical”.
>>
>>106482434
You are paying a huge performance cost for no reason at all
>>
>>106482385
>It is practical for 2D
it isn't practical at all.
hardware accel 2d graphics libraries are easy as fuck.
2D web <canvas>
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?!
>>
>>106482441
>not even old timey game hardware was this fucking primitive
it was how it was done before 3d accelerators
>>
>>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?
>>
>>106482449
no, it wasn't. you had special hardware for transforming bitmaps. maybe if we go really really really far back.
>>
>>106482457
not on PC you didn't
>>
>>106482465
I mean, what "PC?" for one.
even shit like drawing text was done with "special hardware" and texture atlases of bitmap fonts.
>>
>>106482457
And these “special hardware” are so limited that developers back then practically software render lots of effects themselves.
>>
>>106482475
normal PCs, IBM compatibles
>>
>>106482385
>I saw one that in practice achieves 1440p 60fps with real gameplay
What game?
>>
>>106482385
>1440p 60fps
maybe but 4k120fps with only a single thread is just impossible.
>>106482478
ROM magic
>>
>>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
>>
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.
>>
>>106482728
It's possible it's just really slow and not really any easier than using hardware
>>
>>106482740
Then practically not possible?
>>
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
>>
>>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.
>>
>>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?
>>
>>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.
>>
>>106483027
ok why would you use an entire software rendering library just to do this?
>>
>>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.
>>
>>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
>>
>>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.
>>
>>106483081
How is rendering in software going to help you catch a hardware bug?
>>
>>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"
>>
>>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?
>>
>>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.
>>
>>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
>>
>>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?
>>
>>106483265
I have, but they don't use software rendering because every computer has a GPU
>>
>>106483272
and on a computer that does release builds that doesn't have a GPU?
>>
>>106483279
I said every computer has a GPU
>>
>>106483284
kek, no they don't. wtf?
>>
>>106483298
They do in game development buddy
>>
>>106483300
Literally not true, though. Headless machines built for compiling wouldn't have a GPU
>>
>>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?
>>
>>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.
>>
>>106483327
...anon, you're actually retarded.
>>
>>106483327
https://learn.microsoft.com/en-us/windows/win32/direct3darticles/directx-warp#enabling-rendering-when-direct3d-hardware-is-not-available
>>
>>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
>>
>>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.
>>
>>106483373
I'm talking about the propietary console APIs
>>
>>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
>>
>>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
>>
>>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.
>>
>>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
>>
>>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
>>
>>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?
>>
>>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?
>>
>>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
>>
>>106482728
You can it’s called DLSS. I’m able to play Black Ops 6 on extreme settings at 1440p with DLSS.
>>
>>106469177
Nah, write your own engine instead.
>>
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.
>>
>>106485377
How many lines to first triangle?
>>
bros... i still cant beat vulkan....
>>
>>106485411
For me, it was 1300 or so.
>>
>learning mvvm is painful spaghetti
how the fuck do people keep track of the flow of data when everything is hidden from you?
>>
>>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.
>>
>>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.
>>
File: ulqt6ikxzv101.jpg (27 KB, 400x300)
27 KB
27 KB JPG
>>106469178
I did it. Here's my progress


vector<BVH::Insertion<Mesh<ModelVertex>>> 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
>>
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!
>>
>>106485377
Vkguide has it right. The hello world world of Vulkan is a clear image.
>>
>>106486577
Hell yeah brother! Break them bricks!
>>
>>106486584
Clear image is simply a special case of a memory transfer (vkCmdBlitImage)
>>
>>106486577
Cool, have fun. Gamedev is lots of fun.
>>
>qwen3-code can generate imgui debug window functions
very based, very useful for rapid development
>>
>>106486813
>>106486714!
Thanks anons!
>>
File: input.webm (2.86 MB, 1280x720)
2.86 MB
2.86 MB WEBM
neat shader thing
>>
>>106488145
Cool.
>>
How do I convert this
#include <SDL2/SDL.h>
#include <GL/gl.h>

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?
>>
>>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.
>>
>>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.
>>
>>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.
>>
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.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.