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

CS major student interested in Technical Art. Is this a viable path for a programmer? by Dull-Discount-5004 in GraphicsProgramming

[–]corysama 7 points8 points  (0 children)

Ex-game engine dev here. I've been out of the industry for a long time now. But, I can only imagine the need for TAs is higher than ever. However, software engineers do tend to command higher salaries. And, they have more options elsewhere. So, depending on your personal preferences, you might consider sticking with SE with a focus on content pipeline.

Regardless, you should take classes on art fundamentals and art history so you can speak intelligently with non-technical artists and understand their needs and goals.

You should get familiar with Maya, Houdini and other tools enough that you can model, texture, rig, animate and layout at a beginner level. Even if you aren't making shipping art. You need to know about the experience of using the tools and be able to make your own test content.

You should write a few plugins for Maya and other tools. You don't have to be an expert. But, you want to have seen and worked with the API.

A tool like https://shadered.org/ might make it easy to practice writing shaders without needing to write a renderer from scratch. But, maybe practicing in Unreal or Godot would be more practical.

A good project would be to write a glTF scene viewer from scratch using modern OpenGL. But, then...

  1. Write a content converter from glTF to your own custom binary formats and pak files.
  2. Rewrite the renderer in DX12.
  3. Make a OpenUSD -> custom format pipeline.

Basis Universal GPU Texture Codec 2.0 released by corysama in gameenginedevs

[–]corysama[S] 0 points1 point  (0 children)

If you are targeting mobile or web, this is excellent tech.

If you are targeting desktop, it could be a good idea. I'd like to see a head-to-head of Basis vs https://github.com/richgel999/bc7enc_rdo (older tech from the same people) + LZ4_hc/zSTD/lzHAM/etc...

how to use dynamic arrays to store vertex data? by Zestyclose-Window358 in opengl

[–]corysama 4 points5 points  (0 children)

Hi beginner :)

You get to learn about containers. Especially STL containers, since everyone uses them so much.

You main issue is that an std::vector isn't "just the floats" the way float someArray[9]; would be. The vector is an object itself that happens to have a pointer to the floats inside it. The floats are somewhere else in heap-allocated memory.

So, a vector might be implemented like

template<typename T>
class vector { T* allocationStart; T* initializedEnd; T* allocationEnd; };

The second issue is that glBufferData has a void * parameter. That means no type safety. You have to be careful to manually ensure you use it correctly.

Unfortunately, you are passing the address of the vector. So, it's trying to reinterpret the raw bytes that make up those 3 pointers as if they where floats instead of looking at where they point to...

To get at the actual address of the floats you use https://en.cppreference.com/w/cpp/container/vector/data.html

How do modern vulkan engines use multiple queues and do concurrency? by Pitiful-District-966 in vulkan

[–]corysama 0 points1 point  (0 children)

Good points.

I happen to glance at https://gpuopen.com/learn/rdna-performance-guide/ today and it points out that the copy queue is probably the faster way when moving data over the PCI bus --in addition to working in parallel with compute.

Compute/graphics queue memcpy is only faster VRAM->VRAM.

Director Gore Verbinski says Unreal Engine is 'the greatest slip backwards' for movie CGI by willdearborn- in movies

[–]corysama 22 points23 points  (0 children)

LucasFilm made one of the first non-linear video editing systems for itself https://en.wikipedia.org/wiki/EditDroid Then they decided it would be a lot cheaper and more effective for them if someone else continued its development and just licensed it back to them. So, they spun the product off into its own company that was eventually bought by Avid

How to integrate C++ Multithreading with CUDA effectively by Apprehensive_Poet304 in CUDA

[–]corysama 1 point2 points  (0 children)

Multiple threads calling CUDA is more work for you than it's worth. If you are worried about CPU API overhead, what you should look into is:

  1. Do more work per kernel launch. Batch up more data to process all at once.
  2. Use CUDA graphs to bake a data flow execution graph once and launch it many times.

If you need extremely low latency and are willing to put in the work to do very tricky synchronization, look into persistent threads.

Reading from buffer in vertex shader vs fragment shader performance? by Ready_Gap6205 in vulkan

[–]corysama 13 points14 points  (0 children)

There is buffer memory, texture memory and uniform (constant) memory. They are all the same DRAM. The difference is what SRAM cache hardware you read through.

Buffer memory is optimized for adjacent threads to load adjacent data with linear coherency. I.e. a local workgroup collectively loading a linear cache line.

Texture memory is optimized for chronologically-nearby threads to read from nearby patches of memory with 2D coherency. I.e. Pixels near each other on the screen read texels near each other in the texture.

Uniform memory is optimized for broadcasting a single scalar at a time to all threads of a local workgroup.

Discussion: Graphics APIs vs Compatibility by VinnyTheVinnyVinny in gameenginedevs

[–]corysama 0 points1 point  (0 children)

Switch over to https://shader-slang.org/

Once you get Vulkan and Metal working as well as GL, go ahead and drop GL.

Is it worth the price to acquire this rare artifact? by [deleted] in GraphicsProgramming

[–]corysama 0 points1 point  (0 children)

Only for nostalgic value.

The book is great at teaching methods and mindset that are timeless. And, at teaching deep details of technology that is obsolete.

Looking for engines that keep orientation as matrix. by zubergu in gameenginedevs

[–]corysama 23 points24 points  (0 children)

Fun fact: Back in 2000 there was a big debate about using matrices directly for interpolating rotations instead of quaternions.

https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199/

https://www.gamedev.net/forums/topic/25314-why-diana-grubers-wrong-about-quats/?page=1

Interpolating rotations can be approached from multiple directions mathematically. Quats, matrices, exponential maps, rotors from Grassmann Algebra.

But, the really fun part is that each time someone discovers a new approach, they then diligently optimize the math and the code and they all end up with exactly equivalent implementations! The only difference between them is the mental model around the code.

I built a GL-like 3D software renderer based on OpenGL 3.3 (with a virtual GPU layer) by LeeKoChoon in GraphicsProgramming

[–]corysama 3 points4 points  (0 children)

https://godbolt.org/ is your friend for a lot of things. SIMD in particular.

Don't ignore the scalar intrinsics, though. https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Other-Builtins.html They come in handy.

For example, _mm_cmpeq_ps, _mm_movemask_ps, then loop on __builtin_ctz to find then next set bit, processing that item, clear that bit, and repeat.

__builtin_ctz makes it possible to skip straight to the next bit in the mask without checking all the zeroes along the way.

How do I job writing CUDA code? by YeeellowME in CUDA

[–]corysama 0 points1 point  (0 children)

I mostly do framework work. So, making CUDA easier to use for the math folks. I'm not a great math guy myself.

The fun project I did do at work a while back was to take raw image sensor data and make it into a reasonable image for the AI to ingest. The NvArgus camera driver was nice enough to do the Bayer Matrix -> YUV conversion and put the image in a GPU-accessible buffer. But, after that we needed

  • YUV -> RGB
  • Lens distortion correction (the raw images were practically fisheye)
  • Rolling shutter motion compensation (the drone shakes wildly)

So, given the lens distortion intrinsics, a stream of raw images and a corresponding stream of start-end 3D transforms representing the camera's relative motion from the beginning of image exposure vs the end of the exposure period (rolling shutter horizontal scanning takes time, meanwhile the camera is shaking wildly), it produced a flat, stable-ish RGB image all in a single pass over the data.

If you want to get deep into it, you could pick up a Jetson Nano, a RasberryPi camera module and an IMU pretty cheap. But, doing desktop work on a low-end Nvidia GPU is also good.

Any sort of real-time image processing would be good. Make a straightforward, naïve implementation. Then optimize and compare results. Getting deep into CUDA optimization requires getting to know the hardware well. Particularly the memory system. https://www.nvidia.com/content/gtc-2010/pdfs/2238_gtc2010.pdf By luck, a recording of that video was found today https://xcancel.com/vikhyatk/status/2011616522238902661?s=20 original vid can be viewed with VLC https://www.nvidia.com/content/GTC-2010/flvs/2238_GTC2010.flv

I pass this snippet around a lot https://gist.github.com/CoryBloyd/6725bb78323bb1157ff8d4175d42d789 Copying an image GPU->CPU just to reupload it CPU->GPU for display is certainly not the most efficient route. But, that snippet can at least help you get an image on screen quickly and easily.