Jump to content
Hash, Inc. Forums

Recommended Posts

I would have just build a regular grid and displace the CPs according to the fBm value under each grid point. No need for recursive subdivision.

The grid is built from the fBm image. It seemed a lot easier to create the image and build the grid from that rather than build the grid and create the image from the grid. which is how the ASCII import works.

Share this post


Link to post
Share on other sites

The grid is built from the fBm image. It seemed a lot easier to create the image and build the grid from that rather than build the grid and create the image from the grid. which is how the ASCII import works.

Ah! I see. I must have read a little too quickly. I thought you were doing the reverse. That is build the grid recursively.

 

Well, this is one reason to use the SDK. You would have a good fBm generator already coded, based on the most recent version of the Perlin noise, and ready to call with your sample points and use.

Share this post


Link to post
Share on other sites

Well, this is one reason to use the SDK. You would have a good fBm generator already coded, based on the most recent version of the Perlin noise, and ready to call with your sample points and use.

But I'd have to learn C++ which I really don't want to do. Even the small amount I learned 7 years ago to write GridWizard v2 wasn't nearly enough for me to make heads or tails of the SDK - I couldn't even draw a 2-point spline. And I haven't touched C++ since then; I'd have to spends 6-8 months at least of my free time trying to learn enough to make AM TerraForm a plugin.

Share this post


Link to post
Share on other sites

NEW RELEASE: BETA 3

AM TerraForm

 

Random fractal landscpae generation is now fucntional. It's pretty slow - a 257x257 image takes about 1 to 1.5 minutes. I currently have not found an all-encompassing equation that will allow me to predict the number of iterations that take place during the recursive subdivision process. Without that, I cannot move the progress bar incrementally. And for some reason, the marquee fuction doesn't work during this process so I compromised by just having the bar progress over and over so that you'll know that something is happening and that AM TerraForm hasn't stalled.

 

You should keep in mind that the color image of the random fractal lanscape is simulated for the sake of appearance - it is NOT being used as the actual topographic data. See the Help file for more info.

 

I've got a few odds and ends that I want to add before I start working on a 3D Preview. This will take some time since I have never programmed DirectX and know almost nothing about doing so.

 

Still, even without 3D Preview, I think AM TerraForm is complete enough at this point that if people still want to donate a few nickels, I have set that up on the website.

 

I've also created a new e-mail address for any questions or comments: amterraform@comcast.net

Share this post


Link to post
Share on other sites

As some may remember I am also making a terrain tool for A:M, but I haven't been able to put much effort into it yet. Because of that, I have followed this thread with great interest and I'd like to complement Michael on a great achievement so far.

 

Well, this is one reason to use the SDK. You would have a good fBm generator already coded, based on the most recent version of the Perlin noise, and ready to call with your sample points and use.

But I'd have to learn C++ which I really don't want to do. Even the small amount I learned 7 years ago to write GridWizard v2 wasn't nearly enough for me to make heads or tails of the SDK - I couldn't even draw a 2-point spline. And I haven't touched C++ since then; I'd have to spends 6-8 months at least of my free time trying to learn enough to make AM TerraForm a plugin.

 

I agree with Yves that making this tool as a plugin would be much easier, but also that you have to know some c++ - not much, but some. Only you Michael know if learning c++ is fun enough to make it worthwhile.

 

As I said, I am certainly taking the plugin path, but one thing have made me worried:

 

[...]The only addition is that I've added saving the patch data in the model file so that AM doesn't need to do it.[...]This is a pretty big improvement on the usability of AM TerraForm since large meshes are now instantly usable instead of having to wait for AM to calculate all the patch data; I frequently use 256x256 meshes and if I rememebr correctly, it used to take AM 7-8 hours to calculate the patch data.

 

I think I can confirm this. On my computer 32x32 don't take much time at all, 64x64 takes less than 2 seconds and 128x128 takes about 60 seconds for "Finding Patches" & "Aligning Normals". This is an indication of exponential time complexity and if I extrapolate a 256x256 mesh will take about 10 hours. There is a method for this in the SDK also and it takes the same time to complete. If there isn't a workaround for this in the SDK that I'm not aware of, I see this as a potential problem. Not for Michael of course, but for me and my plugin.

 

