AGK PBR test scene

Started by GaborD, January 28, 2018, 00:52:39

Previous topic - Next topic

GaborD

Finally had some free time, built a little (admittedly very simple and crude) test scene. Just one room, kinda empty too. :p
But it has a small rack for PBR material samples. So all is good.

The main goal was to have something to test reflection/light probe generation with and to test how far I can push image quality without it getting too slow. Image quality is such an important but often overlooked thing.
There are still a few jaggies because specular aliasing is a pain in the rear end in a horribad worst case scene like this (tons of sharp beveled shiny metallic edges), but we'll get there. Mostly a level building issue.

The target for the probes were some Blender Cycles renders, wanted to get all the slight roughness variations to look similar, even on huge flat surfaces (which are ofcourse probe unfriendly).
Which very quickly made me realize that my standard light probes weren't good enough, the too big jumps between the roughness-'mips' (not really using mipmaps to store them) basically made subtle roughness variations either too harsh and crude or vanish. Basically, the steps were so big that interpolating between them didn't look like you are softly changing the roughness but like a blend of two distinct images.
Remade probe generation completely, with a more complex packing layout that supports tons of roughness levels. Got the floor to look almost exactly like the renders, so far so good. One problem solved.

The goal was also to not use any lightmaps or precomputed probes from Blender. Lighting, shadows, reflections all completely done in AGK. Really quick to calculate too because it's just a few probes. About 15 seconds quick for the whole thing.
There is some AO in the textures, but that's just the default AO from baking the textures in Substance Painter, might as well put it to use to accentuate lighting a bit.


As usual things got out of hand and I started adding all kinds of nonsense, because that's what I do. I just can't stop myself.

