Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1369500 Posts in 64351 Topics- by 56368 Members - Latest Member: concrete_games

November 20, 2019, 01:44:50 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Shadows in Diligent Engine
Pages: [1]
Print
Author Topic: Shadows in Diligent Engine  (Read 399 times)
assiduous
Level 0
**


View Profile
« on: July 23, 2019, 11:40:31 PM »

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 techniques are implemented as a standalone shadow map manager and few shader functions that can be easily integrated into an application.
Check it out on GitHub:
https://github.com/DiligentGraphics/DiligentEngine#high-level-rendering-components-1
https://github.com/DiligentGraphics/DiligentSamples/tree/master/Samples/Shadows

I am planning to add exponential shadow maps and moment shadow maps later. Are there any state-of-the-art shadowing techniques that I am missing?
Logged
fluffrabbit
Guest
« Reply #1 on: July 28, 2019, 10:23:14 AM »

That's amazing, and I don't have a clue about buffered shadow techniques as I have yet to implement them in my own code. No seams? That's great!

However, I'm not fond of the project organization. You use a lot of little files as well as submodules, which is hardly keeping with the philosophy of compactness and simplicity. Aside from graphical quality, how does Dilligent compare against Ogre3D and Panda3D?
Logged
assiduous
Level 0
**


View Profile
« Reply #2 on: August 05, 2019, 09:12:23 PM »

Speaking about code organization, there are adherents of two principal schools: the first one puts everything into a giant file so that everything is in one place. I've seen files with 50,000+ lines of code. This is definitely convenient from integration point of view, however supporting or working with such files is a nightmare. This file is essentially a black box of code.

The second school breaks everything into small components. As you can tell, I am from the second school. I do believe that modular organization tells a lot about the project structure, while copying a folder is just little bit more extra work than copying a single file.
In Diligent Engine, different modules can be enabled/disabled as necessary: all backends, samples, tutorials, demo project can be turned on/off as needed. Projects are organized into hierarchy where more complex are built on top of more basic ones. The folder structure is easy and natural to navigate even though it contains many files.

Speaking about Ogre3D, Diligent Engine is more low-level library. It does not have an editor, but provides low-level functionality and a set of basic building blocks (PBR shaders, shadows, post-processing, etc.)
Logged
fluffrabbit
Guest
« Reply #3 on: August 06, 2019, 06:09:07 AM »

That makes sense, though my own GL framework is only up to 2000 lines total, so it's (currently) maintainable as 1 file. When it breaks 3000 lines I'll consider splitting it into multiple files, but I find it annoying when I can't find where I put a piece of code and it's in the last place I look because of the arbitrary boundaries I put between functionality. The things you've specifically mentioned (PBR, shadows, post-processing) are all part of 3D graphics, so they would go in the main file. Things that take up more space, like loading needlessly complex 3D model formats such as glTF, would go in their own file dependent upon the main file. That way you/I can still have 50,000 lines eventually but spread out over 10 files rather than 100.
Logged
assiduous
Level 0
**


View Profile
« Reply #4 on: August 06, 2019, 07:52:34 AM »

Diligent Engine's core module now contains more than 100,000 lines excluding any third-party projects. Splitting this into 2,000-line files will still make 50+ files. Like I mentioned, the boundaries between projects are not arbitrary, but very carefully thought of. They help navigate the code rather than making it harder to find what you are looking for. Because of this structure I can easily find anything by just browsing the source on GitHub.
Logged
fluffrabbit
Guest
« Reply #5 on: August 06, 2019, 08:44:07 AM »

Well, large codebases call for desperate measures. You're approaching the size of an operating system there. It's great that you're providing a reference for how every graphical technique on the planet works. I cherry-pick and avoid the size. To each their own.
Logged
assiduous
Level 0
**


View Profile
« Reply #6 on: August 06, 2019, 09:12:48 AM »

100,000 lines is not really a very big project. If you look at Ogre3D, it is likely 1,000,000+ lines.

BTW, I just added shadow map Tutorial that shows the basics of shadow map rendering
https://github.com/DiligentGraphics/DiligentSamples/tree/master/Tutorials/Tutorial13_ShadowMap
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic