1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Windows Anura 3D (PBR 3D Engine)

Discussion in 'Work in Progress' started by BCrash, Jul 27, 2019.

  1. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    Anura3D Logo Medium.png
    I started working on this project as a little 3D shader experiment back in 2015 (GMS 1.4), to see how far I can go. Right after implementing a traditional per-pixel lighting system I started replacing it by PBR (Physically Based Rendering) to achieve more realistic graphics. In 2017 after updating GMS my project didn't work anymore. I couldn't figure out why, so I took a break. In July 2019 I started porting my engine to GMS 2 step by step. At this point, everything works as intended, so I will continue on GMS 2 from now on. :)

    I will edit this post over time and go into detail on some of the features and techniques. Also I hope to find some help, since i regularly run into unexpected trouble. :)

    2019-8-10 19-35-20.jpg
    Screenshot: July 30, 2019

    Download:
    Not yet. There's soo much to do. I'm going to provide a little material demo as soon as possible.
    Feel free to join my Discord to stay updated with this and other projects: https://discord.gg/bgbdGA8

    Features (re)implemented:
    - Physically Based Rendering (PBR) with different approaches to choose from (for quality/performance balance)
    - Deferred Shading ("unlimited" light sources)
    - Materials based on Unreal Engine workflow (Base Color, Roughness, Metalness)
    - Reflections based on equirectangular images (360°)
    - Import .obj 3D models
    - Basic vertex buffers (at this point only planes, cubes and spheres)
    - Skybox (Skydome)
    - Mipmapping (done in GMS 2 now, had to use a DLL in GMS 1.4)
    - Displacement Mapping
    - And some stuff I probably forgot to mention...

    What's next?

    - WIP: Ambient Occlusion (SSAO)
    - Translucent objects
    - Shadow Mapping (included in GMS 1.4 version)
    - Emissive Mapping (included in GMS 1.4 version)
    - Depth Of Field (included in GMS 1.4 version)
    - Bloom (included in GMS 1.4 version)
    - Dynamic Reflections (not a huge fan of Screenspace Reflections though)
    - Anti-Aliasing
    - There's always something to do...

    Media:
    Most of the textures were taken from https://freepbr.com. Great stuff!
    I will refresh these screenshots/videos every now and then to show the current progress.
    2019-8-10 19-35-20.jpg
    2019-8-3 10-30-3.jpg
    2019-7-31 21-55-10.jpg
    2019-7-30 21-46-27.jpg

    Information:
    Physically Based Rendering is the most realistic realtime rendering "technique" today. Instead of making things more complicated, creating textures is a lot more intuitive. Pretty much every material found on Earth can be simulated by only setting a base color, a roughness value and a metalness value.

    "Physically based rendering (PBR) is an approach in computer graphics that seeks to render graphics in a way that more accurately models the flow of light in the real world. Many PBR pipelines have the accurate simulation of photorealism as their goal."
    From https://en.wikipedia.org/wiki/Physically_based_rendering

    PBR Guide: https://www.substance3d.com/pbr-guide
    An artist's perspective: https://wiki.jmonkeyengine.org/jme3/advanced/pbr_part1.html
    Since I didn't want to limit the number of lights, I decided to use Deferred shading. It's a technique where lighting is calculated in screenspace. To use this technique the scene has to be rendered multiple times. In GMS only HLSL can do that in one pass. Doing that with the GLSL version used in GMS would be very slow.
    So, the performance is pretty good, but it works only on Windows.
     
    Last edited: Aug 10, 2019
    BlueBurn, Gandija, Binsk and 12 others like this.
  2. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    Uploaded a video to showcase the current progress:
     
    Kentae likes this.
  3. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    Improved the lighting. Although both versions are actually correct (depending on material properties), the new one looks more realistic and natural to me:
    Improved Lighting.jpg
     
    Xor, NoobsWeStand and Amon like this.
  4. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    360
    Looks absolutely beautiful!
    I'd like to write a post and tutorial about this. Hope to see more soon
     
    BCrash likes this.
  5. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    @Mert Thank you! Now that'd be great. Still a long road to go, might take a while. :)

    Just finished rearranging the skydome part:
    2019-7-30 21-46-27.jpg
     
    Mert likes this.
  6. Morendral

    Morendral Member

    Joined:
    Jun 27, 2016
    Posts:
    364
    This is really nice, and does a nice job showcasing pushing the limits of what this "2D" engineer is capable of.
     
    BCrash likes this.
  7. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    @Morendral Thank you! :)

    Here's a screenshot of an actual 3D model with some (not so good) PBR texture mapping:
    2019-7-31 21-55-10.jpg
     
    Morendral and Mert like this.
  8. flyingsaucerinvasion

    flyingsaucerinvasion Member

    Joined:
    Jun 20, 2016
    Posts:
    2,088
    Is there a really comprehensive guide to physically based rendering?

    Also, I understand that creating artwork for PBR can be complicated by the fact that you need accurate material property measurements to get anything close to good-looking results.
     
    BCrash likes this.
  9. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    @flyingsaucerinvasion Huge names worked on different PBR approaches (Disney, nvidia, Crytek, Epic,...), so yes, there are loads of helpful websites and in-detail guides.:)
    I will link this one in the first post: https://www.substance3d.com/pbr-guide

    Currently working on displacement mapping:
    AnuraDisplacementMapping.jpg
     
  10. CMAllen

    CMAllen Member

    Joined:
    Mar 2, 2017
    Posts:
    855
    The ambient occlusion isn't strong enough for the version with displacement. With simple bump/normal mapping, you can clearly see the seams and gaps between the pieces. But that all melts together with displacement. Not sure how to fix that.
     
    BCrash likes this.
  11. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    @CMAllen Thanks for your comment! At this point there's no ambient occlusion at all. I'm not sure if I understand you right, because the gaps you mentioned do look better to me with displacement enabled (the normal map is made to work with rounded stones - the lighting looks wrong on flat textures). Also some of the gaps are visible because the stones have different heights.
    If you mean the stones don't occlude each other, you might have to take a closer look. The technique I am implementing is called Parallax Occlusion Mapping.

    Here's a bunch of new screenshots using different texture maps with extreme height settings (like you wouldn't use in a game). The camera is really close to the surface:
    2019-8-3 10-22-1.jpg
    2019-8-3 10-30-3.jpg
    2019-8-2_0-0-1.jpg
     
  12. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    125
    Is this all done natively with shaders?
     
    BCrash likes this.
  13. lolslayer

    lolslayer Member

    Joined:
    Jun 23, 2016
    Posts:
    680
    Looks amazing, great stuff man!
     
    BCrash likes this.
  14. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    Thank you guys.
    @lolslayer Yes, it's all done in GMS 2 using the built-in shader editor.
     
    Cpaz likes this.
  15. lolslayer

    lolslayer Member

    Joined:
    Jun 23, 2016
    Posts:
    680
    Great :)
     
    BCrash likes this.
  16. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    360
    Hi. Will this be compatible with all platforms?
    I'm wondering :rolleyes:
     
    BCrash likes this.
  17. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    Hi @Mert, sadly it's Windows only at this point. The GLSL version used in GMS does not support MRT (Multiple Render Targets), so it would be very slow.

    Here's the usual comparison image when it comes to PBR (made in Anura 3D). It describes the material workflow best. Usually "metalness" is either 0 or 1, because in reality there are no materials in between. So just to show the difference: RoughnessMetalness.jpg
     
  18. Ali Al - Mosawi

    Ali Al - Mosawi Member

    Joined:
    Jun 20, 2016
    Posts:
    50
    WoW thats perfect do you try make detailed scenes
     
    BCrash likes this.
  19. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    @Ali Al - Mosawi Thank you! I want to use it for some smaller 3D games later.
     
  20. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    Started implementing Ambient Occlusion. Glad the first step is done! :)

    2019-8-8 0-21-5.jpg
     
    SnotWaffle Studios likes this.
  21. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    This really is the most basic implementation of SSAO I can think of and it still needs a lot of tweaking (and fixes). Just want to show today's progress:
    2019-8-8 0-38-53.jpg
     
  22. BCrash

    BCrash Member

    Joined:
    Aug 5, 2016
    Posts:
    20
    Still working on Ambient Occlusion (SSAO). So far:
    2019-8-10 19-35-20.jpg
     
    Joe Ellis likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice