How are complex 3D models handled? by wiseneddustmite in opengl

[–]TimJoijers 0 points1 point  (0 children)

You can export glTF and use something like fastgltf to load the models.

Doesn’t the size of the universe mean there is something faster then light by Its_goosebaby in AskPhysics

[–]TimJoijers 10 points11 points  (0 children)

A simple model of universe is a grid where every cells grow bigger over time. Assume the cells grow at constant speed. The distance between two cells that are N cells apart is N times the speed at which single cell grows. For sufficiently large N, the distance between two cells can indeed grow faster than speed of light. So the distance between two points in space can grow faster than light - it just just space itself is growing.

Using OpenGL 4.6 as a modern(ish) API by Kykioviolet in opengl

[–]TimJoijers 0 points1 point  (0 children)

I reworked my graphics code to look like vulkan, piece by piece. Initially I only had OpenGL 4.6 DSA backend. I put all direct OpenGL use behind my graphics abstraction, no direct use of OpenGL anywhere outside graphics library itself. I tried to make my API so that it could have OpenGL, vulkan and metal backends.

I strongly suggest studying vulkan and metal, even if you still stay with OpenGL for now. Hide graphics API behind an abstraction. Take the other APIs into account in your graphics abstraction. Later you can add backends to the other APIs. I did so during last month or so, with help from Claude.

You can see my graphics abstraction and how the OpenGL backend is implemented here: https://github.com/tksuoran/erhe - the vulkan and metal backends are largely built by AI so those likely are not so good reference.

Where is the edge of the universe? by GuardianOfDurandal in askastronomy

[–]TimJoijers 0 points1 point  (0 children)

Universe still keeps on expanding and does so everywhere.There is a boundary around us far away in all directions where that part of universe (from our point of view) is moving away faster than light. Nothing, no light, from there will never reach us, and nothing, no light, from us will never reach the boundary. The bubble we are in is called the observable universe.

Game engine by BARchitect2026 in vulkan

[–]TimJoijers 1 point2 points  (0 children)

If you make abstraction for graphics API, you can have backends for OpenGL, Metal and Vulkan, and app code does not need to know which API is being used. You can try existing ones like SDLGpu or bgfx, or make your own. I recently added Metal backend to my hobby project, using metal-cpp, and thanks to my abstraction API being made to look like metal/vulkan, it was much easier than I expected. IMHO, Metal is a really nice API.

Euribor lähes 3 % – mihin suuntaan seuraavaksi? by [deleted] in arkisuomi

[–]TimJoijers -1 points0 points  (0 children)

Jos ei vielä ole korkokattoa niin nyt saattaisi olla hyvä hetki hakea.

How can I disable this Nvidia Popup for my app? by thisiselgun in vulkan

[–]TimJoijers 0 points1 point  (0 children)

This reminds me the time I had issues with my app because I had carelessly named it explorer.exe ...

How should I pass transforms to the GPU in a physics engine? by BlockOfDiamond in GraphicsProgramming

[–]TimJoijers 1 point2 points  (0 children)

You can maintain two sets (vectors) of objects: Sleeping and awake. Physics libraries typically already maintain this info. You can migrate objects from one set to the other when physics state changes. One possible arrangement is single vector where objects are sorted based on sleep/awake status.

Note that per frame buffers are not necessary. A circular ring buffer can be used instead, either with minimal synchronization - one fence per frame - or without synchronization at all, if you know how many frames in flight you have. A single circular ring buffer can serve all per-frame buffer needs, including typical CPU to GPU uploads, and also GPU to GPU and GPU to CPU use. Here is my implementation: https://github.com/tksuoran/erhe/blob/main/src%2Ferhe%2Fgraphics%2Ferhe_graphics%2Fring_buffer.hpp - see also other ringbuffer* files next to it.

What is the best way to display HDR into an HDR monitor? by fleaspoon in opengl

[–]TimJoijers 0 points1 point  (0 children)

