Jump to content

Infinite water plane around terrain island


YouGroove
 Share

Recommended Posts

Well water is Shader, skybox is not water shader , perhaps something to try.

 

 

Yes Fog seems the simple better way, just make the plane big enought and put some fog for big distance, and some simple islands meshes to break the empty far space.

Stop toying and make games

Link to comment
Share on other sites

its not hard theory but this is just small math and easy to implement.

easiest solution to to this would be to set the camera range to d if you use first person view. you also can use distance fog. its up to you what you need for you game and how its the best way to implement it. I cant know it.

It doesn´t work... why? mhmmm It works... why?

Link to comment
Share on other sites

in le2 you could make the water really deep and it was a good way of stopping your character dropping off the edge of the map. It just looked like the character had drowned.This was much better than having a bunch of unlikely looking mountains around the edge of your map.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

in le2 you could make the water really deep and it was a good way of stopping your character dropping off the edge of the map.

 

This is not a problem of deep water ,the characters will stay on some island, only some perimter in water will be allowed.

I just need the characters to in top of moutain to not view some border corner of the big water plane.

Stop toying and make games

Link to comment
Share on other sites

Try this (I've used it in the past):

 

If you don't want to fog out in the distance, create a disc shape for your water plane. The disc should be made of a few concentric rings of polygons. Select the outermost vertices of the disc and set these vertices' alpha to zero (or, if your water plane needs a LOT of verts, or uses tessellation, you can use a texture component that controls the alpha--map accordingly to create the fade). This transparency will allow the water disc to fade gradually into the sky sphere. Obviously, the bottom half of the sky sphere should be painted to look like ocean so the water disc blends to something similar....

 

Note: if you're using a skybox then you'd use a square plane instead of a disc so it fits better.

 

The special need here would be for a shader that allows vertex alpha to be used to control transparency if needed. Also, generally speaking, fogging out the water plane before the edge can be seen is typically cheaper, but not much. The water plane's transparency doesn't need to be sorted since the only thing that draws "behind" it is the skybox (assuming you can control the render order).

  • Upvote 2

--"There is no spoon"

Link to comment
Share on other sites

  • 2 years later...

I make infinite water on HLSL. On Nuclear Basic http://forums.nuclearglory.com/index.php?tid=4836&tpg=2

 

1. Make object Plane

2. Apply water shader to it

 

in game cycle:

 

Plane position = camera position

Scroll plane texture on shader automatic

 

//vertex shader
v2f v(a2v In)
{
v2f Out = (v2f)0;

float4 Po = float4(In.position.xyz,1);
float3 Pw = mul(Po,world).xyz;
Out.pos = Pw;
Out.eye = viewInv[3].xyz;
Out.position = mul(Po, wvp);


Out.viewpos = Out.position;


//automatic sroll water if player move
Out.uv.xy = (In.texCoord+Pw.xz)*textureScale;
Out.uv.zw = (In.texCoord2+Pw.xz)*textureScale;


return Out;
}

 

 

O! "Water mode: When checked, a water plane will appear everywhere in the scene"

http://www.leadwerks.com/werkspace/page/tutorials/_/scene-panel-r3#section3

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...