• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

Windows Anura 3D (PBR 3D Engine)

BCrash

Member
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:

Mert

Member
Looks absolutely beautiful!
I'd like to write a post and tutorial about this. Hope to see more soon
 

BCrash

Member
@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
 
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.
 

CMAllen

Member
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

Member
@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
 

BCrash

Member
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
 
  • Like
Reactions: Yal

BCrash

Member
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
 

BCrash

Member
Hey guys, sorry for not posting any news recently. Currently cleaning up the project and reorganizing the whole structure (creating and sorting scripts for easier usability, optimizing a lot of code, renaming internal variables, ..that kind of stuff). It takes some time, but it's important. On the plus side, the performance is even getting noticeably better. :)

Also had a few test runs on some friend's PCs. Turns out the SSAO approach I used is a massive bottleneck on older GPUs. Can't tell why at the moment (I figured out that it is only one line of shader code, but it doesn't seem to make any sense). Will try a different approach soon.

Since I don't want to annoy you with more spheres and cubes, today's screenshot is from the GMS 1.4 version (September 2016). I'm not sure if I will continue work on the modeler, since it's extremely time consuming. We'll see.

If you haven't yet, feel free to join our Discord to follow this and other projects (e.g. Twitch Plays games).

Thank you! :)

2016-09-06 001.png
 

Yal

🍋 *lemon noises*
GMC Elder
Looks really impressive, hard to imagine it's even possible to do something like this in GM! (Which I guess is because you mostly made it in GL instead :p). I don't have anything to add to the discussion, so I'm just gonna post here to get notifications in case you ever release it.

Oh yeah, and the metalness/roughness comparison was pretty cool, I've gone through a number of guides explaining what the common different material-based parameters do but they're usually only showing an extreme (1.0) example that makes it hard to visualize how to tweak the parameters to get the effect you want.
 

BCrash

Member
Hey guys, thanks for your comments! The project is currently paused (due to some other things happening in my life).

@duran can At this point I'm not even sure how to release it when it's in a usable state (base shaders only? include additional stuff? manual? free/commercial? - so many things...).

@Yal Exactly, except it's made in HLSL (DirectX). :)
 

Yal

🍋 *lemon noises*
GMC Elder
At this point I'm not even sure how to release it when it's in a usable state (base shaders only? include additional stuff? manual? free/commercial? - so many things...).
You could always just release it in every form instead of picking one - a free super-base version, a paid full version, and if you also want the manual you need to pay for the additional "know what the hell you're doing" DLC :p Itchio has a really nice system for tiered releases where you can make some files only available if the player paid a certain amount, it's perfect for "lite + pro" style stuff. For the marketplace, you'd release two separate assets (one free and one paid) named Anura Lite and Anura Pro (or something along those lines) with different sources - tons of people have done so, most notably that big Easing Function library.
 
Last edited:

BCrash

Member
@Yal Thank you, sounds great. Didnt know that was possible on itch.io! Will definitely check it out.

Some basic knowledge of how to use shaders is required though (and of course some GMS experience). Currently it's really stripped down to PBR (no shadows, Ambient Occlusion is a huge bottleneck, Displacement Mapping is not 100% working as intended).

I might have to remove these parts and clean up the project, so it's easier to understand the whole thing. I dont want to release trash. :)

Here you can see what the Displacement Mapping does (the surface looks curved - compare to the green horizontal line):
 
  • Like
Reactions: Yal

Yal

🍋 *lemon noises*
GMC Elder
There's like no usable advanced shadow system on the marketplace right now (I checked recently - there's a bunch of assets by one guy, but they're broken and don't work properly), so if you can get deferred shading running you'd basically have the market for yourself on that. So don't forget to include that in the pro version ;)
 
Top