Mirror shader

Yes, that’s right.
What I’d like to know is which kind of limitations these planar reflections will have.
Anyway, I learn a lot doing this. So I go on.
Next shader will be water with refraction under/reflections on top.

Very cool! Would you be able to exclude objects from being reflected, or include reflections of invisible objects? (Good perhaps for horror elements)

How’s the performance under load? Anything useful to share on that :rolleyes:

Yes, you can choose what will be reflected, when and how long it will be. You have full control over this.

Performance has already been discussed (see previous posts). Anyway, I’m also working on optimization: I’m implementing an option to render a mix of realtime reflections of meshes and static cubemap for the rest of the scene. Works pretty well. Didn’t already measure fps increase compared to full realtime reflections but it should be interesting.

That sounds superb. I was asking the ‘load’ thingy cause in my experience, testing on a fairly basic scene can produce quite different results from the moment you go ‘live’ to -example- a fully cluttered environment and all. But I’ll shut it cause it sure sounds like you’re on top of things :cool:

Actually, I misunderstood: “under load”. I read it as something like “once the level is loaded”… Sorry. Now I understand better.
I didn’t already test these shaders in a real AAA game level or something approaching. And you’re right, it must be done for the reasons you said.
I intend to test it on the Epic shooter game map. I’ll tell you what when it’s done.

Loving all this progress! if you need anyone to test it out in a game environment hit me up :slight_smile:

Thanks DylserX!

About optimization, a few observations so far:
If you need pure perfect reflections, perfect copy of the scene, just like a mirror, it cost about 30/35 % fps at 1920x1080 resolution for both camera and capture.
If you don’t need it, for example in the case of water reflections where everything is always moving and distorted and you can get rid of some graphic options because it doesn’t really matter (or even get rid of reflections for some meshes) and your scene will still globally look good, it becomes much cheaper:

On my OLD COMPUTER, for example, for water reflections, using the small demo level of my last video:

With:

  • 1 stationnary directionnal light and 1 skylight for the whole scene
  • 1 capture2D with a render target of 1280x720 - and full screen resolution of 1920x1080
  • Dynamic shadows, deferred lighting, antialiasing, reflections environnement and screen space reflections OFF (unchecked in capture2D settings)
  • BP_Sky_Sphere available for the player camera but hidden for the capture and replaced by a cubemap texture mixed in postprocess material
    with realtime reflections of the scene provided by the render target,

I get: 52/53 fps when the capture2D is deactivated and 48/50 fps when it captures the scene. Which is more than reasonnable imo. And it still looks good for water reflections.

If I switch back to deferred lighting (ON), I get 45/46 fps.
N.B: I still don’t exactly know what happens when it is OFF - have to make some researchs about it. Does it mean the engine uses forward lighting for the capture render?

If I switch back to BP_Sky_Sphere instead of a cubemap texture, I get 43/44 fps.

So I think there are ways to make all this useable at a reasonnable cost in most cases.
And If you need perfect reflections, it will be possible too.
So: good news.

Great results! Hope to see it soon on marketplace (any estimation when…?).

As a hobbyist, I can’t say when it will be released, even approximately. If I was full time on this, I would say a few months. But I’m not full time on it.
So it will be done… when it will be done and I’d like to say more but it wouldn’t be serious.

New video: Water reflections and refraction with intersecting meshes.

This is a first step. The shader will be modified to remove underwater refractions artifacts caused by parts of meshes above water.

Todo:

  • Fade out borders of the water for a smooth transition with sand.
  • Increase a little bit refraction intensity both for reflections and for underwater at glancing angles.
  • Add caustics on such a clear tropical water.
  • Add ripples around the pawn legs and everything intersecting water.

About performance: runs at 45 fps on my (so old) config.
Camera resolution: 1280x720.
2 render targets - resolution: 1280x720.
1 directionnal light, 1 skylight

absolute impressive !

How are you getting around clipping the scene? Or have you modified some code in the renderer to allow clip planes? I’m extemely interested in implementing something myself but haven’t got around to digging through the renderer to do so just yet. Any pointers to the right place to start would be appreciated.

New video: water shader - WIP 2

Water surface has been reworked to get a better visual feeling of it.
Refraction and reflections have been improved - no more artifacts coming from parts of meshes above surface.
Water is tinted according to height (light blue tint here).

As video compression destroys 50 % of fine tuning on this shader, I post screenshot of what it looks like when I run it:

When will this be released to the marketplace?