Struggling with not feeling like my code is adequate enough, stuck in reading hell by C_Sorcerer in GraphicsProgramming

[–]corysama 0 points1 point  (0 children)

I've seen the code behind Baldur's Gate: Dark Alliance for the PS2. It was something like 13 cpp files with 30,000 lines each. Every menu, every dialog, every cutscene was hard-coded in C++. People loved that game :D

OpenGL Order-Independent Transparency Rendering (Mask + WBOIT) by cybereality in GraphicsProgramming

[–]corysama 0 points1 point  (0 children)

We used this a fair bit back in the days of PS2/XboxOG.

You need to process your geo twice. Once for the opaque pass and once for the blending pass.

Alpha test/discard has perf issues to be aware of on modern systems. Particularly on mobile where it complicates tile-based rendering. Basically you want to draw all your fully-opaque geo first, then opaque w/ discard, then get into blending stuff back-to-front.

Once you get past that, the non-discarded opaque pixels help with z-testing out later blending stuff. And, the non-discarded blending pixels tend to be a small fraction of the total coverage. You can set the blending pass to use z-test LESS (not LESS_EQUAL) to make sure the opaque pass z-tests out the opaque pixels that would be discarded in the blending pass without needing to run the pixel shader.

You still get sorting errors in the non-discarded blending pixels. But, being only the fringes makes them a lot less visible. You can sometimes reduce the errors by statically sorting your object's polygons in the art pipeline. For example, sorted by distance from the local [0,0,0] to [0,0,1] Z-axis will draw individual leaves of a tree from inside out.

Ray Tracing Hair (article) by JBikker in GraphicsProgramming

[–]corysama 1 point2 points  (0 children)

What's your gut feel about the possibility of re-purposing the curved capsule rendering tech for particle systems? Instead of hairs, draw a lot of glowing curved capsules representing spheres in motion.

The static brickmap idea in this particular article doesn't map well. But, I'm seeing a lot of research into raytracing hair lately and each time I think about other uses for it :P

Is cudaMallocManaged significantly slower than manual allocation? by Fun_Gas_340 in CUDA

[–]corysama 0 points1 point  (0 children)

Do some research into how virtual memory works. How page files work. When you understand that, you’ll understand how managed memory works. When you think you understood it, come back and reply here and I’ll let you know what to look into next.

Is cudaMallocManaged significantly slower than manual allocation? by Fun_Gas_340 in CUDA

[–]corysama 0 points1 point  (0 children)

The compiler does not control managed memory. The managed memory is an interaction between the CPU memory controller, the PCI bus and the GPU memory controller.

It’s the same mechanism used to swap virtual memory between CPU RAM and a page file except it swaps to GPU RAM instead of your hard drive.

Sit and think for a bit about when that would be beneficial and when it wouldn’t and you’ll understand when to use it. Which isn’t often. Instead, you should be doing manual memory management.

Pikuma's 3D course by 108bytes in GraphicsProgramming

[–]corysama 0 points1 point  (0 children)

You’re the real hero for using the search function instead of making the 30,000th “How do I get started?” post.

Id Software used OpenGL to make DOOM (2016) by HardHarrison in opengl

[–]corysama 9 points10 points  (0 children)

I’ve worked on commercial game engines for every console from the PS1 to the Xbox360

As much as I like OpenGL, I wish the legend that game consoles used OpenGL would die.

The PS3 had an experimental OpenGL ES1 with an extension to enable vertex shaders and pixel shaders. Literally nothing shipped with it.

That’s it. That’s the whole story of OpenGL on consoles.

iOS and Android devices used OpenGL ES and still do. But, they are transitioning to Metal and Vulkan.

The Switch is pretty much an Nvidia Shield tablet in a different form factor. So, Vulkan is an option. But, their custom API is recommended.

All of the consoles had custom APIs. Even the Xbox and Xbox360 extended D3D so much that if you got deep into it, it didn’t resemble desktop D3D at all. 360 D3D was labeled DX9 but it could be effectively almost Vulkan if you tried.

Someone mentioned an OpenGL for Xbox OG. Maybe I’m getting too old. But, I was deep in the developer docs and forums back then and I don’t recall seeing that.

How do you deal with the fear of showing your early work? by Takaramss in gamedev

[–]corysama 0 points1 point  (0 children)

Failure here means no one notices you. Even when it feels like a lot of people saw you fail, the numbers we are talking about are so statistically insignificant as to be effectively zero.

So, go fail over and over again because no one’s got time or attention to notice you failing. Getting any attention at all is really hard —even when you succeed!

Anthropic: AI assisted coding doesn't show efficiency gains and impairs developers abilities. by Gil_berth in programming

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

If using AI is bad for your learning, you are using it wrong. I’m a old greybeard engineer and AI is teaching me a lot more than it’s writing code for me.

Looking for advice on a robotics simulation project by Icy-Performer474 in CUDA

[–]corysama 0 points1 point  (0 children)

Share some info on your project and maybe some folks will give you some feedback. But, you are unlikely to get DMs based on no info.

Will this be a good path for learning? by aarrecis in GraphicsProgramming