Ended up with supporting a lot of unplanned things like 4x supersampling, in additional to the planned FXAA pass, AE realtime lights (needed them because I am stupid and built shiny metal things right around light fixtures, no chance to fake it with probes :p), very soft volumetric shadows for the AE lights (lightmaps just don't cut it when they are big and close to geometry), fake outside/other room windows with water/steam on them with correct parallaxing, translucent panels that are nicely rough and blur what's behind them (even with contact hardening, things further away get blurred more), debug channel output for easier testing, Bokeh DoF and the usual HDR/PBR shenanigans like ACES tonemapping.
Still need to add CA, color grading and volumetrics, but they weren't really needed for this scene. Next time.
Still running at decent speeds (about 3 times faster on my rig than most games of similar style, so there is headroom for more complex levels, player characters, effects and whatnot). Also didn't optimize it yet, can probably double the speed.

Quite big shots, click the thumbs to view at full size. Needed the size to show the image quality.












GaborD

#1
Some detail shots.











Yue



speechless, that looks amazing.  :o

Conjured Entertainment

AMAZING!

I hope you posted this in the AGK forums as well, because it is "most impressive".

GaborD

#4
Cheers guys.
Yep I did. But it's my first post there, so a mod has to approve. Hope I didn't put too many images in it :D



Qube

#6
Stunning looking :o very very nice indeed. Soooo, when do we get our little mitts on a demo with source so we can have a play with these glorious shaders? ;D
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

iWasAdam

OK. Bend me over and call me Tracy, cause I've just been brain shafted!
The second one with the green hydroponics window with the smeared grime is just spectacular. Far beyond anything I can work with.

What is the frame rate on these?

Derron

Looking pretty cool.

I have some questions - maybe you (or others) are able to answer them to me:





#1
If you look close enough the shadow "stops" right before reaching the balls. I saw this in other shots (of other projects) too. Is that some physics thing? Eg. light reflection of some bounces somehow doing this effect?

#2
I somehow would add some AO shadow there, it looks hmm "pasted in" at that spot, maybe it is the ground material (that orangish-yellow thing). The front already got some "defects" (see the white spots in front of the glowing ball). Adding a similar thing next to #2 might make it look less "pasted in". Or is it the already started "focal blur"?

#3
Right before the metallic handle starts there is a clearly visible shadow from the glowing bulb thrown by the "AGK warning sign" (whole left side until the handle starts). After the metallic handle the shadow is pretty much gone (a little bit is still visible). The handle isn't that big to take away all the light of the glowing bulb. Why is the shadow so much "hidden" then? The metal bar below the AGK sign is throwing a shadow after the metal handle, so in general it works. I assume it is something I miss ... maybe you add some shadows in a non-multiplikative way or so?



PS: Hope you write some simple tutorials on how to use this with OpenB3D too - prefering an FOSS solution to "AGK" (which I did not try, but it costs money when going Tier 2 :p). Maybe there are some more people than just me also interested in reading how to bake lighting information and so on (just am able to bake AO into textures in Blender - not using the commercial Substance Painter ... which seems to be a pretty mighty thing - if you try to create "(semi-)realistic" textures).

bye
Ron

GaborD

#1 is a downside of probe based reflections on very shiny spheres. The issue is that you have 1 probe at the center of the sphere. In reality you'd have each surface spot with it's own reflection point and thus very slightly different perspective. Could prolly slightly bend the reflection normals based on the Fresnel to make the effect less pronounced, similarly to how they are bent for rougher surfaces to account for micro faceting. I'll play with that idea.
Or one could use a lot of probes for each sphere and blend them around based on surface position. But that's a lot of performance for very little visual change.
Or calculate parallaxing for every nearby surface, but that's a ton of math running every refresh. Could maybe just do it for the surface the sphere is on, that would be fast. Maybe worth a try.
Reflections are hard to precalc because they are view dependent and the cam is constantly moving.
In a usual game setting this should be a non issue because you generally won't have shiny spheres all over the place. :) Or.. well.. hmm. SphereWars!

#2  Yeah agreed, could use more AO or dirtiness at the joint. I added the handles later, didn't rebake the textures. I am lazy.

#3 The lights are huge compared to the handle and quite near, so it barely throws shadow.
It's a volumetric approximation, could probably use a bit more resolution for small/thin objects like this. But a shadow is there, becomes more apparent if I turn the right side light off. (see image below)

I totally agree it should have much more contact hardening, the shadow resolution just couldn't handle it. That could be improved by baking surface shadow maps/lightmaps, but I wanted to avoid that.
The good thing about the volumetric ones is that you can move other objects through them and they will get soft shadowed. Plus it's just one texture per two lights (could pack more in there), not an extra texture on each object. And it allows for lights to be turned off because each shadow only affects it's own light. I'll take a shadow resolution hit for all that.
For small lights with sharper shadows I'd use usual shadowmaps, this solution is only for big AE lights. (for which I have yet to see any other good/fast shadowing solutions)
This uses one tex lookup for two smooth/blurry shadows (2 lights). Compared to other shadowmap based smooth shadow solutions with several lookups for each light it's quite fast.

Here is a test with the blur factor reduced by a lot, it produces more pronounced shadows from small/thin objects, but you can see interpolation artefacts kicking in near the handle where contact hardening is happening due to the blur not being wide enough to catch the perspective differences of the light position samples. (could ofcourse combat that with more samples in the precalc phase and some repeated blending of the calced texture I suppose).


In the end, this is realtime, there will be some quality losses, we are rendering 100s of images every second. Compared to 1 image in 5 minutes from a 3D program it's not too shabby. :D

Rick Nasher

Freakin awesome!!! That blows me of my socks..  :o 8)
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

Derron

Thanks for your detailled answer. I already assumed something like the "probe limitation".


And for now I accept "approximation" or "faking" (bump map versus real 3D object information) for real-time stuff. But in 10 years, it must be physically correct - and realtime (on my holo-screen).


Keep going - seems people are excited on what you do. And I want to see it "in action" too - stills are often better than when doing real game stuff (animation, interaction) so you need to take care of all that stuff too.


Can imagine it would look cool on a pinball machine.


bye
Ron






Steve Elliott

Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

GaborD

#13
Some debug shots for fun. Nicely hows how PBR is added together.
The reflection one shows how important reflections are for PBR, they are everywhere, even on non metallic very rough surfaces. It's that little subtle thing that adds realism.












GaborD

Finished up the Post chain, added the missing stuff (color grading, AC, bloom, filmic tonemapper, lens dirt) so that I can throw the kitchen sink at test scenes and goof around with more filmic or artistic styles.
Optimization pass next. Oh joy.