remove some water

Blitz3D Forums/Blitz3D Programming/remove some water

Kris(Posted 2003) [#1]
I'm creating a plane of water, and I have a boat in the water. Problem is, there is water in the boat! anyone know of a way to remove the section of the plane inside of the object?

Maybe there is a way to paint a transparent shadow on the water that has the dimensions of the boat...

~Kris~


jfk EO-11110(Posted 2003) [#2]
Maybe with EntityOrder(). Or a 2-Pass Render Method, using Grabimage and drawimage to paste the boat onto the water.
Or divide the Water in Sub-Meshes, one for each Direction around the boat.


Michael Reitzenstein(Posted 2003) [#3]
Grabimage and drawimage? Eek!?


jfk EO-11110(Posted 2003) [#4]
I didn't say it is a good Idea.


fredborg(Posted 2003) [#5]
If the water is a mesh, you might be able to use vertex alpha to fade out vertices inside the boat. But it would require a pretty dense mesh to work properly...

Fredborg


Shambler(Posted 2003) [#6]
Lol an interesting problem =)

I would have thought entity order should solve this, just set the boats entity order to -1...think that should do the trick.


Binary_Moon(Posted 2003) [#7]
shambler - the only problem with that is that you can't have any part of the boat underwater since the bottom of theboat will always be drawn on top of the water.


Shambler(Posted 2003) [#8]
Depends where the camera is, if its in the boat then there's no problem.

You could always switch between -1 and 0 entityorder depending on the camera's position.


Kris(Posted 2003) [#9]
ok... so this is gonna be a pain. If I create a plain around the boat, and make it very, very large so it stretches to the horizan (such as jfk suggested) will it slow down the game? or will I get about the same refresh as an infinate plane?

Thanks for all of the replies


RifRaf(Posted 2003) [#10]
You could redesign your boat, as a split level. meaning the floor of the boat is jut above the waterline. This would look fine, unless your boat is suppsed to be a canoe.


smilertoo(Posted 2003) [#11]
model the boat with an area of water as part of the boat mesh, then flip normals of the main water grid as the boat passes over them.


LT(Posted 2003) [#12]
I think the entity order is on the right track, but the boat will not contribute to the z-buffer if you set it to anything other than 0. I've never tried this myself, but that's what it says in the docs. A potential solution may be to separate the inside of the boat's hull from the outside and set the entity order for that only.


IPete2(Posted 2003) [#13]
Maybe you could use a terrain to make the water, and use some kind of deformation routine where the boat is.

Or if you are viewing using the camera in the boat, raise the boat out of the water, no one can see!

IPete2.


Sledge(Posted 2003) [#14]
The first thing I'd do, as has been suggested, is cheat and make sure the lowest section of the boat's interior remains above the water-line.

If that won't do, then the next thing to suggest is losing that plane -- instead I'd have a four entities, each carrying the water texture, box the boat in from each side. You could either make these children of the boat and adjust the UV coods as needed, or dynamically resize them and alter the texture's dimensions. Neeldess to say, the entities (quads would be best I think) should intersect the boat on each side, but not go far enough in so as to encroach on the interior... voila!

(Actually, thinking about it, I'd make the water entities parent to the boat, so it can all be moved together AND the tub can still bob about independantly 'n' stuff.)


Paul "Taiphoz"(Posted 2003) [#15]
Im wondering .. if the water has a wave effect or not ? if so then keeping the boats water line in cue could be a problem..

Im wondering how easy it would be to give the plain a few more points, then deform them at the boats position, like displacing the water where the boat is, this would stop the water mesh from showing through the boat cos you just shoved that part of it down a bit. then just have the mesh return to normal as the boat moves, this could also give off a nice boat wake effect although I havent tried anything like this.

I hope it helps.


Neo Genesis10(Posted 2003) [#16]
Simple answer to your problem - DONT USE PLANES! They're notoriously bad for graphics since they're infinite and they're not meshes so you cant bend them around the base of the boat either. Your best bet is to use a mesh. Then you could bend the water under the base of your boat. This would also allow waves and such.


Zephar123(Posted 2003) [#17]
A proper done mesh alot of times does not effect speed eigher. I am using a mesh currently for a terrain and dont have all the bugs with terrains. THe real irronic thing is the mesh is only take 6000 polies!!! and is huge!!


Rob(Posted 2003) [#18]
This is another strong reason for Blitz to introduce better z-buffer manipulation.


Rob(Posted 2003) [#19]
Actually, take a look at this diagram. There are three meshes.



One is the ocean as you know it. The other is the boat and the rectangle-to-boat detail mesh. The rectangle-to-boat detail mesh is very simple. You then tell the rectangle-to-boat mesh to linepick from each inside vert to the boat. This way, it hugs the boat regardless of the depth the boat sinks, but does not go inside.

the open verts of the ocean mesh snap to the outer verts of the rectangle-to-boat mesh. This isn't really complicated.

All you need to know to start with are: the rectangle to boat mesh verts that will snap to the boat, and their local start position.

Each frame, these verts are positioned back to the outer bounds then linepicked to the boat again.

You can pretty much do what you want with the boat then. If you're interested in rolling ocean waves too, then you might want to use a similar concept.


JoeGr(Posted 2003) [#20]
Here's another idea. You could make a water mesh with a hole in it to fit the boat, then always move it WITH the boat. To make the boat look like its moving, scroll the water's texture in the opposite direction.

Or come up with a boat model that has a higher deck.


Ross C(Posted 2003) [#21]
Reading down that post, i thought: I've got an idea that might work. How about a water mesh with a boat shaped hole.....DOH!!! beaten..Dam u joe!! lol


JoeGr(Posted 2003) [#22]
:D


Rob(Posted 2003) [#23]
Thats the reason for repeated linepicks - the boat can go deeper into the water at any time without overlaps of a fixed sized hole :)


Ross C(Posted 2003) [#24]
Ah, never thought of that one ;)


JoeGr(Posted 2003) [#25]
Thats the reason for repeated linepicks - the boat can go deeper into the water at any time without overlaps of a fixed sized hole :)

I know that, and I know your way is better. I was just offering a simpler alternative. How about this though; if the sides of the boat had a certain amount of thickness and didn't slope too much, some vertical movement (as well as pitch and roll) might still be possible with a fixed size hole.