Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

  • Days Won


DiligentDev last won the day on January 14

DiligentDev had the most liked content!

Community Reputation

173 Neutral


About DiligentDev

Personal Information


  • Twitter
  • Github

Recent Profile Visitors

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

  1. Yes, it is. Android build system needs some care first, but Vulkan on Android is in plans.
  2. The latest release of Diligent Engine combines a number of recent updates (Vulkan on iOS, GLTF2.0 support, shadows), significantly improves performance of OpenGL backend, updates API, adds integration with Dear Imgui and implements new samples and tutorials. Some of the new features in this release: GLTF2.0 support (loader, PBR renderer and sample viewer) Shadowing Component and Shadows Sample Integration with Dear Imgui library and Dear Imgui demo Tutorial13 - Shadow Map Tutorial14 - Compute Shader Tutorial15 - Multiple Windows Check it out on GitHub.
  3. DiligentDev

    Efficient dynamic buffers in OpenGL

    Thank you for the suggestion. It turned out that the problem was caused by binding the buffer to GL_COPY_WRITE_BUFFER target. Binding the buffer to GL_ARRAY_BUFFER fixed the issue.
  4. Hello! I am trying to find efficient map-write-discard implementation in OpenGL, but with no luck so far. Following suggestions on this page, I tried both buffer orphaning with glBufferData(NULL) as well as glMapBufferRange(GL_MAP_INVALIDATE_BUFFER_BIT), both with depressing performance (approximately 40x slower than similar implementation in Direct3D). The method should ideally be suitable for OpenGL4.2 / GLES3.0 API, so glBufferStorage is not desirable, though initializing the buffer with glBufferStorage(GL_DYNAMIC_STORAGE_BIT|GL_MAP_WRITE_BIT) makes no difference. As an experiment I also tried mapping with GL_MAP_UNSYNCHRONIZED_BIT flag with no difference either. Various usage hints (I use GL_DYNAMIC_DRAW) also have zero effect as well. In my benchmark I render 32K objects with individual draw calls and map/unmap constant buffer before every call. On my 970GTX, this benchmark runs at ~4 ms/frame in D3D11 mode and 140 ms/frame in OpenGL. Here is what my map/unmap functions look like: void BufferGLImpl :: Map(MAP_TYPE MapType, Uint32 MapFlags, PVoid &pMappedData) { m_uiMapTarget = ( MapType == MAP_READ ) ? GL_COPY_READ_BUFFER : GL_COPY_WRITE_BUFFER; glBindBuffer(m_uiMapTarget, m_GlBuffer); GLbitfield Access = 0; switch(MapType) { case MAP_READ: Access |= GL_MAP_READ_BIT; break; case MAP_WRITE: Access |= GL_MAP_WRITE_BIT; if (MapFlags & MAP_FLAG_DISCARD) { if (m_bUseMapWriteDiscardBugWA) { glBufferData(m_uiMapTarget, m_Desc.uiSizeInBytes, nullptr, m_GLUsageHint); Access |= GL_MAP_WRITE_BIT; } else { Access |= GL_MAP_INVALIDATE_BUFFER_BIT; } } if (MapFlags & MAP_FLAG_DO_NOT_SYNCHRONIZE) { Access |= GL_MAP_UNSYNCHRONIZED_BIT; } break; case MAP_READ_WRITE: Access |= GL_MAP_WRITE_BIT | GL_MAP_READ_BIT; break; } pMappedData = glMapBufferRange(m_uiMapTarget, 0, m_Desc.uiSizeInBytes, Access); glBindBuffer(m_uiMapTarget, 0); } void BufferGLImpl::Unmap() { glBindBuffer(m_uiMapTarget, m_GlBuffer); glUnmapBuffer(m_uiMapTarget); glBindBuffer(m_uiMapTarget, 0); m_uiMapTarget = 0; } Am I doing something obviously wrong here? Is there a clear way to tell OpenGL that I want to discard all previous contents of the buffer?
  5. DiligentDev

    GPU Particle Collision System

    Sorry about the confusion with complexity. Overall complexity is of course O(n) (fixed this in the description). What I meant was of course the complexity of testing one particle. No, not really. SV_DispatchThreadID can be totally used instead.
  6. Hello! I recently added a new Diligent Engine tutorial that demonstrates the usage of compute shaders and may be useful on its own. The example app implements a simple GPU particle system that consists of a number of spherical particles moving in random directions and encountering elastic collisions. The simulation and collision detection is performed on the GPU by compute shaders. To accelerate collision detection, the shader subdivides the screen into bins and for every bin creates a list of particles residing in the bin. The number of bins is the same as the number of particles and the bins are distributed evenly on the screen, thus every bin on average contains one particle. The size of the particle does not exceed the bin size, so a particle should only be tested for collision against particles residing in its own or eight neighboring bins, resulting in O(1) algorithmic complexity. The full description of the implementation of the method is here.
  7. DiligentDev

    Shadows in Diligent Engine

    Also, check out the shadow map tutorial that demonstrates the basic steps to render and use the shadow map.
  8. Diligent Engine now implements some shadow rendering BKMs: - Cascaded shadow maps with cascade stabilization - PCF - Variance shadow maps - Two and four-component exponential variance shadow maps - Optimized fixed-size or world-sized filter kernels - Best cascade search based on projection into light space - Filtering across cascades - Various artifact removal techniques The main goal is to create a plug-and-play shadowing component that can be easily integrated into applications. The component consists of a shadow map manager and few shader functions. A Shadows sample demonstrates how to integrate Diligent shadows into an application. Check it out on GitHub: https://github.com/DiligentGraphics/DiligentEngine#high-level-rendering-components-1 I am planning to add exponential shadow maps and moment shadow maps later. Are there any state-of-the-art shadowing techniques that I should also take a look at? Credits: Variance Shadow Maps Shadow sample update by MJP Shadow Explorer sample from Intel Cascaded Shadow Maps technical article by Microsoft
  9. The Viewer now also supports Android!
  10. Diligent Engine now supports GLTF2.0 and implements physically-based renderer with image-based lighting. Check out the cross-platform GLTF Viewer. The viewer now runs on Windows, Universal Windows, Mac and Linux. Android and iOS are coming soon.
  11. Vulkan is enabled by MoltenVK and has very few limitations. Check out the latest version on GitHub.
  12. Check out the new release (v2.4.b) that features improved shader resource reflection, improved pipeline resource layout definition, better OpenGLES3.0 support, new Render Target tutorial (credits to dolphineye for contribution) and more (see full release notes).
  13. I started work on DiligentFX, a high-level renderer. As the first step, I reworked epipolar light scattering effect and made it ready-to-use component with a clear interface. Check it out on GitHub.
  14. There is really no efficient solution to resolving state dependencies in multithreaded environment, which is why D3D12 and Vulkan make that an application's problem. I believe that giving an option to choose between manual and automatic state management is a convenient way to make API easy to use yet expressive when necessary.
  • 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!