This poll is why software today is on a steep downhill.
You can’t write code and refactor for speed later, you have to design the code for the hardware from the start.
Failure to do so will only result in replacing bubble sort with merge sort and calling it a day.
Two ways to write software:
1. Performance first. Consider performance from the start.
2. Performance last. Make it work, make it right, then make it fast (if necessary).
Poll: What's your typical approach?
Computers are orders of magnitude faster and yet a lot of software remains at break even in terms of performance.
A perfect example of this which is within recent memory is Android, which hasn’t changed much in terms of functionality but still performs the same 8 years later.
This is DiffusionLight
A simple but super effective technique to estimate lighting from any input image
How? By inpainting a chrome ball using a diffusion model
The next game I work on will only use linked lists, bubble sort and be single threaded. When it needs to run more than 1 frame per minute I’ll do some profiling and start rewriting the entire code base then.
@GustavSterbrant
@b3agz
@andytouch
I mean, yes, unironically.
The real answer is to profile and find where the biggest performance increases can be made and put resources in to that. A video game is much different than other software. If a banking system couldn't do its primary function why would you spend time
This is why sky occlusion is important. The image on the right is wrong on so many levels, but the most egregious one is that everything is blue and reflects the sky.
Even the ceiling?
@SheriefFYI
The solution to the problem is clear - stop exposing shaders as graphs. Just stop it.
You don’t need games with 20k shaders. Nobody does. We shipped Rage2 with a handful.
Have bigger shaders and use scalar branching. NVIDIA GPUs can just brute force it.
@NoContextBrits
If by art you mean a local politician using tax money to pay his “artist” neighbour/friend/family member for some nonsense sculpture in exchange for favours.
People were doing tons of work per pixel and then the 4K race happened. It didn’t stop anyone from doing tons of work per pixel but instead comprises were made. I remember back in 2017 when working on Rage2 how we had to implement dynamic upscaling to fit console frame budgets.
@joewintergreen
why do games now look muddier, crunchier, smeary and noisier than Source games did back in the day? why does 1080p now look like 480p usually does? everything's blurry and mucky. what happened?
@otac0n
Whenever someone mentions a “technique” as some silver bullet, I’m sorry but that’s a red flag.
If you take a code base that is heavily object oriented, you can’t refactor it to efficiently utilize data.
Bad design is something you pay for forever.
Reading an FBX file for animations and skinning is a clusterfuck of epic proportions. The excellent solves most of the BS for you, and removes the dependency on licensing the SDK.
One thing though, it doesn’t factor in pre rotation for animations.
Could someone explain how Bluetooth is so poorly implemented on nearly every device?
Windows 11 laptop had a figurative meltdown because I tried to disconnect a set of Bluetooth headphones and I had to reboot to get USB working again.
@Sargon_of_Akkad
The left don’t understand hard work, so anyone being successful is in their mind obviously a grifter.
It reminds me of a passage in Atlas Shrugged where the state renamed Rearden Metal to Magic Metal because to them, it couldn’t possibly be the product of competence.
@GustavSterbrant
Premature opmitization is the root of all evil. If you disagree, then tell me whether you consider the length of the CPU cache line when designing your data structures.
@PR0GRAMMERHUM0R
1. CMake is not a clusterfuck. People have managed to clusterfuck their CMake but it doesn’t make it bad.
2. Header files separated from source is a huge compile time benefit.
3. Stop doing things “the modern way”. Do what works, and don’t be a slave to silly trends.
I've been busy adding support for volumetric refractions, iridescence and some missing parameters for sheen in the editor
@playcanvas
.
This finally makes it possible to experiment with all the new material properties directly in editor!
@Masterkrombi
@b3agz
@andytouch
So without profiling, we should just ignore obvious performance crimes because they are not the current bottleneck?
In the tech world that is called “technical debt”.
@reduzio
Is it less friction to write tons of classes, manage private and public ownership, jump between methods across multiple files?
Is it less friction to intertwine all code in high level abstractions when the data is what actually matters?
It’s just what you’re taught at uni.
I remember watching
@cmuratori
GJK video in university and implementing it to get a 5 in the discrete physics class.
I used his video as reference material.
Years later I used the same video to remind myself how to use GJK when applying at
@AvalancheSweden
.
@Windows
, please let me see which process holds a handle to the file I want to delete.
And please drop the handle if I change out of the directory in the terminal.
Or just allow me to delete it anyways.
On behalf of everyone, thanks.
@zet23t
HTTP is all clear text. Imagine how much faster the web would be were it all in compact binary.
Imagine if data was compressed like games compress data to optimize for speed. What a wonderful world that would be.
@mrousavy
That’s a bit of a cop out. The world is running on JavaScript backends, why exactly? To waste power? To counteract hardware improvement?
Making it artificially faster using Bun or this stuff doesn’t really matter, you’re still going to have frontend development in the backend.
@Masterkrombi
I’m just pointing out how silly it is to not care about obvious bad practices because you didn’t profile them. Profiling is good for finding the not so obvious performance bottlenecks.
How can you debug your own code using Google? Do you Google something like “when I run Foo() it sometimes causes a data race” and Google will be able to point to where in YOUR code the problem is?
Or are we saying when using other people’s code? Frameworks and whatnot.
No, people were coerced to upgrade from W10. Some people even had it install automatically without their consent.
I got a full screen splash windows when turning on my computer on two occasions, challenging me to find the “decline” button.
I'm going to retract my support for this - I just profiled a scenario where I generate geometry on the CPU every frame, upload it via a copy queue, then have the gfx queue do clears + some work before waiting for same-frame copy. Delay is ~50us from signal to gfx queue resuming.
@CoeusQueryall
@zeta_globin
@valemiento
Point is that you can present an interesting finding or brag about publication count.
There are journals where people publish just to have an excuse to travel and party. Doesn’t really mean the publications there really mean anything.
Peer review is only as good as the peers.
Inspecting my old VK engines. On start I would warm all the pages. Code pages get a read, and data pages got an atomic add of a non-compiler known zero. An attempt to improve initial load time. But in the end nothing helps the 2.6 seconds or so required to just open the VK device
Quick off of the previous one, added support for KHR_materials_transmission to
@playcanvas
, PR: .
Note that the refractions doesn't sample the scene yet, as that requires a bit of work on the refraction sampling code. That's in the pipeline though!
Okay, rays are firing. Been working some hours here and there to get it to work.
Tons of small changes.
Anyone knows a good debugger for ray tracing on AMD GPUs? The ray tracing analyzer keeps telling me there is no TLAS and no rays are being fired…
language models will do to software what the iphone did to keyboards.
"they all have these keyboards, fixed in plastic and the same for every application... they can’t change."
software has these functions, fixed in code and the same for every user... they can’t change...
Let’s talk about console performance in Avatar: Frontiers of Pandora. Hopefully this gives an idea of what it takes to optimize a AAA title (and we still didn’t manage to do it perfectly) Thread:
I feel like C++ generic programming is useful because it’s annoying to write tons of lines of boilerplate, and the C pre processor is very primitive when compared to for example Rust.
Lately I’ve resorted converting some of our resources from json, and doing codegen instead.
This is what I’ve come to terms with by playing games where balancing fixes are the sole focus of patches. It’s boring, you play a game to pull off unbalanced stunts. They are the reward for ingenuity, hard work and/or luck.
While making Diablo 2, we used to say “balance is overrated.”
Diablo was fun because of all the unbalanced crap you could pull off.
Diablo 4 should not try to overbalance everything to spreadsheet accuracy.
It’s not that type of game, and just results in clinical sterility.
Implementing ray tracing for Nebula. Got the BLAS generating on GPU, working on having TLAS update as well. The on to the shaders, which by the looks of it seems to be the biggest work.
Lots of changes needed in our shader compiler to support it.
I think everyone hears ECS and thinks std::vector<Component*>. You can easily have a component system without storing the component on a per entity basis, allowing for efficient parallelism and data organizing.
All of these “ECS isn’t a silver bullet architecture” people sound pretty silly if you replace it with “Unity/Unreal/Godot-style scene tree Component.update() isn’t a silver bullet architecture”. Like yeah we know. It just works really well in this context (arguably better).
@ejpbruel
If you write your code with hardware limitations in mind, the optimization you will need to do will just be minor refactors of already somewhat efficient systems.
If you design poorly, you’ll need thousand LOC rewrites to optimize.
@DylanMAllman
If these hurdles would be required to get a PS5 then nobody would bother making them. The whole point of making something like a PS5 is to sell and make a profit, otherwise there would be no incentive to research let alone produce them…
Ray tracing is merged in to main. In theory, everything is there but I’m still working on a material system to feed the ray tracing shaders with material info.
This change also brings support for mesh shaders, although untested.
Exhibit A. One 3,000 line function and one 2,000 line function, fully shipped.
Exhibit B. Positive reviews from happy players.
Note the absence of comments relating to the length of functions.
Hypothesis: Players don't care about your code. They care about the game it makes.
@dhh
My unpopular opinion is that Docker only exists because modern software is so janky it requires a full system image to reliably run.
Deploying a program should never be more complex than unzip and run.
Bundle your damn dependencies! It’s not hard.
In the shader compiler we used for Nebula, I had a gigantic if-else chain to test for built in types. Turns out there is a C++ limit for how many of these you can do!
@SheriefFYI
I got the W11 toolbar show me one thing about my Bluetooth devices and the third and newest layer of the settings window showed me another. They are not in sync. Disabling Bluetooth in the toolbar breaks something internally and turns the rest into a house of cards.
@turanszkij
I always develop on AMD and notice the opposite. Most recently with NVIDIA cards giving incorrect queue support bits in Vulkan.
Or when a GLSL barrier() followed by a groupMemoryBarrier()
(AMD single pass downscaler) caused a device lost.
@SheriefFYI
There is no accounting in the tech world for the use of unnecessarily ineffective software consuming significantly more energy than required.
Having such accountability would probably reduce the tech sector by orders of magnitude.
It coming from a government doesn’t make it valid. In fact, the governments lie on such a regular basis that if anything, your default reaction should be “why would a bureaucrat know?”.
Which ironically is precisely what this statement is about - incompetence.
"We dont need memory safety languages like Rust"
You're wrong, we do
"C/C++ is memory safe enough though. These problems are skill issues"
Wrong again
Most production code uses malloc() and free()
Its the allocator that was given with C/C++, and its the one that most will
Implemented a custom pipeline cache for Nebula. We have 4 state deciding the pipeline so no need to hash whatever 11 different parameters the driver needs to find the pipeline. No need to do a driver call either.
Much faster than using the pipeline cache, at least back in 2017.
@ShitpostRock
Writers don’t have friends so they don’t understand friendships. Look at Hollywood acting, everyone drinks constantly or smokes, especially when stressed and in danger.
For a normal person, most Hollywood characters act completely unnaturally, as if they are alien.
Got material buffers working with ray tracing.
The buffer reference extension for GLSL is badass. Allows you to provide GPU addresses in a buffer, which can be offset on the GPU!
This is more or less necessary for ray tracing, but it can have many more applications. 1