• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
BlackBrain

Graphics Layers for different for Directx11 and Directx12

12 posts in this topic

Hi .

 

Well I'm in the middle of developing a graphics engine and I heard about the Directx12 . I want that in future I can get Directx12 support to my engine with minimal effort . So I think I have to create a Graphics layer that objects call that and that layer get in to contact with the graphics API.

 

How should this be done ? Is there any standandard form ? any example ?

1

Share this post


Link to post
Share on other sites

That's nice . I think this the fastest way . Maybe function pointers come handy at this situation . Instead of havina a launcher the application can in realtime assign appropriate functions that the platform supports to the pointers . And then application moves on with calling only these function pointers .

0

Share this post


Link to post
Share on other sites

I then have many cpp files that implement then stuff in these headers, e.g. I'd have a single Device.h, and then Device_D3D11.cpp, Device_D3D9.cpp, etc...

This is what we do at work.
 

Maybe function pointers come handy at this situation . Instead of havina a launcher the application can in realtime assign appropriate functions that the platform supports to the pointers . And then application moves on with calling only these function pointers .

 
That would be a great way to make a mess of your code, and since the application would link to both Direct3D 11 and Direct3D 12, only people running Direct3D 12 could run it, making Direct3D 11 a useless parasitic twin.

If you took anything away from what Hodgman said let it be the part regarding multiple executables.  This is standard in the industry for a reason.

 

 

L. Spiro

Edited by L. Spiro
2

Share this post


Link to post
Share on other sites

Since I am using c# there is no concept of headers or such things . What I am thinking right now is using interfaces , delegates and virtual methods to make things clear .

When I link direct3d11 and direct3d12 to my project (sharpdx versions in my case) they are loaded but as far as I don't initialize a device on direct3d12 is that going to cause a problem ?

When I don't initialize the direct3d12 device how is that going to cause a problem ?

0

Share this post


Link to post
Share on other sites
 

Since I am using c# there is no concept of headers or such things . What I am thinking right now is using interfaces , delegates and virtual methods to make things clear .

When I link direct3d11 and direct3d12 to my project (sharpdx versions in my case) they are loaded but as far as I don't initialize a device on direct3d12 is that going to cause a problem ?

When I don't initialize the direct3d12 device how is that going to cause a problem ?

 

At least you need to provide many final compiled objects (EXEs or DLLs) as many platform you want to support since if you put and link all together in a single executable you will require the final user to have a system supporting all those implementations!

 

As Hodgman and phantom suggested:

- you can provide many different executables as many platform you want to support (e.g.: game11.exe, game12.exe, gameOGL.exe)

- you pack every single API stuffs implementation into a DLL for each platform and then dynamically link the right DLL to the final executable depending on which platform the executable is running (eg: game.exe, gfx11.dll, gfx12.dll, gfxogl.dll)

 

You can also provide a luncher and let the user choose the implementation supported by the system, using one of the above solutions (eg: luncher.exe, game11.exe, game12.exe, gameOGL.exe OR luncher.exe, game.exe, gfx11.dll, gfx12.dll, gfxogl.dll).

 

In my opinion the DLL option is better for maintenance reasons. 

 

This matter is valid not only for graphics or gaming, but for every software that need to target multiple platforms and systems requirements.

Edited by Alessio1989
1

Share this post


Link to post
Share on other sites

In my hobby project i have some abstract classes(interfaces) for graphics rendering like: Vertex Buffer, Shader, Texture etc.

Any new rendering system(OGL, DirectX) needs to implement those classes.

 

Also i'm loading it as .dll plugin so it libraries can be run-swapped and there is no need for recompiling code for those subsystems.

 

The biggest price you pay for this interfacing are cache misses which can damage your cpu performance, but for home projects that shouldn't be that big problem

1

Share this post


Link to post
Share on other sites

Thanks every one . I've designed a renderer using xna ( http://www.gamedev.net/gallery/album/800-smile-engine/ )   . I decided to migrate to dx11 because I needed a lot of more modern things (atomic functions,compute shaders,tesselation) . At Least I know things that are possible now probably will be possible in dx12 too. I want to reuse my code as much as possible for future. Howecer, as mentioned we are not aware of the dx12 design . Maybe my code just makes it slower and no benefit from dx12.

But at least I need a level of abstraction because in future I probably want to support OpenGL too.

0

Share this post


Link to post
Share on other sites

 

I then have many cpp files that implement then stuff in these headers, e.g. I'd have a single Device.h, and then Device_D3D11.cpp, Device_D3D9.cpp, etc...

This is what we do at work.
 

Maybe function pointers come handy at this situation . Instead of havina a launcher the application can in realtime assign appropriate functions that the platform supports to the pointers . And then application moves on with calling only these function pointers .

 
That would be a great way to make a mess of your code, and since the application would link to both Direct3D 11 and Direct3D 12, only people running Direct3D 12 could run it, making Direct3D 11 a useless parasitic twin.

If you took anything away from what Hodgman said let it be the part regarding multiple executables.  This is standard in the industry for a reason.

 

 

L. Spiro

 

 

Not entirely true. I've had success in the past with Direct3D 9 and 10 in the same executable by marking the D3D dlls as being delay loadable, and then checking for which version of Direct3D the user's system was capable of running and loading that rendering path.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0