@froyok@mastodon.gamedev.place cover

Aka Lady Bloom.

Principal Product manager on Substance 3D Painter :substance:, but stay up at night to fiddle with shader stuff.

Speaking French/English.

#gamedev #art #unrealengine #substance #opengl

nobot

This profile is from a federated server and may be incomplete. View on remote instance

froyok , to random
@froyok@mastodon.gamedev.place avatar

I wonder if anybody tried to use FXAA before doing display mapping BUT by still applying and reverting a curve ? 🤔

Aka:
1 - Switch from HDR to SDR
2 - Apply FXAA
3 - Switch back from SDR to HDR
4 - Apply regular post-process stuff

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Given that FXAA is meant to be working in non-linear space and focus on perceived contrasts, it would mean using a reversible curve that would produce colors ideally fitted for the human eye ? (So no log space or anything alike I presume)

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Just tried out the idea with a version of Reinhard from here: https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/MiniEngine/Core/Shaders/ToneMappingUtility.hlsli#L58

... and it kinda work ?
I need to do more experiments, but that's promising !

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Unfortunately the curve in there loose too much range, so specular reflections get really dimmed and the bloom loose in intensity.

So I tried out this instead: https://gpuopen.com/learn/optimized-reversible-tonemapper-for-resolve/

Wasn't enough either alone, so I applied the same trick did for my LUTs to compress further the range and it seems to be working.

The fog gradient doesn't seem to suffer (it was a good indication of the precision loss previously) and edges are still anti-aliased !

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Going to try to move the FXAA back at the end of the pipe now to compare both mode and see if some stuff change in behavior.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Alright, got it working at both end, depending on a switch. So I was able to compare.

On regular geometry edges, visually almost no differences.

BUT, doing FXAA as the last step end produce noticeable differences because it misses aliasing that has been exaggerated by some effects.

Example with my chromatic aberration effect:

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Yesterday I tried once again to optimize my SSAO pass in compute, and still failed. A fragment shader still performs quite a lot better.

So today I decided to play again with my bloom and lens-flare to tinker with other ideas. Like anamorphic shapes.

Not necessarily a success, but I got interesting results just by playing with some buffers size or UVs:

Screenshot of my game engine showing a bright cube partially hidden by a pillar emitting a bright vertical streak of light and curved lens-flares.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Back on Ombre... and I decided to play again with lens-flares (I know 🤪 ).

This time I wanted to try out the little radial projection trick from John Chapman article (https://john-chapman.github.io/2017/11/05/pseudo-lens-flare.html) to create fake streaks. It's a good start, but I will need to think about how to refine that effect. It looks nice already !

Video of a camera moving around making a point light reflecting on a cube shine and creating lens-flares.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Been tweaking my lens-flare again for the past few days and now reaching a point where I want to try some kind of anamorphic bloom.

Right now I went with a hack where I modify one of the downsample texture when it is fed for the upsample pass. It is giving me a rough idea of what to expect, but it's not good enough yet (not sharp enough, and some flickering issue to manage still).

Will likely need to do a proper downsample/upsample process too.

A screenshot of my game engine showing a bright white neon behind a pillar emitting a vertical light streak.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

I tweaked a bit more and properly integrated my bloom streak pass in the engine.

Combined with the regular bloom and the lens-flare this is all coming together well ! :)

Screenshot of my engine showing a neon light below an arch glowing up vertically behind a column.
Screenshot of my engine showing a point light above a cube reflecting as a vertical line.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

I couldn't stop at two bloom passes, so I added a third one to fake atmospheric scattering.

So... how much humidity do you want in the air ? 😄

It is based on: https://github.com/OCASM/SSMS
(But I'm planning on improving some things.)

Screenshot of my game engine showing a new fog effect that blurs the image based on a distance in a scene with arches and pillars.
Screenshot of my game engine showing a new fog effect that blurs the image based on a distance in a scene with arches and pillars.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

I tweaked a bit further that fog blur and plugged in my fog function in it.
This way I can also use it to emulate height fog with it too. :)

froyok OP ,
@froyok@mastodon.gamedev.place avatar

This morning I also quickly tried to add some fake halation effect (light bleeding into darker areas).

It's basically a highpass filter using the bloom downsamples and the current scene color texture, and then isolating the bright parts to make them bleed into the dark areas.

Currently it's an additive blend done with the HDR color, so it adds light. It low enough to no matter too much. Maybe I should use a lerp too to be more energy preserving ?

Screenshot of my game engine showing a bright white light glowing behind a pillar.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Woops, I had a Saturate() in there when setting up the highpass. Now I get why my halation edges where so sharp ! 🙃

Also switched to a combination of mix/lerp for blending and it works as good as before. So no additional energy yeay !

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Turns out the Love framework had a bug for a few months and wasn't loading sRGB texture properly.
Got fixed today after my report, so now colors match properly:

froyok OP ,
@froyok@mastodon.gamedev.place avatar

I didn't notice it until today, because I decided to draw a texture straight to the screen for a temporary loading screen.

All fixed, so it looks like this now:

froyok OP ,
@froyok@mastodon.gamedev.place avatar

My current struggle.

I'm already doing the firefly attenuation based on Jimenez slides.

I'm trying to think about possible solutions:

  • Clamping max brightness ?
  • Reducing emissive intensity based on distance ?
  • Doing some temporal stabilization (like TAA but only for bloom/fog downsample) ?

I'm open to suggestions.

A video of my game engine showing a camera moving forward toward a neon light. The light flickers as the camera move.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

I gave a try at clamping (like @EeroMutka suggested) but as I expected, because I use a non-thresholded and energy preserving bloom method, clamping kills off the HDR range and bloom becomes non-existent.

Here is with and without clamping:

Screenshot a my game engine showing a white neon light. Clamping is disabled and a wide halo/veil is visible around the light.

froyok OP ,
@froyok@mastodon.gamedev.place avatar

The current idea I wanna try is doing a copy of the first downsample (full or smaller res) and blend it into the next frame downsample. Just to see if it helps with the spatial/temporal aliasing.
Will figure out ghosting issues afterward if it becomes promising.

froyok OP ,
@froyok@mastodon.gamedev.place avatar
froyok OP ,
@froyok@mastodon.gamedev.place avatar

First of all, this is very framerate dependent when using a fixed blend value.

Secondly, you need to weight the previous a lot to make the flicker not visible/disturbing, favoring a lot of ghosting.

Right now it's a stupid blend, so I wonder if re-projection would help a lot now. 🤔

froyok OP ,
@froyok@mastodon.gamedev.place avatar

Previous frame reprojection seems to be doing the trick !
(Combined with color clamping to hide disocclusion.)

Here is a comparison with off (blend at 1) and on (blend at 0.1). Flickering is almost gone and no ghosting seems to be visible.

Video of my game engine showing temporal blending of the Fog blur off vs on to hide flickering from bright emissive source.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • tech
  • kbinEarth
  • testing
  • interstellar
  • wanderlust
  • All magazines