Modern applications and games create framework above DirectX?

Started by
7 comments, last by L. Spiro 9 years, 1 month ago

Hi

Modern applications and games create framework like this above graphics API - http://www.rastertek.com/dx11tut02.html ? And does this helps in optimizing performance?

Or

Is it beneficial to do the entire task in a single file like this without creating framework above graphics API - http://www.directxtutorial.com/Lesson.aspx?lessonid=11-4-4 ? And does this improves performance?

Thanks

Indy

Advertisement

Creating a framework is the correct path.

  • It allows you not to re-code everything needed to create a window every time you start a project.
  • It allows you to build an organized set of code you can easily move to the next project.
  • It eventually allows you to port your engine to another platform or API, such as to VULKAN, Direct3D 12, Metal, etc.
  • It allows you the possibility to improve performance (though just building a framework in itself doesn’t necessarily give you any gains or losses in performance—you have to code performance into your framework).

Slamming everything into a single file is just for the sake of making the tutorials easier to follow. Outside of that, it is extremely bad practice.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Thanks a lot!

I have one more question regarding DirectX in Unreal Engine.

In this screenshot, How C++ cross platform renderer communicates with DirectX through RHI?

Let's say if I want to accomplish this - http://www.rastertek.com/dx11tut04.html how UE4 will do that(draw a triangle)?

Thanks

Indy

In UE4 the RHI is a low-level graphics API designed by Epic and implemented via platform gfx APIs (D3D, OGL, Metal, etc.). RHI - quite - removes the need of writing different render path/different framework implementation, however capability differences of different platforms and different gfx API still take place (mostly exactly in RHI implementations). It's mostly a different design choice.

Since most of current gfx API still have a lot of abstraction, the RHI approach could turn into a double-edged sword, especially for unexperienced developers, resulting in awkward design and higher overhead.

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

So Can I say like this for UE4 renderer RHI is like DirectX(without considering implementation)?

Yes, all but RHI is an API based on the concept of command lists, to draw a triangle you will call FRHICommandDrawPrimitive::Execute instead of ID3D11DeviceContext::Draw.

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

Thanks for the reply.

Can you provide me a link where I can learn about command lists?

Thanks

Indy

Custom command lists are an advanced subject typically only necessary for advanced techniques such as multi-threaded rendering.
They are also easy to implement (once you are advanced enough to be using them) in the future on top of the basic render system you should be making now.

Worry about command lists when you get to them. For now, try learning just to walk.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement