Making realistic planar fake reflections...

Hi! Here is example video of game called Resident evil 4:

Go to 17:50 and watch a bit on… Theese aren’t realtime reflections, butfake reflections, but they look so good. How to make theese? Could someone make a tutorial for this in Blender?

A trick:

Duplicate the entire room, and scale the duplicated models down -1.0 on the Z axis.

Then, make your floor half-transparent.

You will be looking through the floor, looking at the mirrored room, but it will look like reflections :slight_smile:

Silent Hill used the same method for MIRRORS.

You just have to scale the second room-model the right direction, depending on where you want the “reflection”.

Pete

Well, in this case isn’t the Mirror.py better in performance and look?

Isn’t it possible with reflection texture maps?

I’m simply pointing out to you, that this is how games used to do it, like RE, the one you asked about. The fact that SH used the same trick for mirrors is only a bonus.

But if you can achieve the same effect with the mirror demo, then I don’t see what the problem is.

I have never tested which one runs faster, so can’t help you there. I know the mirror demo runs on an Always sensor.

Visually: Why would it look worse? It’s the exact same geometry/textures, only mirrored. If anything it might give you a better result. Think about this, anyway:

Games were using this technique years and years ago. What does that tell you, performance-wise. Just sayin’

Well, khm… How do I make an inverted player, if I want hime to be reflected? Anyway, why there isn’t a way to make reflection mapped textures look like this?

Just an idea:

Duplicate armature with all logic/actions/children ready to go.

For a floor you can just invert the scale on the Z axis. For a mirror, it’s best to have the mirror-surface right on either X 0.0 or Y 0.0, so that you can just mirror the player’s position and rotation via python along the specified axis. That connected to the movement keys/joystick, so it only runs when player moves.

I’m not certain but would this be useful?

Edit: I forgot to mention that you could improve the frame rate if you set the always sensor(connected to ground_reflection.py) frequency to 1(but above 1 and it’ll probably start to stutter)

Attachments

reflectionsOnPlane.blend (3.93 MB)

Why is it lagging so much(5FPS). Martinsh(Mārtiņš Upītis) uses 2 render to texture samples, vector-based normalmap, buffer overlay, IOR filtering, but still got stable, very high FPS(for me decreases by 5 FPS when I look at it, but doesn’t affect FPS when I doesn’t see it at all…). Maybe it is [ossible to use his method, but without bumping and refracting- just reflection. He uses a texture, that, hopefully, can be set(color amount, adding overlay textures).

@@adriansnetlis, I ALSO FORGOT to mention you could try scalling down the tex dimensions like the following


reflsize = 8 #reflection tex dimensions
refrsize = 8 #refraction tex dimensions

I hope you don’t need to go all the way down to the 8 bit…

Btw this file isn’t mine so I don’t know how else you could optimize it, sorry

If you’re getting bad lag try turning off vsincin the game render options panel.

This causes horrible lag for my games and is not needed because Blender already caps frames per second at 60fps.
When I use shaders the lag (which is usually displayed as gpu latency in the profiler) shifts to the logic part of the profiler.

I tried the Martinsh’s water shader and the above reflection shaders and got great results with vsinc turned off, but terrible performance otherwise.

Adaptive vsinc doesn’t give good results either, so it’s best just to turn it off.

For me VSync improves FPS(like +5% of FPS). Also, martinsh water works very good, but this one even doesn’t optimize when I set texture dimensions to 8…


Try changing this setting too. It might give a better result.

+0.3 FPS- now sometimes even reaches 4.6:D

What does your profiler look like?


It might be possible to see how to improve performance by seeing where your computer is having trouble, whether in the CPU or GPU…

Well, after taking the screen I was unable to do anyhing- I was lucky so I could close blender:D Anyway, here’s what I got:

And, by the way, the game was running in very, very small camera view(like 200x160 px)

Maybe this one: http://www.pasteall.org/blend/34620 works better (you can play with the mix value 0.8)? I don’t know if we can do the same thing with mirror.py. I don’t know this script.

Thanks, stable 20 FPS:) I think so that’s good for my poor GT 610 with x.org Noveau.:smiley:

Well, I wanna return here and note that someone should make BPCEM tutorial(implementing) as it is currently the best method with that effect as it looks good(but it is not realtime) and it gives stable 60 FPS for me evne if scene is full of BPCEM textures and objects having htem.