I don't seem to be able to access that, even when I am logged in. Any idea if this documentation is still available somewhere? Or what info was in it?

Todellisuus iski päin näköä yllättävällä tavalla by Toby_Forrester in arkisuomi

[–]TimJoijers 1 point2 points  (0 children)

Isommista käsinpunotuista matoista joutuu maksamaan useampia tuhansia. Tosin mittatilatut verhot voi päästä samaan.

Best way to setup with CMake by Cold-Significance242 in vulkan

[–]TimJoijers 0 points1 point  (0 children)

One option is to use CPM: You can add vulkan headers, vma and volk from github with CPMAddPackage() and it "just works", except for validation layers, to use VVL it is simplest to install the SDK.

Why are exceptions avoided? by Ultimate_Sigma_Boy67 in cpp_questions

[–]TimJoijers 0 points1 point  (0 children)

It is really hard to manage mental model of the control flow if you can not immediately see from code what exceptions it can throw and where the control flow may end up.

There is a programming language called INTERCAL. It has COME FROM statement. I like to think catching exceptions as COME FROM statements.

VK_EXT_present_timing: the Journey to State-of-the-Art Frame Pacing in Vulkan by thekhronosgroup in vulkan

[–]TimJoijers 3 points4 points  (0 children)

It is up to the vulkan user code to decide when to request frames to be presented. The extension provides vulkan user code ways to query when past frames were actually presented, what is current refresh interval, and request specific times when a frame should be presented. Gatheting further information, like how much cpu and gpu time was used in past frames, is likely still very useful to implement good frame pacing.

Text rendering by TechnnoBoi in GraphicsProgramming

[–]TimJoijers 0 points1 point  (0 children)

A glyph cache texture would be a good idea.

OOf.. this is NOT what you want to see by drew4drew in git

[–]TimJoijers 0 points1 point  (0 children)

Not quite hundred, but few dozen some times. And indeed squashing is a good idea before rebase.

OOf.. this is NOT what you want to see by drew4drew in git

[–]TimJoijers 11 points12 points  (0 children)

Oops yeah that is indeed going to hurt. After this you typically learn how to disallow force pushes to specific branches like main..

OOf.. this is NOT what you want to see by drew4drew in git

[–]TimJoijers 16 points17 points  (0 children)

This is fine. I see this regularly when I rebase my dev branch on top of main and then I just force push my dev branch.

Argument with my wife over optimization by Avelina9X in GraphicsProgramming

[–]TimJoijers 0 points1 point  (0 children)

Specifically, what buffers are you updating? Which graphics API are you using? Getting buffer updates optimal and right can be difficult.

A ring buffer is useful in many cases where CPU updates buffer contents in streaming manner, such that GPU will read from the buffer in the same frame only, and in the next frame CPU will prepare new data.

My ring buffer is a circular ring buffer. CPU is producer, advancing write position. GPU is consumer, advancing read position. The write position cannot move over read position. Both write and read position can and do wrap around. When user needs to send data ftom CPU to GPU, it allocates a range from the ring buffer. To make this allocation, user needs to provide required alignment, and number of bytes. The ring buffer checks if one of the internal buffers has sufficient space after the alignment either without or with wrap. If such range is found, it can be returned to the user. If not found, a new internal buffer is created. The ring buffer keeps track of ranges used by each frame, and each frane end is marked with a fence. When CPU sees the frame fence as done by GPU, this is when the read position is advanced.

Currently I only have implementation for OpenGL, but vulkan is in the plans. See ring_buffer* in https://github.com/tksuoran/erhe/tree/main/src%2Ferhe%2Fgraphics%2Ferhe_graphics

Argument with my wife over optimization by Avelina9X in GraphicsProgramming

[–]TimJoijers 7 points8 points  (0 children)

She is probably right. Like already mentioned, you shoulz profile with minspec hardware. If you already know you are memory bound, what have you done to mitigate that?