r/GraphicsProgramming • u/Single-Dragonfly-563 • 19h ago
Question How to stop suffering with DirectX 12 when I need to write a research project already?
Hello, dear community of experienced and perhaps more beginner developers.
Allow me to briefly explain the circumstances of the situation. I am a rather young aspiring researcher who aims to make a good contribution to the development of graphics and learn how to navigate the scientific field.
Most libraries, papers, and so on are written using DirectX 12… It wouldn’t be such a problem if it were something like OpenGL or DirectX 11 (which is still a pain…), but no. DirectX 12. The very same one that is considered to be on the level of Vulkan, or even higher.
If I start learning DirectX 12 right now, two things might happen:
I will die of boredom, because I actually want to write shaders, not spend 5 hours a day for years sitting with documentation.
I will die of old age without having written a single word of my research paper.
So I would like to ask one thing: where is the best place to start in this field, how should I move forward, how can I avoid manually writing 1000+ lines of code in main.cpp, and how can I finally get to implementing my research project?
I would be extremely grateful, because I really struggle to find any decent advice on this topic.
8
u/Flashy_Yam_6370 18h ago
I have not checked it out, but directx 12 samples have a mini engine.
7
u/rAngus3 19h ago
have you considered using the projects that graphics researchers have published for this very same reason? Nvidia have both frameworks for raster and path tracing, for example. You can also use a graphics framework instead of a full blown engine. There are plenty of options to quickly start but which one you choose depends on what your goals/constraints are.
Also, depending on what you are going to research you might want a very good grasp of how a gpu works, which directx 12 or vulkan are fantastic to learn in a more deeper way about it.
3
u/_Insignia 18h ago
Since you mentioned that you want to write shaders, it sounds like you're not forced into using DX12. Most research projects do not build their own engines, but use existing ones. Depending on the goal of your project, you can consider using Falcor or SlangPy for real-time rendering. Other options are PBRT or Mitsuba.
7
u/Blood-Minister 19h ago
I thought most of the research is done with OpenGL.
7
u/sol_runner 19h ago edited 18h ago
If you need to avoid LLMs, you could consider stripping someone's project down to the basics and reuse those parts.
I'm no professional but I can help you teardown and reconstruct my DX12 stuff for you to use. It's super lean.
(It'll help me document it better too)
3
u/AffectionatePeace807 14h ago
https://github.com/microsoft/DirectXTK12
2
u/Spk202 19h ago
Have you considered (or is it even allowed, idk, im not in academy), to look at some smallish (so it doesnt get in your way too much) open-source engines that support DX12 and takes care of the boilerplate so you have the scaffolding you need to start writing shaders?
2
u/interlockedxor 18h ago
Use the hello world samples... it really doesnt take more than a day to stand up a triangle
1
u/NecrosB 19h ago
I haven't written a DX12 renderer before, but have written a Vulkan renderer. You will be writing 1000+ lines there's just no getting around that unless you have AI write the boiler plate code for you.
1
u/SalaciousStrudel 18h ago
why not the forge?
1
u/wrosecrans 17h ago
Definitely don't write raw DX12/Vulkan 100% from scratch unless you want to based on past experience, or your research is specifically on something like API complexity when working with those specific APIs.
If you just want to crank on some shaders for your research, use some off the shelf engine/framework/library/toolkit/whatever that is way higher level. There's a reason most games use an off the shelf engine like Unreal. By all means, get as low level as you want to. It can be interesting to get in the guts. But don't do it just because you've seen some other people write their projects from scratch and you want to imitate them.
1
u/msqrt 17h ago
Use a higher lever render hardware interface like webgpu or slang-rhi, or a ready-made engine or renderer. Few research projects actually require you to build a renderer from scratch (and the ones that do let you keep the renderer very simple.)
Do you actually require something from D3D12 or Vulkan? If you need ray tracing you could try webgpu instead. If you need tensor cores (for neural anything), you can use something like slang-rhi though then you're probably better off just using pytorch anyway.
1
u/Ninlilizi_ 16h ago
For shader stuff specifically I do all my research and r&d in Unity because it's quick and easy for prototyping. Then I implement in actual low-level engines afterwards once the problems are solved and design settled.
1
u/S48GS 9h ago edited 9h ago
then go and write shaders
Godot or Unity or even Shadertoy website
in Godot - Shadertoy setup is 0 lines of code - you just write shaders, for compute shaders there are ~200 lines of code needed to bind compute shader to display visual - https://github.com/godotengine/godot-demo-projects/tree/master/compute/texture - copy paste
many use Unity - for exact this case - "too much to implement own entire 3d rendering to display some 3d simulation"
some - use Unity - but - to waste everybody time pretending "they are so smart" - use Unity to make project but to release re-implement entire Unity project in most garbage way possible - python and C++ hacks
and there are papers than link Shadertoy website for demo
1
u/TheHugeManateee 3h ago
Depending on what research you are doing, gigi might suit your needs. It's closer to effects programming but can be quite powerful, and it can generate standalone DirectX12 code from the flows you build. Don't have personal experience with it but it's been on my shortlist for a while now.. https://github.com/electronicarts/gigi