Mirror shader

No idea yet about the price. It will depend on final number of shader, global quality of the pack, … I’ll have to see prices on marketplace and other sites as well and fix a price that’s worth for buyers and for me.

I’m starting to feel like this too

:stuck_out_tongue:

Very cool, will follow, and got an idea to test this on characters, which could have such a modified material applied (i.e. Multiply NPC Spell with transparency or something).

Looks REALLY good! This is much needed =D

This is really cool! A few questions:

  1. How does the reflection react to objects behind the mirror plane or intersecting the mirror plane? For instance, how would it look if a sphere, or your character passed through the mirror as if it were water?

  2. Are you using the custom depth buffer at all for this to work?

No, I don’t use it here.

When they are behind the mirror they are hidden by it - no problem.
If they intersect the mirror plane, at the moment, with the shaders I used to make the videos, it would be a problem.
That’s why I’m working to fix it as I’d like to use these techniques to achieve good looking water reflections.

The only way I have found to cut out part of an intersecting mesh is to use an extra 2 scene capture actors, one captures the scene depth (which is then used to calculate which parts of the scene needs to be masked) and the other to capture whatever is behind the mesh but obviously this is really not an option since it ruins performance.


(notice how the character’s legs are properly masked out)

Do you have a better way in mind? if so I would love to hear it :stuck_out_tongue:

Yes, I saw this screenshot in the thread about water in UE4 and I thought it what neat.
On my side, nothing satisfying for the moment. I think it could be done without a second scenecapture.
I don’t know what’s your scene setup but why do you use another scenecapture to have scenedepth? Can’t you get it in a postprocess material applied to the camera? From there, you could define a black and white mask on which you could rely to make compositing stuff with ppinput0 and a rendertarget?

Thanks for the answers to my questions EdWasHere, I’m looking forward to seeing this progress and plan on picking it up when it’s released in the Marketplace.

One other question I forgot to ask earlier - are you able to tilt mirror planes off the grid at the moment? Something like this:

Yes, check this out:

Yeah, I watched that, but it looks like the mirror plane is aligned to the grid? I was wondering if the reflections and rotation math worked out if you tilted the mirror plane back by 30° or some other arbitrary number - basically anything other than a 90° rotation.

Yes, in the video it is aligned to the grid but you can rotate it as you want, on one, two or three axes.

New video: meshes intersecting with reflective floor.

Some things to improve but already looks correct imo.

In the video:
First, the basic effect.
Then, I add a basic water shader (water ocean from UE4 starter content - only changed normal maps and UV tiling) to see what it would look like.
At the end of the video, water goes up to show reflections cutting can be dynamically modified.
Runs pretty well: about 50 fps on my OLD COMPUTER.

1 stationnary directionnal light instead of 2 for the other videos (+10 fps).
1 skylight.
1 scenecapture2D - resolution: 1280x720
Standalone game resolution: 1280x720

Things to add - if possible:

  • Reflections distorsions according to depth.
  • Make underwater visible and add refraction to it.

wow again very very promising !
keep it going please.

would it be possible to have the water translucent. so not 100% mirror ?

With no intersecting meshes, it could be done but here, I’m not sure. I’m searching for a way to do it.

Its looking great so far

Thanks BTLRoach !

Looking foward for this release EdWasHere, we need this :stuck_out_tongue:

Allez quoiiiii déja que tu fait baver les gens avec le verre flou/coloré qui n’est pas encore vendu :stuck_out_tongue:

Salut ! :wink:
Yes we all need this but it has to be polished and I have to achieve a bunch of other shaders to release a cooooool pack.
Anyway, according to , Epic will add planar map reflections in a future release so I’m not sure these shaders will always be very useful.
See this post: https://forums.unrealengine.com/showthread.php?104558-How-to-create-Infinity-Mirror

It’s always good to have an options. Ryan not sure when they’ll implement planar reflection (4.12, 13 or later?), also it pretty limited, so your mirror shader can be very useful for someone.