Water reflection - Facing some problems.

Blitz3D Forums/Blitz3D Programming/Water reflection - Facing some problems.

vinnicius(Posted 2015) [#1]
Hi!

I'm trying to create a simple water reflection using the CreateMirror() command. But i have had a problem. The underwater ground appears above the water level. And I don't want to delete everything under the water (cut the vertices on 3ds max for exemple).

Take a look:



So, help me guys: what I must to learn to be able to get it? Is it the best way to make this effect? Sphere mapping could work, but the reflection became weird.

Another Question. If i don't use reflection on the water... Will People like it? Do you think the consumers will want this effect? I'm using 2 layers (different entities) that rotates on opposite direction to make a fake movement effect to the water.

What i know to do (my open-world game):
- Save and load. I know how to store the variables, arrays, position of the entities, his states to load after;
- I can load the world by blocks. (3s max helps a lot with your own grid separation configurations).
For example: world[0,0]\file handle the 00.3ds, the world[0,1] handle the 01,3ds file. This way i can create almost a infinite world. (something like update_world function - not at every cycle to make the game faster)
- I can Load Meshes (trees and stuff) separately and apply effects (masked...)
- Menu and his settings
- Gravity (acceleration) to ALL the enemies and to the player.
- I know how to make waypoints to the NPC (walking on the villages).
- A lot more.
- Dialogs and options to answer (test)


BUT i have some difficulties with lights, shadows and reflections. I think i have to learn Vertex commands (really understand it).



:D


videz(Posted 2015) [#2]
check out fastext library, there's a great looking water shader that you can just plug in. it's not free but decent price. http://fastlibs.com/

try out the demo so you can see.

for free alternative, you can just look at the archives here or dig up the forum for old post demos..


Rroff(Posted 2015) [#3]
RE your mention of infinite worlds - if your not repositioning the world around 0,0,0 (either on the fly or at regular intervals) the further away from that origin you get the lower precision you get and beyond ~64K units you will start to get wobbly polygons and jerky movement, etc.

Water reflections are best done with fastext but last time I checked it hadn't been updated to support the recent B3D patch (only thing your really missing out on is Windows 8 fix which can be implemented manually). I wouldn't go too nuts though on reflections without pixel shaders - a reasonably convincing environment map and a little faking will pass for most people.


RemiD(Posted 2015) [#4]
What you can do about reflections is to precapture each view (to a texture) of a cubemap before the mainloop, and then don't capture them in realtime.

The static environment will be reflected but the turningmoving entities like characters, vehicles, bullets, will not be reflected... But it will look good enough...

Take a look at these examples of water reflections with a cubemap :
http://www.blitzbasic.com/Community/posts.php?topic=23102
https://app.box.com/s/8z1ikuyl51hfeg4rjzfk

http://www.blitzmax.com/codearcs/codearcs.php?code=1788


vinnicius(Posted 2015) [#5]
Thank you Rroff. The world in my game is about from 0,0 to 9,9 blocks (500x500).

Well, i think there is no problem to make a game without some effects like reflection. I will think about it. Anyway I will check the links to find out how to make the best for the game.

Thank you!