sidebar features
sidebar content

Go Back   Blender Artists Forums > Game Engine > Game Engine Resources

Reply
 
Thread Tools
The Red Hand's Avatar
The Red Hand The Red Hand is offline
Member
 
Join Date: Aug 2007
Location: Two Words: Manhattan Project.
Posts: 995
I post this here because it is more of a resource to others than to show off my personal find. I have found a way to make ocean water in the GE Using < 500 Faces.

First, you take a plane, go to top view, unwrapping to "Project from View (Bounds)," and applying an Alpha Channeled Water Texture to it. To do this, take your water picture and go into the Gimp and change its opacity down to about 0.5, and then save it as anything .png. Then use the fractal tool on it once or twice in blender to get it randomly bumpy. Set a scrolling script to the water so that it looks like it's flowing. You can use this one:
Code:
###################### # UV SCROLL SCRIPT # # by Pepius # ###################### horizontal = 0 vertical = 1 import GameLogic as GL cont = GL.getCurrentController() own = cont.getOwner() mesh = own.getMesh() array = mesh.getVertexArrayLength(0) #The recomended max. speed is 0.10 and the min. is 0.009 SPEED = own.speed for v in range(0,array): vert = mesh.getVertex(0,v) uv = vert.getUV() uv[1] = uv[1]+SPEED vert.setUV(uv)
This leaves a satisfactory result, but it can be better...

Duplicate the water object and put it about 5-10 units below the first water texture. In this way they should be relatively close. Go into Face Select Mode on the lower Object and scale the unwrapped mesh (In the UV Editor) up just a little so that it overlaps the image by just a little. Go out of UV Select Mode and watch your results!

Here is an image that I fiddled around with that gives you the basic Result.

Hope this helps - and note that this is not a tutorial, but I have seen many threads looking for how to do water. This is my answer. If it is unclear, I can provide a .blend if needed. Good Luck!
Attached Images
File Type: jpg Water Level.jpg (43.9 KB, 312 views)
............................................
I don't flame, I rebuttal.
#1   Old 20-Apr-08, 02:31   
Reply With Quote


Cloud_GL's Avatar
Cloud_GL Cloud_GL is offline
Member
 
Join Date: Sep 2007
Location: Viņa del Mar, Chile
Posts: 785
Sweet!
Is not only a good way to make a water effect but also a good way to understand how to controls UVs with python ^^
Thanks
#2   Old 20-Apr-08, 02:59   
Reply With Quote
JellyWerker JellyWerker is offline
Member
 
Join Date: Oct 2004
Posts: 967
I would like to see that blend.
............................................
I am a grue.
#3   Old 02-May-08, 18:05   
Reply With Quote
alienkid10's Avatar
alienkid10 alienkid10 is offline
Member
 
Join Date: Jan 2008
Location: blender
Posts: 1,003
is there anyway to make a alpha channeled water tex in photo shop?
#4   Old 02-May-08, 18:58   
Reply With Quote
OTO OTO is offline
Moderator
 
Join Date: Mar 2002
Posts: 3,858
Yes, a .b file would be useful?!
#5   Old 02-May-08, 19:34   
Reply With Quote
The Red Hand's Avatar
The Red Hand The Red Hand is offline
Member
 
Join Date: Aug 2007
Location: Two Words: Manhattan Project.
Posts: 995
Ahh. Some interest in this thread. I'll upload it now...

Here it is. I hope you enjoy!
............................................
I don't flame, I rebuttal.
#6   Old 02-May-08, 20:12   
Reply With Quote
OTO OTO is offline
Moderator
 
Join Date: Mar 2002
Posts: 3,858
Ahhh, it gaves me seasickness!
Very nice!
Thank you for sharing!
Bye
#7   Old 02-May-08, 20:31   
Reply With Quote
B3D00's Avatar
B3D00 B3D00 is offline
Member
 
Join Date: Mar 2008
Posts: 2,428
Very cool! It looks quite realistic, you could make it less bumpy instead of using more faces, so it looks smoother.
#8   Old 02-May-08, 23:31   
Reply With Quote
The Red Hand's Avatar
The Red Hand The Red Hand is offline
Member
 
Join Date: Aug 2007
Location: Two Words: Manhattan Project.
Posts: 995
Ya. I just popped out that as a technique. You might want to not "Fractalize" it so much and smoothen it out a bit. Works here too!
............................................
I don't flame, I rebuttal.
#9   Old 03-May-08, 11:06   
Reply With Quote
alienkid10's Avatar
alienkid10 alienkid10 is offline
Member
 
Join Date: Jan 2008
Location: blender
Posts: 1,003
what do I put the script on a py cont?
#10   Old 03-May-08, 20:27   
Reply With Quote
The Red Hand's Avatar
The Red Hand The Red Hand is offline
Member
 