I'm not sure what the typical use case will look like. Will you really use such dense meshes as 256x256 or will your typical choice be something like 32x32 with a displacement map?

 

If you actually want 256x256 or even greater, this isn't practically possible with a pure plugin solution. Of course you can do all your terrain manipulation in the plugin and when you are ready you can write the data to a model file, just as Michael does. But then you still have to deal with different versions of file formats. Not having to deal with this is one of the main reasons for taking the plugin path in the first place.

Share this post


Link to post
Share on other sites

I agree with Yves that making this tool as a plugin would be much easier, but also that you have to know some c++ - not much, but some. Only you Michael know if learning c++ is fun enough to make it worthwhile.

That depends upon your definition of "some". :D

Also, when does a plugin stop being a plugin? I agree that it would be easier if AM TerraForm were a plugin ( and I feel somewhat guilty that's not!) but you could just as easily argue that it would be easier if Photoshop were a plugin.

Share this post


Link to post
Share on other sites

I agree with Yves that making this tool as a plugin would be much easier, but also that you have to know some c++ - not much, but some. Only you Michael know if learning c++ is fun enough to make it worthwhile.

That depends upon your definition of "some". :D

Yes, of course it does ;)

 

 

Also, when does a plugin stop being a plugin? I agree that it would be easier if AM TerraForm were a plugin ( and I feel somewhat guilty that's not!) but you could just as easily argue that it would be easier if Photoshop were a plugin.
You shouldn't feel guilty at all. I think a standalone application is as easy/good as a plugin. What I'm trying to say is that I think it would be easier for you as a programmer.

Share this post


Link to post
Share on other sites

PROGRESS REPORT

 

I'm working on adding a little more functionality to the random landscape generator - just some smoothing options, allowing the user to set some parameters to the random point displacement used in the subdivision process and allowing the user to customize the settings used to display the simulated color image of the landscape. I might have a new build ready later tonight.

 

I'm not really happy with the fBm code used to create the random landscape and am exploring other ways of doing it.

Share this post


Link to post
Share on other sites

Okay, so I had terraform randomly generate a 100x100 pattern and then mesh. It came out quite rough.

 

So, I had terraform randomly generate another 100x100 pattern, then I took a screen capture and used Paint Shop Pro, to blur it (gaussian blur) and then resized the screen capture pattern down to 100x100.

 

I then used simple soften on that. I saved it as a .TIF file and imported it back into terraform.

 

Here is the pattern and mesh... looks pretty good to me!

 

[attachmentid=16483][attachmentid=16484]

Image1.png

TFtest5.jpg

Share this post


Link to post
Share on other sites

Okay, so I had terraform randomly generate a 100x100 pattern and then mesh. It came out quite rough.

 

So, I had terraform randomly generate another 100x100 pattern, then I took a screen capture and used Paint Shop Pro, to blur it (gaussian blur) and then resized the screen capture pattern down to 100x100.

 

I then used simple soften on that. I saved it as a .TIF file and imported it back into terraform.

 

Here is the pattern and mesh... looks pretty good to me!

If you read the Help file, it describes what you ended up with - a mountain instead of a lake/sea. If you want to avoid that, use the grayscale image. Speaking of which, you don't need to do a screen capture - right-click the image and you can save it.

Share this post


Link to post
Share on other sites

I wasn't complaining, I was simply showing what some smoothing will do for the mesh.

 

I didn't care that I didn't get a lake. I was just trying to get a smoother, more natural looking mesh.

 

Thanks for the tool! :wub:

 

I sent you a donation on this... wonderful work!

Share this post


Link to post
Share on other sites

I wasn't complaining, I was simply showing what some smoothing will do for the mesh.

I sent you a donation on this... wonderful work!

I didn't think you were complaining - most users don't read instructions, read me files, manuals or Help so I didn't know if you were aware. Mucho Gracias!

Share this post


Link to post
Share on other sites

NEW BETA 3 BUILD: AM TerraForm

 

I don't think I'm going to get everything I wanted done today but I got smoothing added so I uploaded a new build. I didn't get the Help file updated but using smoothing is pretty straight forward - just select the number of smoothing passes you want. 1-3 should be plenty but I added a selection for 1-10. I also included a height selective smoothing option. It's based on the grayscale so your choices are 0-255. You can also select which direction smoothing takes place - Lows to Highs or Highs to Lows. This is designed so that you can have your lower elevations be smoother than the higher elevations or vice versa. I'll also be adding the ability to set up a different smoothing height for each pass.

Share this post


Link to post
Share on other sites

Problem with smoothing is that it seems to gray out EVERYTHING (controls, menus, etc.) after using it.

 

I saved off the color map and grayscale map by right clicking on the map display.

 

But, even after selecting to clear and start a new project, it still shows everything grayed out.

 

I had to close TerraForm and restart it to allow me to reload the bitmap.

 

EDIT: I could not reproduce the grayed out bug... so disregard it unless someone else is able to reproduce it.

 

Here is a lvl 3 smoothed map and it's resulting mesh rendered. Are these the results you saw too?

 

EDIT2: I can't seem to reproduce this either... strange. Almost as if it started up wrong just that once or something.

 

[attachmentid=16489][attachmentid=16488]

 

One way to smooth out your mesh after you get it into A:M is to select the whole mesh and goto Plug-ins->Wizard->Smooth and select the 'all splines' checkbox and recurse set to at least 2.

 

Here's a before and after smoothing comparison shot. (This was smoothed to level 3 in A:M TerraForm to make the initial mesh)

[attachmentid=16491]

test7render.jpg

test7c.png

TF_BandAsmooth.jpg

Share this post


Link to post
Share on other sites

Here is a lvl 3 smoothed map and it's resulting mesh rendered. Are these the results you saw too?

Yes, that looks like it should after smoothing.

Share this post


Link to post
Share on other sites

NEW BETA 3 BUILD: AM TerraForm

 

I've added an option for adjusting the random number used for midpoints during subdivision and options for customizing the appearance of the simulated color display. See the Help file for more details.

Share this post


Link to post
Share on other sites

Anyone have images to post from terrains made with A:M TerraForm?

I create one of the Land of Oz but its not ready for prime time yet.

 

I'm curious to see what others are doing with this?

Share this post


Link to post
Share on other sites

PROGRESS REPORT

 

I am currently on hiatus from programming while I try and get an entry into the Image Contest. As someone who claims to use AM for mechanical modleing, I'd feel pretty stupid if I didn't at least enter a passable image when the contest topic is Mechanical.

 

While I am curently adding in the 3D preview (still learning DirectX), I am also working on ideas for v2. Maybe that's jumping the gun since v1 is still technically a beta version, but it seems like the thing to do. I am still undecided as to whether or not I should make v2 a plugin.

 

The main concept for v2 is MDI (Multiple Document Interface). I'm going to incorporate 16-bit/channel for images and add options for adding planet curvature to a mesh or creating an entire planet. I'm also going to try and add a multi-mesh option - you can create a small, denser meshes that will fit right onto other mesh units. There will also be an option to create a simple gradient material that can be opened in AM along with the mesh so that you can more easily set up the textures.

Share this post


Link to post
Share on other sites

Why does Terraform need to "act like a server and accept incoming connections"

 

that's the message I get from my firewall.

Share this post


Link to post
Share on other sites

Why does Terraform need to "act like a server and accept incoming connections"

Nothing in the actual operation of AMT requires any kind of server connection. The only thing I can think of is that AMT requires .Net Framework v2 and perhaps the OS is trying to update some of those files.

Share this post


Link to post
Share on other sites

Question..

 

I was reading the help file over and over but I cant seem to find it, of course it is late and I have been up all day. But is there a way to make the mesh less dense? right now I have had some models come upt and right under 1,000,000 patxhes and most right around 500,000. AM just does not handel large models like that every well.

 

Chad

 

The main concept for v2 is MDI (Multiple Document Interface). I'm going to incorporate 16-bit/channel for images and add options for adding planet curvature to a mesh or creating an entire planet. I'm also going to try and add a multi-mesh option - you can create a small, denser meshes that will fit right onto other mesh units. There will also be an option to create a simple gradient material that can be opened in AM along with the mesh so that you can more easily set up the textures.

 

 

 

I would definitly pay for this!!

Share this post


Link to post
Share on other sites

I have started to gather after reading a bit more that your actual image size has some thing to do with it, as far as pixel size. Am I woring ro on the right track. I will have to do more tests, the last mesh came out at 690,000 patches or somewhere around there, and that is no typo.

Share this post


Link to post
Share on other sites

That is exactly what it was, the image size in pixes controls the density. Damn I must have been tired the past few days cuz that never crosses my mind.

Share this post


Link to post
Share on other sites

Chad,

 

I'm just starting to experiment with this too. It's pretty cool, I'm just letting it create a random mesh and saving the model. Using dimensions of 100x100 I get a model of 10,000 patches.

 

Here's the type of result I've been getting, without textures. I need to think about how I would go about texturing somethine like this.

 

I'd be interesting in seeing how you're using it, if you could pass on some tips on landscape creation that would be great! I see before your recent posts, no one has posted to this thread in 4 months, maybe we can wake it up again.

 

-Jim

landscape.jpg

Share this post


Link to post
Share on other sites

Actually I am using it in conjunction with Vue4.

 

I create the landscape I want in Vue then I can export it as a grey scale file. Then I will actuall texture it in Vue then set the lights to be directly over it so there are no shadows and render a hi rez color render this I will use for my texture.

 

I then open AM Terra Form and import my grey scale image and create my landscape. This is where I had to go back into photshop to scale down my maps cuz I was getting a 1,000,000 patch count on my models, but they looked freakn great!

 

once that is done I import my rendered color image and just go to top view of my model and apply. It is already lined up and all. The only problem I am having is the rendered out map vrom vue is not the best so sometimes I get strange atifacts in my maps. I will try and post something later cuz the stuff I am working on I can not show since it is for production.

 

Chad

Share this post


Link to post
Share on other sites

PROGRESS REPORT:

 

It seems like a long, long time has passed since the last beta, but I guess it's only been 5 months or so. Off and on I've been trying to get a handle (pun intended) on DirectX 9 so I can get the 3D preview done but it's been pretty frustrating due to a woeful lack of coherent info on the subject as far as using VB.NET 2005 goes - 100% of every code example I've seen does not work - most likely because they are being presented with a lot of assumed knowledge. However, using DirectX 9, I have managed to get a sprite to draw to a picture box control. I am now trying to figure out how to draw a 3D cube. Once I can manage that, the rest should not be a giant hassle.

 

As far as writing v2 as a plugin, that has been a complete dead end so far. All of the existing examples seem to be for VC++ 6 and do not translate to VS.NET. So even though several years ago I was able to create the Goes Nowhere, Does Nothing project, I do not know nearly enough C++ to update it to VS.NET in a working fashion. Actually, I don't know nearly enough C++ to be able to write AM TerraForm as it exists now, much less what I have planned, but until I can at least get a window to pop up in AM, I am dead in the water.

Share this post


Link to post
Share on other sites

Mike,

 

After using this for a few landscapes, I really like the shapes it generates but the thing that strikes me as being the biggest challenge is the high patch density (I don't mind that it's not a built in plugin at all, it's an easy to use tool and generates an A:M model, no problem there).

 

In the landscape picture I showed above, it's a great mountain range but the patch count was very high throughout, even on flatter areas. I found it didn't need to be, especially on the flatter areas but also on the mountain shapes too. I could go in by hand and delete quite a number of in-between splines and still maintain the same basic shape.

 

But doing that by hand is too tedious, so I stopped using it for awhile. I'd like to find that sweet spot of a good looking landscape model but with a reasonable patch count so I'm always interested in where this tool can go.

 

I'm interested to hear your thoughts on this.

 

thx!

 

-Jim

Share this post


Link to post
Share on other sites

I wonder if it would be possible for someone to make a wizard that would take a grayscale bitmap as input and would generate a grid that was more dense in say , the dark areas , and less dense in the light areas ? It would still be a generally rectangular grid. the transitions from high to low would be handled with hooks.

 

a landscape generator could create the input bitmap automatically, making it darker where the elevation changes were more severe , and white in the flat areas .

Share this post


Link to post
Share on other sites

After using this for a few landscapes, I really like the shapes it generates but the thing that strikes me as being the biggest challenge is the high patch density (I don't mind that it's not a built in plugin at all, it's an easy to use tool and generates an A:M model, no problem there).

 

In the landscape picture I showed above, it's a great mountain range but the patch count was very high throughout, even on flatter areas. I found it didn't need to be, especially on the flatter areas but also on the mountain shapes too. I could go in by hand and delete quite a number of in-between splines and still maintain the same basic shape.

I wonder if it would be possible for someone to make a wizard that would take a grayscale bitmap as input and would generate a grid that was more dense in say , the dark areas , and less dense in the light areas ? It would still be a generally rectangular grid. the transitions from high to low would be handled with hooks.

 

a landscape generator could create the input bitmap automatically, making it darker where the elevation changes were more severe , and white in the flat areas .

There isn't any elegant solution. With the way the patches work, you can't have a base grid with some of the patches in the grid being subdivided into denser patches. Hooks would not solve the problem effectively (if at all) and would more than likely be a hindrance rather than a help.

 

This is why I would hope to implement into v2 an automated way of what you can already do manually - create separate meshes so that you can create a base grid of large-dimensioned patches and then choose elevations where you want more detail. The program would then create denser meshes to fit exactly onto specific patches of the base grid.

 

The only question would be one of resolution. Theoretically, the resolution could get as fine as fractions of a millimeter, but you'd be dealing with probably billions, if not trillions, of patches. it's not like it couldn't be coded, but I wouldn't waste time coding something that would slow AM down to the point of uselessness.

 

As I mentioned above, you can already do this manually. In your image editor, just create a grid over your image to use as the base grid. Then, wherever you want more detail, copy out that portion and resample it so that you can use it for creating a second mesh. You can use this new image the same as the original to create an even denser third mesh to place over a portion it. The real problem would be trying to match up all the points along the edges of all the patches you were placing denser meshes over, which is why I want to automate that.

Share this post


Link to post
Share on other sites
The real problem would be trying to match up all the points along the edges of all the patches you were placing denser meshes over
How will you splice in the denser meshes without hooks?

Share this post


Link to post
Share on other sites

The real problem would be trying to match up all the points along the edges of all the patches you were placing denser meshes over
How will you splice in the denser meshes without hooks?

You don't - the denser mesh is just positioned so that it looks likes it's connected.

Share this post


Link to post
Share on other sites

PROGRESS REPORT:

 

I'm about ready to give up on the 3D Preview option. While I have something that works, it's unacceptably slow for large meshes.

 

I did find a tutorial on MSDN for creating a terrain from a height map with DirectX 9 using VB.Net, but even though the authors claim that the tutorial is aimed at beginners, they explain almost nothing about what the code is doing and why. What I did find out from this tutorial was that I need to be creating vertex and index buffers and that I also will need to compute the normals in order for the lighting to function. Their example created a 256x256 mesh so if I can figure out what they did and why they did it, then maybe I'll be able to forge ahead.

Share this post


Link to post
Share on other sites

PROGRESS REPORT:

 

While I have been able to create vertex and index buffers and get an acceptably fast preview, I still cannot get normals to work and without that, there can be no lighting which makes a 3D preview useless.

Share this post


Link to post
Share on other sites

PROGRESS REPORT:

 

Apparently I've gotten something working for 3D Preview. I would probably be able to get a new Beta version uploaded this evening, but I'm being badgered into several New Year's Eve and New year's Day events. I'd rather just sit here and get a new Beta working, but I'm being accused of being an antisocial a-hole by my friends and family so it might be a few days before I can get a new Beta ready.

Share this post


Link to post
Share on other sites

Glad to hear of your progress especially your recent addition of a 3D preview.

I honestly don't know how you guys (programmers) do it.

 

I may not comment on your progress reports but I read every one of them!

 

Just wanted to let you know we are watching. :)

Share this post


Link to post
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.


×
×
  • Create New...