Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Great library and some questions. #29

Closed
v7medz opened this issue Dec 11, 2018 · 7 comments
Closed

Great library and some questions. #29

v7medz opened this issue Dec 11, 2018 · 7 comments
Assignees
Labels

Comments

@v7medz
Copy link

v7medz commented Dec 11, 2018

Hi, recently I have been using LLGL to replace the ugly underlying API layer in my engine, I am a big fan of LLGL architecture as I hate opengl-like architecture "ex: bgfx", anyways I have some questions about this library.

1-Why supporting OpenGL?
Vulkan is a great successor and run on almost all platforms that OpenGL run on, and can run on mobile devices plus it has DirectX-like structure and a modern API. The reason I dislike OpenGL is it has some sort of legacy function that is still used until now! for example it requires a vertex format for each vertex buffer created!
correct me if I am wrong but it is the only API that does that in 2018.

2-Do I have to create a resource heap for each pair of Texture and sampler in every shader?

3-Will I need more than one CommandBuffer for my project?

4-Why is "RenderSystem" / "Renderer" named with these names? shouldn't they be named Context and the "Context" class should be named Device?

  • I kinda prefer DirectX namings + naming anything with "Renderer" can cause huge confusion especially with newcomers.
@LukasBanana
Copy link
Owner

LukasBanana commented Dec 11, 2018

  1. The Vulkan, D3D12 and Metal backends are still in an experimtenal state, so OpenGL and D3D11 are the only backends that are reliable enough for productive projects. The VertexFormat struct is also required for all other renderers. OpenGL is just very old school about binding multiple vertex buffers at once, though. This is why LLGL still has the BufferArray interface. I wrote about this in one of the tickets.

  2. I don't know which kind of pairs you need, but if you have two different pairs with one for each shader, then yes. You also need a unique PipelineLayout for each shader that has a unique resource layout. You can use the utility function LLGL::PipelineLayoutDesc to simplify the delcaration of your layout (see this example).

  3. No, you could create more than one but LLGL can currently not benefit from it. In the future, when LLGL finally supports secondary command buffers that can be encoded in parallel, then it is reasonable to use more than one CommandBuffer.

  4. LLGL is designed with a lot of naming conventions coming from D3D, but not all. The RenderContext is associated with a swap-chain and a Surface (or Window), while the RenderSystem represents the instance of LLGL's main system that owns all resources.

@LukasBanana LukasBanana self-assigned this Dec 11, 2018
@v7medz
Copy link
Author

v7medz commented Dec 12, 2018

  1. Does this mean if I want to render two cubes each has the same set of data (VertexBuffer, IndexBuffer, ConstantBuffer), but have different textures should I create a unique resource heap for each?

@LukasBanana
Copy link
Owner

Yes, you need one resource heap for each set of resources. If your set consists of only a single texture, then you need two resource heaps for your two different textures. It's the same restriction you have with a "DescriptorHeap" in D3D12 and "DescriptorSet" in Vulkan.

However, it is more efficient to have an array texture (e.g Texture2DArray in HLSL) where all your scene textures are stored. Then you need only one resource heap for all your geometry. This in turn comes with the restrictions that all your textures need to have the same resolution. Which layer of the array texture to sample from must be stored elsewhere, e.g. in a constant- or storage buffer.

@v7medz
Copy link
Author

v7medz commented Dec 12, 2018

How can I make cmake generate 64-bit projects for LLGL? (I wanted to fork the project and help you in it but I couldn't generate 64 bit projects)
TBH, I prefer Visual Studio over cmake and I don't know a damn thing about cmake project generation.

Also, Thanks for answering my questions, It seems that I am the only one who tried to use LLGL in a his engine "cant find anyone who does that on github", so I am probably going to ask a lot of questions so I hope I wont bother you.

@LukasBanana
Copy link
Owner

You can select a different generator when you hit Configure in the CMake GUI for the first time. There should be one like Visual Studio 14 2015 Win64.

@v7medz
Copy link
Author

v7medz commented Dec 16, 2018

Thanks, Also do you know any other engine than mine that uses LLGL? I am trying to understand LLGL better, especially in projects larger than sample examples.

@LukasBanana
Copy link
Owner

These are the only two projects I know of that are using LLGL:

@v7medz v7medz closed this as completed Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants