PDA

View Full Version : water reflection troubles


l33tnoob
9th Nov 2004, 12:21 AM
I set up a nice water reflection and i have it set to reflect a bunch of meshes but when every i move around the water reflection doesnt line up with the mesh. Any ideas how to fix that?

[SAS]Solid Snake
9th Nov 2004, 01:58 AM
Well, if you did it through the cube map method then it should be pretty obvious.

l33tnoob
9th Nov 2004, 03:19 PM
I did. Im new to water effects. I set up my terrain and then took my 256x256 screenshots and then made the cube map then the texevmap and then the shader. Please help. :(

Zxanphorian
9th Nov 2004, 05:14 PM
When you move the objects, the cubemap/reflective water surface will stay the same, because the textures remain static.

l33tnoob
9th Nov 2004, 05:33 PM
I know, i set up the static meshes and took the shots and set it all up but when i played the game the reflection didnt match up. I didnt move any of the meshes or anything. As i walked farther away from the mesh the reflection stayed the same size and somtimes even got bigger but the static mesh (trees) got smaller and it didnt line up. How do i make it so the reflection always lines up with the meshes and terrain? The only way i can make it line up is if i stand in the exact same spot as where i took the screenshots. (center of the water at waterlevel)

Radiosity
10th Nov 2004, 05:45 AM
You can't, as Zxan already mentioned, the cubemap textures are static, meaning they'll look the same regardless of where you stand. It's a trick, used to give a relatively nice effect on water and shiny surfaces without a huge performance hit you'd get if it was an actual realtime rendered reflection. It's a limitation of the current Unreal Engine, you'll just have to live with it until Unreal Engine 3 is released in 2006 :)

Birelli
10th Nov 2004, 05:16 PM
Try looking at an Epic map that implements EnvMaps for water reflections (from memory Antalus has a pool with this). They behave in the same way...yet I imagine you never noticed that it was happening did you? It's one of those little tricks that only show up to the author of the map, everyone else that's not thinking about it doesn't even notice (well, unless they're looking for it) :)

T2A`
11th Nov 2004, 01:07 AM
Try looking at an Epic map that implements EnvMaps for water reflections (from memory Antalus has a pool with this). They behave in the same way...yet I imagine you never noticed that it was happening did you? It's one of those little tricks that only show up to the author of the map, everyone else that's not thinking about it doesn't even notice (well, unless they're looking for it) :)Every water reflection in the game uses an EnvMap, so I'm not really sure what you're talking about. The pool in Antalus just uses other textures blended on top of the reflection texture to get that algae look. That is some of the coolest water in the game though, right next to the little stream in Albatross.

1337noob, like others have said, real-time reflections are not possible in this Engine. The term cubemap should give you a clue of how it works. Basically what it does simulate a whole cube of reflections onto one plane. It's pretty much the same effect as floating in the middle of a textured cube and looking around, all applied to a single surface. That's why as you move around the water, you'll see the "reflections" from a different angle. It is a pseudo-reflection that gets the job done, but is in no way realistic at all. But that's okay because the game is not about that kind of stuff. Trust me, no one will notice that your water doesn't perfectly reflect your level. In fact, people won't care what it reflects at all. If you've noticed, a lot of the stock maps share the same cubemap texture. Check out BridgeOfFate. The little pools leading to the sides of the flag rooms don't reflect the level at all. You'll see that texture in many of the stock maps. People don't look for perfect reflections; they just want it to look like water, so as long as it "reflects" something, you'll be fine.

Eyegore
11th Nov 2004, 12:33 PM
If the issue is that they didn't line up, you can check a setting that sets up the coordinates - i can't remember off the top of my head and I'm at work so maybe I shouldn't bother to try, but I'm going to any way.

When you set up the TexsEnvMap, there is a coordinate flag, that tells the coodinate either to use world or camera coordinates.

I had a problem like what you're describing and by setting the coordinate to world, everything lined up. This setting is not explained in the tute at UDN, so it was tricky to find...

EDIT -

Yeah, I just looked at the tute, it doesn't explain the setting, but the setting is called EnvMapType and you have a couple setting there one being EM_CameraSpace and another for EM_WorldSpace or something like that. Mess with that and see if you get the results you're looking for.

EDIT II -
Ah, look - I just re-read the tute and found that it does say this:

"If the EnvMapType is EM_CameraSpace, the ground will be in front of you, but if you set it to EM_WorldSpace it'll be at the bottom"

See if that helps

[SAS]Solid Snake
12th Nov 2004, 07:38 PM
1337noob, like others have said, real-time reflections are not possible in this Engine.Actually, you can. It's not as good as a true dx8/dx9 pixel shader emulation but using a texture camera/unrealscripted texture can achieve a reflection. Problem is clarity of texture (They are usually really small textures for performance) or low performance.

T2A`
12th Nov 2004, 09:06 PM
Well, aside from Rachel's tutorial that I couldn't get to work. ;)