Jump to content
  • Advertisement

Jan Haas

  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About Jan Haas

  • Rank

Personal Information

  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hey guys, I hope this is an appropriate question. Well, I tried to design a little part of my rendering layer. bgfx oriented. Question: Is this good design? And what changes would you suggest? vboID CreateDynamicVertexBuffer(VertexBatch, Duration); vboID CreateStaticVertexBuffer(VertexBatch, Duration); void UpdateVertexBuffer(vboID); void DeleteVertexBuffer(vboID); - My interface works with IDs that are structs for type safety . An ID maps to something the corresponding method(s) can interpret. It doesn't necessarily map to OpenGL handles etc. A create* method yields a valid ID. If the creation fails an exception is thrown. - VertexBatch is responsible for capturing the vertex data. It provides convenient OpenGL Intermediate Mode syntax. It has no virtual methods because it needs to be fast. - Duration is an enum that lets you specify how long the data will remain on the GPU memory. The reason is that I can batch static level geometry together in one big Vertex Buffer and just return the offset into this buffer. Other types of memory can be handled differently, but I don't know how... Question: How do you normally handle this scenario and what is with data that frequently changes? - Dynamic Vertex Buffer cannot be updated, StaticVertexBuffer can. - If a vboID is deleted I may or may not destroy the underlying resource. Depends on the type of memory (frequently changing etc.) If this question somehow doesn't belong here, it's okay Thank you Jan
  2. Nice, thanks for all the replies. I will use a virtual interface too
  3. Do you think AZDO and DX 11 are compatible? Because I feel the azdo style is completely different than dx11
  4. Thanks so much guys, this really helps me - Alright I will go with pure virutal interface. Decision made. - Originally I wanted to, but having to write 800 loc just to draw a triangle was a turn off. So instead I will target AZDO opengl 4.5. Hope it's somehow compatible with the other concepts. - Command Buffers are essential with AZDO I think (because of Indirect draw calls) - Well maybe I will target Vulkan if it's somehow the superset of the other APIs... Thanks again
  5. Thanks for the answer. I want to implement the first option: API-Level abstraction and specify common interfaces for all APIs I want to target But how do you efficiently implement different backends?
  6. Hello guys, title says it, I want create an api agnostic rendering layer (like bgfx, but not trying to compete). My idea was to specify an interface IRenderLayer that defines the specific functions. Implementations will then override these functions and implement api specific behavior. However I always read that virtual function calls should be avoided in hot code paths and I also understand why. But then again, how should I implement runtime api selection without using runtime polymorphism? Thanks
  7. Jan Haas

    Day one: Planning how to Plan things

    I'd be down. Depends tho. Do you want to write your own engine or use Unity / Unreal?
  8. Hello guys My engine is currently only capable of rendering using materials that are shared among different meshes. (Change one parameter -> every mesh has it) So my rendering loop looks like this: for all materials m: upload common matrices (projection etc.). Use the shader. Then for all meshes associated with m: Render it after uploading model matrix. But what if I want to instance a material (like in UE4)? This would mean that I either have to create a different shaderprogram for all different instances OR use one common shaderprogram. The last option implies that I have to update the uniforms of said shaderprogram each time I render an object with a material instance. So I don't know whats worse: A State change or high frequency updates of uniforms which decreases my bandwidth? My question: What is the best way to deal with the problem and how would a possible render loop look like? Thank you.
  9. Hello, I just found out about https://github.com/shader-slang/slang. It's a shader language and accompanied by a library that is supposed to make it easier to work with modular shaders. What do you think about that? Here is the paper that describes the concept: http://graphics.cs.cmu.edu/projects/shadercomp/he17_shadercomp.pdf Thanks in advance
  • 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!