L3DT users' community
Large 3D terrain generator

flat water

Got a problem or need advice?

flat water

Postby creat326 » Tue Mar 01, 2011 2:21 pm

Hi

I would like to flat the area where water is located. I export it all as a mesh and in my game I don't need to go underwater. I like the generated texture, but the 3d of that area could be flat and avoid triangle counts.

Is there a way to specify that height to be flat? or better yet, the area of water to be flat?

Thanks
creat326
Member
 
Posts: 22
Joined: Wed Sep 22, 2010 10:46 pm

Re: flat water

Postby Aaron » Tue Mar 01, 2011 9:26 pm

Hi Creat326,

You could convert the water map to a heightmap, then merge the output with the heightfield using a 'max' combine function. That should do the trick.

You can do this either with ZeoGraph, or scripting, or even using the relevant menu options in L3DT (though the latter will require you to export the water map as a heightmap, then re-import to affect the merging).

I can probably bash a script together to automate this for you if you like. Might take a day or two; a bit busy ATM.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: flat water

Postby creat326 » Tue Mar 01, 2011 9:57 pm

that would be great if you could do the script since i'm not sure i understood it :)
creat326
Member
 
Posts: 22
Joined: Wed Sep 22, 2010 10:46 pm

Re: flat water

Postby Aaron » Wed Mar 02, 2011 10:11 am

Hi Creat326,

Here's your script:

http://www.bundysoft.com/wiki/lib/exe/f ... _and_hf.zs

This script requires L3DT v2.9 build 11 or later. However, in this and earlier builds there is a misfeature in the atConvertWaterToHeight plugin that can, at times, pop up an annoying query about overwriting temporary maps. I've fixed this in v2.9 build 12, but I haven't released that just yet. Nonetheless, v2.9 build 11 should still work just fine with this script.

Anyway, please let me know if you find any problems with the script.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: flat water

Postby creat326 » Wed Mar 02, 2011 11:55 am

thanks!

i'll check it tomorrow.
btw, I realized that splatmaps don't have the water texture, only "land" texture. Is this a bug?
creat326
Member
 
Posts: 22
Joined: Wed Sep 22, 2010 10:46 pm

Re: flat water

Postby Aaron » Wed Mar 02, 2011 12:25 pm

Hi Creat326,

No, that's definitely intentional. The texture maps and alpha maps are intended for the heightfield surface. Hence, they always describe the land type, regardless of the type of water that may or may not be above it.

Perhaps it's best to think of this in terms of an FPS game where you're swimming underwater. The colour of the texture applied to the heightfield mesh under the surface of the water is going to be the ocean floor (i.e. sandy), not the ocean surface (i.e. water waves).

This is demonstrated in the image below, where I've run off the side of a map so that you can see the heightfield texture beneath the water plane. Note how the texture of the terrain underwater (i.e. the texture map) is still representing the colour of the land (sandy, rocky), not the waves above, which are handled by a separate water mesh and texture.

[please scroll down to view the underwater section*]
UnderwaterTexture.jpg
UnderwaterTexture.jpg (108.2 KiB) Viewed 21898 times


It may confuse matters slightly that L3DT, by default, also bakes the effect of absorption of light by water onto the light map and thence the texture map, giving the blue/green underwater look. This is provided for renderers that don't do their own underwater light shading, but it can be disabled in the light mapping wizard.

Anyway, back to your problem; what you need is a way to bake the water map texture onto the heightfield texture. This is again possible with a custom script, but it'll take me a little while to cook that up, as there's quite a lot of other activity on the forum today. I'll let you know when I've got a script ready.

Best regards,
Aaron.

* grrr...I cant seem to control the display size of attached images.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: flat water

Postby Telarus » Wed Mar 02, 2011 11:49 pm

* I ran into the same problem when posting my G16.bmp questions. I think you may need a plugin for this version of your forums to allow access to that.
Last edited by Telarus on Thu Mar 03, 2011 11:50 pm, edited 1 time in total.
Telarus
Doyen
 
Posts: 112
Joined: Mon Jun 01, 2009 12:34 am

Re: flat water

Postby creat326 » Thu Mar 03, 2011 11:43 am

i think it would be a nice checkbox to have on baking the splatmaps: include water?
Since you are working on a script, it might be useful to add it already as a feature :)
creat326
Member
 
Posts: 22
Joined: Wed Sep 22, 2010 10:46 pm

Re: flat water

Postby Aaron » Wed Mar 16, 2011 9:51 pm

Hi Creat326,

For the reasons mentioned above, I won't be adding this as a feature. The script is on the to-do list.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: flat water

Postby creat326 » Fri Sep 02, 2011 8:09 pm

Hi Aaron,

I think the script that was included here doesn't work anymore. I don't find it by default on the new version either:
http://www.bundysoft.com/wiki/lib/exe/f ... _and_hf.zs

When I execute it, i get a new tab with black area for the water but the mountains seem flat too... i'm sure it's just the new version that it's not fully compatible with the older scripts.
Is it hard to upgrade? this reduces my poly count drastically for the game.
creat326
Member
 
Posts: 22
Joined: Wed Sep 22, 2010 10:46 pm

Re: flat water

Postby Aaron » Sat Sep 03, 2011 7:59 am

Hi Creat326,

I just downloaded the script from the website and tested it, and it's working as intended. All heightmap pixels that were below the water level were set to the height of the water surface. The heights of the hills were unchanged. If you'd like to check this, hover the mouse cursor over the highest point in the heightfield and note down the altitude reported in the status bar, then hover the mouse over the same point in the 'HF_plus_WM' layer, and compare the altitude. They should be the same.

You can also check the output in Sapphire, by running the script and clicking the 'Yes' button to overwrite the heightfield. Then, open Sapphire, and behold the flat water surface:

WM_plus_HF.jpg
WM_plus_HF.jpg (88.96 KiB) Viewed 21720 times


Once you're done viewing the result in Sapphire, be sure to press the 'Undo' button in L3DT to restore the heightfield to its previous state.

Are you observing a different output from this script? If so, can you post screenshots?

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: flat water

Postby Prime_8 » Fri Sep 09, 2011 4:37 pm

if i could could get the mesh of the flat area , it would work extra cool with a water shader that puts 'surf' near the edges of the mesh .

that would be cool . hmm suppose i could use my app to kill all verts above the sea level , in the resulting exported game mesh , that would result in same ?
hmm .

cool idea.. guys.
Prime_8
Contributing member
 
Posts: 26
Joined: Fri Aug 19, 2011 3:32 pm


Return to Help and support

Who is online

Users browsing this forum: No registered users and 6 guests

cron