Join Date: Aug 2007
Location: Two Words: Manhattan Project.
Posts: 995
What?

If I understand you correctly, you put the .py on both water meshes.
............................................
I don't flame, I rebuttal.
#11   Old 03-May-08, 22:46   
Reply With Quote
alienkid10's Avatar
alienkid10 alienkid10 is offline
Member
 
Join Date: Jan 2008
Location: blender
Posts: 1,003
Do I conect always sensor to a python controller?
#12   Old 03-May-08, 23:53   
Reply With Quote
blendenzo's Avatar
blendenzo blendenzo is offline
Moderator
 
Join Date: Apr 2006
Location: Michigan, USA
Posts: 2,193
Quote:
Originally Posted by alienkid10 View Post
Do I conect always sensor to a python controller?
Yes, that's the correct method. Did you download the demo and look at it yet? You should be able to see how it works there.

The Red Hand: This is some of the best non-shader water I've seen to date in the BGE. I'm definitely keeping a copy of this for future reference.
............................................
Game Engine tutorials: blendenzo.com - 3DKernel - TutorialsForBlender3D - blending-online
My Projects: Solomon's Treasure - Sokoban - Marble Labyrinth
#13   Old 04-May-08, 00:25   
Reply With Quote
The Red Hand's Avatar
The Red Hand The Red Hand is offline
Member
 
Join Date: Aug 2007
Location: Two Words: Manhattan Project.
Posts: 995
Thanks blendenzo. Glad I could help the community!
............................................
I don't flame, I rebuttal.
#14   Old 04-May-08, 10:39   
Reply With Quote
Mico27's Avatar
Mico27 Mico27 is offline
Member
 
Join Date: Jul 2007
Location: Canada, Quebec
Posts: 603
Hey when I use the scrolluv script, I get an error :
File "uvscroll.py", line 13, in <module>
AttributeError: getVertexArrayLenght
Compiled with python version 2.5. ....



and I use the latest version of blender 2.45
#15   Old 05-May-08, 20:04   
Reply With Quote
The Red Hand's Avatar
The Red Hand The Red Hand is offline
Member
 
Join Date: Aug 2007
Location: Two Words: Manhattan Project.
Posts: 995
Umm, that doesn't happen on mine, but you might want to change it from "getVertexArrayLenght" to "getVertexArrayLenght."

Hope that wasn't a typo on your part, but it doesn't happen for me, but if the problem consists, I'm probably not the person to answer this question.
............................................
I don't flame, I rebuttal.

Last edited by The Red Hand; 06-May-08 at 01:52.
#16   Old 06-May-08, 01:28   
Reply With Quote
MagicMan's Avatar
MagicMan MagicMan is offline
Member
 
Join Date: Sep 2005
Location: USA
Posts: 738
Wow I had something almost identical to this in one of my games. All I was missing was the use of the fractal tool. That adds to the effect a lot. I've made a note to use this technique in the future. Good job.
............................................
Out of the Hat
Blender Barrage-a true community project; contribute today! (15 out of 20 minigames for 1st edition submitted)
#17   Old 06-May-08, 01:41   
Reply With Quote
Mico27's Avatar
Mico27 Mico27 is offline
Member
 
Join Date: Jul 2007
Location: Canada, Quebec
Posts: 603
Quote:
Originally Posted by The Red Hand View Post
Umm, that doesn't happen on mine, but you might want to change it from "getVertexArrayLenght" to "getVertexArrayLenght."

Hope that wasn't a typo on your part, but it doesn't happen for me, but if the problem consists, I'm probably not the person to answer this question.
nope didnt fixed the problem... in fact adding the dot added a syntax error....
#18   Old 06-May-08, 04:05   
Reply With Quote
Pret_Letter Pret_Letter is offline
Member
 
Join Date: Jan 2008
Location: Boxtel, The Netherlands
Posts: 81
Quote:
Originally Posted by Mico27 View Post
nope didnt fixed the problem... in fact adding the dot added a syntax error....
It wasn't the dot. It's the ht that should be changed into th .
He made 2 typos in one sentence..
#19   Old 06-May-08, 14:43   
Reply With Quote
Mico27's Avatar
Mico27 Mico27 is offline
Member
 
Join Date: Jul 2007
Location: Canada, Quebec
Posts: 603
Quote:
Originally Posted by Pret_Letter View Post
It wasn't the dot. It's the ht that should be changed into th .
He made 2 typos in one sentence..
Holy shit thanks a lot (I use to speak french so I tought I writed it correctly, I was like WTF?!?!?) now it works
#20   Old 07-May-08, 00:06   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 16:51.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists