L3DT users' community
Large 3D terrain generator

Newbie semi-advanced questions.

Got a problem or need advice?

Newbie semi-advanced questions.

Postby madoc » Fri Mar 02, 2012 10:51 pm

Really short version:
1) Is there a setting for a design map file 'pixel' that basically equals 'dont calculate on me'? Or a way to make dmf's odd shapes? (would making a 0,0,0,etc dmf pixel be the way to go?)
2) Is there a way to control the edge wrapping feature with more control ie wrap only left-right and not top bottom? Or even more fine grained control?

Long version:
(see attached image, makes a lot more sense)
Yet another newbie playing with making l3dt do things it was never designed for. What I want to do is generate a 3d box with terrain on the outside of it (bare with me). I was thinking easist way to do this would be to generate a heightmap that's 3x the height I need and 4x the width and cut out what I need (white areas on attached image) to make a box. The long term goal is then to cut this up into 6 seperate heightfields then use something like spherical distort to make a 'roundish' object. I've seen similar things work quite well. There are problems however, which the questions are related to.

1) Calculation, I only need 6/12 of the 'tiles' this method would generate. So I'd like a way to tell l3dt to ignore those areas.
2) Edge wrapping, I've color coded the connecting edges, the touching edges on the boxes would already be ok, and if I can tell l3dt to ONLY edge wrap east west that will help I realize that once i spherical distort things won't line up and ill have to come up with something to 'weld' the edges, I'm sure I can come up with that, however the terrain with l3dt is quite varried and it might be hard to weld the bottom of the sea with the top of a mountain. If theres no way to control the edge wrapping algorythm that l3dt uses I was thinking what I could do is since I dont need the data in the grey boxes, copy the dmf data from the edge its supposed to be touching. This would be a problem in corners (i could just avg the 2 pieces of data) but would at least give me an edge thats 'closeish'. I'm not scared of the dmf file format its very straight forward I've worked with it before to turn a text based muds map into 3d with some awsome results.

Another alternative for the edge wrapping problem is if l3dt already has the ability to 'weld' different files, that might work too. I'm already going to have to cut it up to apply the spherical distortion to each tile seperatly.
visualaid.png
visualaid.png (2.79 KiB) Viewed 12886 times
madoc
New member
 
Posts: 7
Joined: Sat Jun 14, 2008 3:31 pm

Re: Newbie semi-advanced questions.

Postby Aaron » Mon Mar 05, 2012 12:03 pm

Hi Madoc,

I’m sorry, L3DT doesn’t really support what you’re trying to do. In answer to your questions:

1) Design maps must be rectangular, and do not have any capacity to exclude areas. The nearest you could get would be to use the ‘Operations->Heightfield->Preview area from DM’ menu option to generate each of the six squares separately, but it would probably be easier to just generate the whole map and then export the six squares.

2) Wrapping is an all or nothing affair at the moment. I could conceivably change it to wrap X, Y or X&Y, but arbitrary mappings such as you propose are not likely to be supported, as they would mess up distance calculations, make lighting very strange indeed, cause significant speed penalties in calculations, and generally pose a maintenance nightmare.

If theres no way to control the edge wrapping algorythm that l3dt uses I was thinking what I could do is since I dont need the data in the grey boxes, copy the dmf data from the edge its supposed to be touching. This would be a problem in corners (i could just avg the 2 pieces of data) but would at least give me an edge thats 'closeish'.


That’s a good idea; it should get you pretty close to the right result.

Another alternative for the edge wrapping problem is if l3dt already has the ability to 'weld' different files, that might work too.


Not seamlessly, but it has been a long term goal. I’ll have another look into it.

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

Re: Newbie semi-advanced questions.

Postby madoc » Wed Mar 07, 2012 8:27 pm

No apology neccicary! I'm trying to use a screwdriver as a hammer here, its just not designed for it, but I think i can sqeeze decent results out of it.
Even if the end result only looked 50% as good as most things generated in L3DT, it would still be like ten times as good as what I could come up with :)

I'll play with the ideas I had I just figured there was no harm in asking.

I know theres no way to 'turn off' calculation for a design map pixel, but is there a set of data that would be 'lighter' calculation?
madoc
New member
 
Posts: 7
Joined: Sat Jun 14, 2008 3:31 pm

Re: Newbie semi-advanced questions.

Postby Aaron » Wed Mar 07, 2012 8:39 pm

Hi Madoc,

is there a set of data that would be 'lighter' calculation?


Yes. Using the design map brush, you should switch off all erosion and cliffs/terraces in the undesired regions.

In other news, I've built a plugin that can weld together arbitrary edges. Over the next days/weeks, I'll use this to build a script to weld together the edges for your box-wrapped terrain, and cut off the excess (well, set to 0). I'll let you know when it's ready for testing.

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

Re: Newbie semi-advanced questions.

Postby Aaron » Fri Mar 09, 2012 1:22 pm

Hi Madoc,

I've got a script running that kinda does what you want. It takes a heightfield like this:

2do.jpg
2do.jpg (155.09 KiB) Viewed 12856 times


And mangles it to this:

2d.png
2d.png (271.44 KiB) Viewed 12856 times


As far as I can tell, the tile borders now obey the wrapping rules you defined above.

In 3D, it looks like:

3d3.png
3d3.png (238.51 KiB) Viewed 12856 times


Now, as you'll notice from the 3D view, the edge blending has caused some pretty horrible streaky artefacts around the tile edges. This I will try to fix shortly. There are also some small steps on the internal borders between tiles. These I may not fix, as to do so would affect the outer tile borders. Some manual editing may be required.

Anyway, progress is being made. I'll let you know when I've got the script ready for testing.

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

Re: Newbie semi-advanced questions.

Postby madoc » Fri Mar 09, 2012 5:17 pm

Thats phenomenal! I really wasnt expecting development, I was going to take a poke at developing a plugin to sorta do it but having the master himself do it is sooo much better!
Going to have to renew my liscence for sure! :)
madoc
New member
 
Posts: 7
Joined: Sat Jun 14, 2008 3:31 pm

Re: Newbie semi-advanced questions.

Postby Aaron » Sat Mar 10, 2012 1:55 pm

Hi Madoc,

The script to generate the cube mapped heightfields is now available from here:

http://www.bundysoft.com/wiki/doku.php? ... eightfield

This script requires L3DT v12.03 build 1, which is on the downloads page now. The script won't work with older versions because it relies on the 'calc.HF.BlendEdges' and 'calc.map.ZeroArea' functions, both of which are brand spanking new.

Please note that this algorithm is still a little unpolished:
  • the blending still suffers from the streaky artefacts seen in the above images, and;
  • there are no progress bars.
Nevertheless, the script as it is should be sufficient to allow you to start testing the next steps in your processing and rendering pipeline.

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

Re: Newbie semi-advanced questions.

Postby madoc » Wed Mar 14, 2012 1:45 am

Awsome, I'll play with it, was traveling for work so havnt had a lot of time for personal projects.
madoc
New member
 
Posts: 7
Joined: Sat Jun 14, 2008 3:31 pm


Return to Help and support

Who is online

Users browsing this forum: No registered users and 14 guests