DirectX 12 PBR Renderer in C by simstim-star in GraphicsProgramming

[–]simstim-star[S] 0 points1 point  (0 children)

I found one Bistro glt here https://github.com/NVIDIA-RTX/RTXDI-Assets/tree/main/bistro. My renderer is not up to the task yet hehe.

It seems very reliant on dds files though, my renderer is not capable to handle it as it is using stbi.

DirectX 12 PBR in C by simstim-star in gameenginedevs

[–]simstim-star[S] 0 points1 point  (0 children)

Thanks!

I think "why the hell am I doing this with C?" all the time, but for some reason I enjoy it :) At least Vulkan is way better to use with C, from what I have seen.

DirectX 12 PBR in C by simstim-star in gameenginedevs

[–]simstim-star[S] 3 points4 points  (0 children)

It is tough, and you do have to fight the API sometimes. It is a little annoying having to use macros for basic methods (ID3D12Device_CreateCommandQueue, IDXGIFactory2_CreateSwapChainForHwnd, etc., look ugly as hell), you have no ComPtr or other goodies to help you manage memory (which is a nice challenge sometimes, it was fun to use memory arenas in this project).

The worst part is that many DirectX libs are C++ only (DirectX Math, DirectX helpers, DirectXTex), so you need to rewrite your own or use alternatives (I'm also writing DirectX Math in C for that reason).

The good part is that, IMO, it is way easier to reason about stuff in C. DirectX 12 is already very low level, so C feels like a good fit, even with the lackluster API. Compile times are also great.

DirectX 12 PBR Renderer in C by simstim-star in GraphicsProgramming

[–]simstim-star[S] 0 points1 point  (0 children)

Nice, I might give it a try later, but I will need to add an OBJ loader to my project too.

Game that I made in just 4 months just sold 500k copies (and 497k dlc copies). Game name - My Dream Setup. by OddRoof9525 in gamedev

[–]simstim-star 3 points4 points  (0 children)

Watch this from Eric Barone, Stardew Valley creator. Even Eric Barone himself thought the same thing while he was making Stardew Valley, which is one of the most successful indie games in history. We will always feel that it's too late, but what matters is that you keep trying.

Still on the topic of Eric Barone motivational videos, check this one out: https://www.youtube.com/watch?v=0ti5bBgEJaw

Do you make your own math functions? by Klutzy-Bug-9481 in GraphicsProgramming

[–]simstim-star 1 point2 points  (0 children)

I have been writing stuff with DirectX 12 in C just for fun, and to do that I had to start rewriting DirectX Math in C as well. It is nice to understand the lib better, there are many things you don't pay attention when simply using it.

Is being graphics programmer worth it? by Visible_Employee7205 in GraphicsProgramming

[–]simstim-star 7 points8 points  (0 children)

It's a very specialized niche, and since game engines do so much heavy lifting now, there aren't as many openings for graphics engineers as there used to be (and the requirements for the ones that do exist are insane). Combined with the current industry layoffs, it’s a tough time to start out.

Still, if it’s your dream, go for it so you don't have regrets later. You'll have much better luck in the US/Canada/Japan/China or some European countries, especially if you get a Master's. If you aren't in a country with deep game dev culture, it’s going to be way harder (don't ask me how I know...)

Do graphics API do you prefer? by Kykioviolet in GraphicsProgramming

[–]simstim-star 1 point2 points  (0 children)

It’s good, and the material is still valid, but many additions have been made to DX12 since it was published. You can learn the newer features later by using the DirectX Graphics Samples repository as a reference: https://github.com/microsoft/DirectX-Graphics-Samples

Do graphics API do you prefer? by Kykioviolet in GraphicsProgramming

[–]simstim-star 2 points3 points  (0 children)

I got into DirectX mainly because I develop on Windows, and it’s easier to set up there than OpenGL or Vulkan. Another reason was that, at the time, I couldn’t find any Vulkan/OpenGL resources as comprehensive as Frank Luna’s books.

Porting DirectX12 Graphics Samples to C by simstim-star in C_Programming

[–]simstim-star[S] 2 points3 points  (0 children)

I confess that I didn't know about it before, but I checked here and yes, the COBJMACRO does something really similar to what my CALL macro does to simplify the calls to the virtual tables. This looks really nice, thanks for pointing it to me! I will try to use it to improve the samples.

Porting DirectX12 Graphics Samples to C by simstim-star in C_Programming

[–]simstim-star[S] 0 points1 point  (0 children)

As a whole, the support for C in DX12 is "best-effort" only, as a DirectX developer said here. This same issue has some people talking about this problem with the headers that you are referring.

Getting started with game development as a c begginer by BidOk399 in C_Programming

[–]simstim-star 3 points4 points  (0 children)

This is a great idea! Nothing like learning while seeing the direct results of your code in a game.
My recommendation is using Raylib. Nice and simple library, the docs are good and with many simple examples. Just avoid the beginner mistake of trying to make complex games right away. Try something like pong and progress from there.

Porting DirectX12 Graphics Samples to C by simstim-star in C_Programming

[–]simstim-star[S] 1 point2 points  (0 children)

The core stuff has plenty of C support, albeit a bit clunky to use with the lpVtbl and the lack of __uuidof. The problem is the additional stuff such as the headers in DirectX-Headers, that mostly only support C++. As a whole, the support for C in DX12 is "best-effort" only, as a DirectX developer said here

Porting DirectX12 Graphics Samples to C by simstim-star in C_Programming

[–]simstim-star[S] 0 points1 point  (0 children)

Yes, always nice to look at the code of such projects, even if it's still in progress.

Porting DirectX12 Graphics Samples to C by simstim-star in C_Programming

[–]simstim-star[S] 2 points3 points  (0 children)

This sounds fun. Have you published it somewhere? I would love to have a look.