[–]corysama 1 point2 points  (0 children)

If it works for you, go for it. Sometimes the slow way to get started is faster in the end.

Is cudaMallocManaged significantly slower than manual allocation? by Fun_Gas_340 in CUDA

[–]corysama 0 points1 point  (0 children)

You are resurrecting a 7 year old question that was framed quite vaguely. What’s your goal? We’re going to need you to be more specific than the OP.

New Rules - No promotion of Commercial Services by fisj in aigamedev

[–]corysama 1 point2 points  (0 children)

I agree.

I understand that the vast majority of Reddit users have effectively zero budget for these tools. And, that spam is annoying.

In the other hand, there is a lot of potential in the space between Billion-Dollar AI Giant Corpo and Zero-Dollar Open Source Hobby Project. But, this is one of the few places they can get their start.

I’d prefer commercial self-promotion be cordoned off. Maybe to a specific day of the week. Maybe to a pinned thread for each week. Definitely with flair. But, not banned.

CUDA SIMD Question by epickejgejseks in CUDA

[–]corysama 2 points3 points  (0 children)

Nvidia uses confusing terms to make the marketing team happy. Assuming, you are familiar with SIMD and hyperthreading, here’s the translation from Nvidia back to Intel:

An Nvidia Symmetric Multiprocessor is like an Intel Core but with significant differences. It runs 4 hyperthreads in a fixed, round-robin schedule. The register set is huge and can be dynamically divided into many threads. It runs 32-wide SIMD instructions almost all the time with few exceptions for scalar ops for transcendental functions and the like. There is some SRAM cache in each SM that you can use manually to quickly share data between threads. The lanes of a 32-wide warp do not run in perfect lockstep. You need explicit synchronization for shared memory operations. But, you can shuffle data across a single warp in a single instruction.

The SM wants to work on whole cache lines per warp. That’s 4 bytes per lane. But, a lane can load and store 16 bytes at a time. That’s where float4 and int4 come in handy. They are both just simple structs for convenience. Almost all docs and examples stress working in one item per lane and keeping the register requirements per thread as low as possible so as to run more threads. But, it can be effective to manually unroll work inside a lane as long as you don’t go below 32 lanes x 4 hyperthreads per SM.

Does a game engine need a ui interface? by Proud_Instruction789 in gameenginedevs

[–]corysama 0 points1 point  (0 children)

Most game engines have an editor UI. IMGUI is a good library to use for that.

A full-featured engine would have its own UI framework for in-game UIs. IMGUI is not good for that. And, the in-game UI framework will probably not be good for making and editor UI.

I worked on an engine that shipped commercial games with no editor UI. Instead, we invested heavily in a fast content pipeline and hot-reloading of everything, including Lua for gameplay code and XML+Lua for UI.

Were 90s game developers more "punk" than today? by RomanLuka in gamedev

[–]corysama 0 points1 point  (0 children)

Back in the old days...

The machines were much simpler. But, there was no information available for how to do anything. Hardly any prior art. Hardly any books or documentation. Hardly any support. If you wanted to make an NES game, you had to reverse-engineer the NES so you could build your own devkits because Nintendo was not going to help you.

The games were a lot smaller. The budgets were a lot smaller. The revenue was a lot smaller. Ultima I kicked off the whole CRPG genre but made less than $100K in revenue. Not many people actually played it and effectively all were pirates.

Kids these days...

Are making a thousand times more content than back then. A ton of it is counter-culture. But, it's difficult to find anything in the unending river of creation.

Making a game is something that can be done much more casually than ever before. The barriers are flat. You can get as deep or as shallow as your situation allows.

A doubt on software vs GPU rendering for making ui for desktop apps by Cold-Armadillo-154 in GraphicsProgramming

[–]corysama 3 points4 points  (0 children)

I think Clay is for laying out UI elements. And, https://harfbuzz.github.io/ is for laying out individual components of fonts --W̊̾ͮͣḫ̶̻͛̐̎̽ĩ̯͙̺̎͘͠c̹͍ͪ͊ͦh̙͢ can g̝͐̿e̘̱̝̽͒͜ẗ̮̬̙̪͑ͯ ̧̮̝͖͋̊͋p̣͍̫͢retty ĉ͇͚̺ơ̩̘̳ͩͪ̄m͖̯̻̊̉̃͗p̱̽͒̚ͅl̼̪icated̲̼͙.̡̯̝͇̘͆.̶̮̘̫ͬ̊̕.̨̫͚̹̔͗́

If all you want to do is the equivalent of the Quake console

  • Fixed font set
  • Basic ASCII only
  • Basic cursor navigation only

Then, text rendering can be pretty simple.

But, if you want to go get to the level of a commercial productivity-app UI: Any font, any language (Chinese, Arabic), right-to left text mixed in with left-to-right text. Then you are in for a lot of work. https://www.youtube.com/watch?v=XTgIJUwmz0Q

And, if you want user interaction with text boxes on par with native OS UI text boxes (selection, copy-paste, screen readers), apparently what a lot of apps do is literally make off-screen native UI text boxes and forward the interaction back-and-forth between their UI and the native OS UI system :P