Jump to content
  • Advertisement
Sign in to follow this  
BornToCode

OpenGL Mimic DirectX11 Binding System in OpenGL.

This topic is 2034 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I guess the topic says it all. I am working on a wrapper which looks very similar to DX11 but uses OpenGL in teh backend instead. I am trying to simulate the Binding system that directX11 uses in OpenGL. Currently the way i am doing it is that if you want to use the same resource for different stages in the pipeline i find myself duplicating the buffers for each Bind instead of reusing the same Index, and whenever one of the index change it updates all the other buffers to match the data in the one that change. I am just posting this to see if anyone might have a better idea on how to approach this, or if this will be even possible under opengl since each resource can only be mapped to an single object type.

Share this post


Link to post
Share on other sites
Advertisement

What part of the D3D11 behaviour are you trying to implement exactly? "The binding system" is a bit vague. From the sounds of it, you're specifically looking for D3D11's concept of a "view", to allow one bit of memory to be interpreted as different kinds of objects?

Share this post


Link to post
Share on other sites

What part of the D3D11 behaviour are you trying to implement exactly? "The binding system" is a bit vague. From the sounds of it, you're specifically looking for D3D11's concept of a "view", to allow one bit of memory to be interpreted as different kinds of objects?

That is correct Hogman. I am trying to implement the whole view concept of D3D11. But like i said in OpenGL there is no way to create a buffer and interpret that buffer as multiple different type of resource since you usually have to define the buffer type in glBindBuffer. So to get around that right now, i am duplicating the resource for n binds. Then whenever any of the bind index change it updates all the other binds. Also i end up with duplicating resources which i am trying to avoid. The other option would be to copy the resource to some system memory. Then before binding a resource to a stage i can change the resource type and resource and access it that way. Doing it in Software is not a problem, I mean the hardware supports it, otherwise directx11 would not be able to do it, but for opengl that is not exposed. That is the thing i hate with closed API. Why not just give us straight access to the hardware like Carmack says in one of this interviews.

 

Not sure I entirely understand the specific issue, but I can at least say that Valve wrap OpenGL in the same way. If that's any help.

What i am actually doing is a writting a 3D Api that looks identical to DirectX11. But what makes it better than DirectX in my opinion is that it is an Header Only and it is build around an Plug in system. Right now i am writting the opengl renderer pluging for it. The whole purpose of this project is that it will be used in my engine, also it will be open source and hopefully someone will be able to write a plugin for ps4 and the next xbox. So whenever someone wants to use the API they do not need an bunch of libraries and headers. All they need is the Beast.h header which contains all the interfaces definitions that needs to be implemented by whoever is implementng the plugings. So at the end you have one code that can be plug to any renderer writting withing the contraint of the provided interface. The interface is also written with extension in mind. Also Valve system is alot easier to implement since their implementation is based of the direct x 9 api which had no concept of Views.

Edited by BornToCode

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!