[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



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