The water fresnel and ripple simulate on ios.
Just look.
welcome to my blogger, thanks.
http://makedreamvsogre.blogspot.com/
The water simulate on ios(fresnel and Interactive ripple)
- akilar
- Greenskin
- Posts: 138
- Joined: Wed Jun 20, 2007 11:42 am
- Location: Taiwan
- x 17
- Contact:
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: The water simulate on ios(fresnel and Interactive ripple
Impressive
Can you describe how it works (or upload the source)? How are the ripples achieved? Do you modify the geometry, or is it just a normal map overlay?
Can you describe how it works (or upload the source)? How are the ripples achieved? Do you modify the geometry, or is it just a normal map overlay?
- akilar
- Greenskin
- Posts: 138
- Joined: Wed Jun 20, 2007 11:42 am
- Location: Taiwan
- x 17
- Contact:
Re: The water simulate on ios(fresnel and Interactive ripple
Thanks for your respond.
The left four overlay icons are fresnel simulate result.
The up right four overlay is ripple simulate result.
The ripple simulate is use three rtt to store height data. switch three buffer to simulate ripple height change, and convert it to normal map,
Last, just combine the ripple normal map and fresnel result in pixel shader.
The left four overlay icons are fresnel simulate result.
The up right four overlay is ripple simulate result.
The ripple simulate is use three rtt to store height data. switch three buffer to simulate ripple height change, and convert it to normal map,
Last, just combine the ripple normal map and fresnel result in pixel shader.
scrawl wrote:Impressive
Can you describe how it works (or upload the source)? How are the ripples achieved? Do you modify the geometry, or is it just a normal map overlay?
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: The water simulate on ios(fresnel and Interactive ripple
Is there a reason the camera is limited to a fixed distance / angle ? Your normal map seems to be generated in screen space, so in theory shouldn't this work for a first person camera (with a very large amount of water visible) as well?
- akilar
- Greenskin
- Posts: 138
- Joined: Wed Jun 20, 2007 11:42 am
- Location: Taiwan
- x 17
- Contact:
Re: The water simulate on ios(fresnel and Interactive ripple
no, not screen base. i use another a camera to capture Water Impulsers, so can support multi Impulsers(other npc, monster).
I think it's can support big water, just tile texture uv.
I think it's can support big water, just tile texture uv.
scrawl wrote:Is there a reason the camera is limited to a fixed distance / angle ? Your normal map seems to be generated in screen space, so in theory shouldn't this work for a first person camera (with a very large amount of water visible) as well?
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: The water simulate on ios(fresnel and Interactive ripple
Ok, so I want to implement the ripples (in a scene with a big water plane) myself, and I still don't fully understand how you did that.
1. Why do you have 3 render targets for ripples? Wouldn't it be enough to use 2, and ping-pong between them each frame? Similiar as described here: http://www.patriciogonzalezvivo.com/blog/?p=657
2. How big are your ripple textures (in texels), and how much area does that cover in screen space (i.e. how many screens away are the ripples simulated)?
3. How do you handle moving the camera? I think you are passing the camera offset from last frame to ripple shader, so that it displaces the ripples location by that amount... right?
4. When the character moves, you just draw something on the ripple texture? And because you only have to draw to a very small area, this should be quite fast, I guess.
Apologies if my questions are annoying, I would very much appreciate if you released the sources, so I could figure it all out myself
1. Why do you have 3 render targets for ripples? Wouldn't it be enough to use 2, and ping-pong between them each frame? Similiar as described here: http://www.patriciogonzalezvivo.com/blog/?p=657
2. How big are your ripple textures (in texels), and how much area does that cover in screen space (i.e. how many screens away are the ripples simulated)?
3. How do you handle moving the camera? I think you are passing the camera offset from last frame to ripple shader, so that it displaces the ripples location by that amount... right?
4. When the character moves, you just draw something on the ripple texture? And because you only have to draw to a very small area, this should be quite fast, I guess.
Apologies if my questions are annoying, I would very much appreciate if you released the sources, so I could figure it all out myself
- akilar
- Greenskin
- Posts: 138
- Joined: Wed Jun 20, 2007 11:42 am
- Location: Taiwan
- x 17
- Contact:
Re: The water simulate on ios(fresnel and Interactive ripple
The full reference book is there:
http://cmlab.csie.ntu.edu.tw/~perng/3D/
The chapter 16(water ripple)
http://cmlab.csie.ntu.edu.tw/~perng/3D/ ... part3.html
http://cmlab.csie.ntu.edu.tw/~perng/3D/
The chapter 16(water ripple)
http://cmlab.csie.ntu.edu.tw/~perng/3D/ ... part3.html
scrawl wrote:Ok, so I want to implement the ripples (in a scene with a big water plane) myself, and I still don't fully understand how you did that.
1. Why do you have 3 render targets for ripples? Wouldn't it be enough to use 2, and ping-pong between them each frame? Similiar as described here: http://www.patriciogonzalezvivo.com/blog/?p=657
2. How big are your ripple textures (in texels), and how much area does that cover in screen space (i.e. how many screens away are the ripples simulated)?
3. How do you handle moving the camera? I think you are passing the camera offset from last frame to ripple shader, so that it displaces the ripples location by that amount... right?
4. When the character moves, you just draw something on the ripple texture? And because you only have to draw to a very small area, this should be quite fast, I guess.
Apologies if my questions are annoying, I would very much appreciate if you released the sources, so I could figure it all out myself
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: The water simulate on ios(fresnel and Interactive ripple
Thanks, that really cleared things up. I'll see what I can come up with then
- akilar
- Greenskin
- Posts: 138
- Joined: Wed Jun 20, 2007 11:42 am
- Location: Taiwan
- x 17
- Contact:
Re: The water simulate on ios(fresnel and Interactive ripple
No problem, maybe you got it.
welcome my blog. http://makedreamvsogre.blogspot.tw/
welcome my blog. http://makedreamvsogre.blogspot.tw/
scrawl wrote:Thanks, that really cleared things up. I'll see what I can come up with then
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: The water simulate on ios(fresnel and Interactive ripple
Here is my version. The water plane is infinite and you can move around as much as you want.
The ripples are simulated in a rectangular region centered on the player. Every frame, I remember the 2d position offset (how much the player has moved that frame) and the previous frame offset. In the heightmap simulation, I've then shifted the texture samples by previousFrameOffset + currentFrameOffset for the heightmap from previous frame, and shifted by currentFrameOffset for current frame heightmap.
Code: http://github.com/scrawl/watertest
Thanks again for your demo link. It was very helpful
The ripples are simulated in a rectangular region centered on the player. Every frame, I remember the 2d position offset (how much the player has moved that frame) and the previous frame offset. In the heightmap simulation, I've then shifted the texture samples by previousFrameOffset + currentFrameOffset for the heightmap from previous frame, and shifted by currentFrameOffset for current frame heightmap.
Code: http://github.com/scrawl/watertest
Thanks again for your demo link. It was very helpful