Jump to content
Hash, Inc. Forums

Archived

This topic is now archived and is closed to further replies.

MSFlynn

AM TerraForm Beta 4

Recommended Posts

Obviously the forum is undergoing changes and this seemed the best place to post this since the 3rd Party area is no longer available; I assume that someone will move it if needs to be moved.

 

A few things:

 

You need DirectX 9 installed.

 

Nothing is changed in this beta except for the addition of 3D preview. If you don't care about previewing your mesh before opening it in AM, then you don't need this beta since I haven't added an option yet for enabling/disabling 3D preview.

 

Don't expect much from the 3D preview. AM TerraForm is meant to create a model file that you can open in AM to texture and do so far more quickly than you could model it in AM. AMT isn't meant to be Bryce for AM, MojoWorld for AM, World Builder for AM, World Construction Set for AM, Vue 6 Pro Studio for AM, Terragen for AM, etc. That being said, you can't texture your landscape in AMT in the literal sense. There will be 3 options: Single Color, Vertex Color and Color Map. Single color will let you display the mesh colored with 1 color. Vertex color will display the mesh in colors derived from the color map on the Topographic Map tab. Each pixel of this image represents a vertex that will be colored the same as the pixel. 3 vertices make up a triangle and each triangle in shaded towards the center with the colors of each vertex blending together. The Color Map option simply maps the actual image shown in the Topographic Map tab onto the grid of vertices. Currently, only Vertex Color is available.

 

I have no idea how to fit the mesh to the viewing area; "fit to screen" as it were. I also don't know how to move the model itself around the "world space". I can transform the "world" which makes it look like the model is moving around. Right Arrow key moves to the right, Left Arrow key to the Left, Up Arrow key move up and Down Arrow key moves down. On the Keypad, 8 (Up Arrow) moves away from the viewer, 2 (Down) towards the viewer, 4 (Left) spins to the left around the Y axis, 6 (Right) spins to the right around the Y axis. It appears that DirextX has a transformation matrix and a rotation matrix. They also do not appear to read from each other in "realtime". This makes it awkward to the user to move the landscape around. If move the landscape Down then rotate it, as soon as you click one of the Rotate keys, the landscape snaps back up to it's original Y axis translation before it rotates. Then, if you use the the Up, Down, Left or Right keys, it will snap back to it's last Up, Down, Left or Right translation. I'm still trying to figure this behaviour out.

 

I've gotten several memory-related errors when running this in debugging mode. I cannot understand why. I create 3 items for DirectX - a device, an index buffer and a vertex buffer. All are properly disposed of when AMT closes. After running it a few times in a row, I start getting errors related to the buffers. This might happen several times in a row. I just restart the app each time until it works again. Currently, I have no code written to catch these errors and display a sensible message so you might get some DurectX error messages pop up.

 

For reasons I cannot yet ascertain, ASCII data will not render in three dimensions; you get a flat plane.

 

The Help file has not been updated yet.

 

Download AM TerraForm

Share this post


Link to post
Share on other sites

I've never been particularly happy with my implementation of fBm for creating the random fractal landscape. Besides improving it, I'd like to add other fractal choices. These aren't really important at this point to me but they might be to others. Would adding an option to import RAW data from TerraGen be of interest? It's not like you can't already just open the same RAW data in Photoshop and then save as an image file for use in AM TerraForm, but adding my own RAW import would save the whole Photoshop step.

Share this post


Link to post
Share on other sites

LAST CALL:

 

I haven't gotten any e-mails about any serious bugs/issues. I'm working on adding the other two 3D Preview rendering options, enabling/disabling 3D Preview, DirectX error catching and updating the Help file. These will be finished sometime this week at which point I will consider AM TerraForm to be ready for release so if anyone is experiencing any serious bugs/issues, now is the time to let me know. This forum isn't the place for it though - email me at AM TerraForm.

Share this post


Link to post
Share on other sites

I hope to God that Paypal stuff was on the level!! It looked a little spooky. Also hope you get more donations as this is a great program. Good work!

 

Rusty

Share this post


Link to post
Share on other sites
I hope to God that Paypal stuff was on the level!! It looked a little spooky.

It should be on the level - it's PayPal's own code.

 

this is a great program. Good work!

Thanks!

 

Also hope you get more donations

So do I. :lol:

Share this post


Link to post
Share on other sites

PROGRESS REPORT:

 

Adding in these last few features isn't particularly difficult (except comparing Microsoft's logic to reality!), but it necessitated some new controls and some new options for default settings. Somehow during this process my head became embedded in my south end and I mucked up the code pretty good so I'm reverting back to the previous version and thinking things through a little more before starting over. While I had hoped to have the last beta version available this week, that may not happen until next week. :angry:

Share this post


Link to post
Share on other sites
PROGRESS REPORT:

 

Adding in these last few features isn't particularly difficult (except comparing Microsoft's logic to reality!), but it necessitated some new controls and some new options for default settings. Somehow during this process my head became embedded in my south end and I mucked up the code pretty good so I'm reverting back to the previous version and thinking things through a little more before starting over. While I had hoped to have the last beta version available this week, that may not happen until next week. :angry:

 

Oh that sounds so familiar! I remember one time in DC converting the Federal CU’s DB – we worked around the clock so that they could open on Monday morning… at 4:30 AM that morning the conversion finished – I was tired but decided to run a little program to check their share funds DB… I opened it using ‘mode=1’ instead of ‘mode=2’… so instead of opening & reading, I deleted and created a new file! The manager, an old dude about my age now, literally broke down and cried when I told him.

 

What’s that got to do with this? Nothing. I just felt like telling an old war story.

 

r

Share this post


Link to post
Share on other sites

PROGRESS REPORT:

 

I'm almost ready to upload the final beta except that I cannot get textured vertices to render. So far, no one can tell me why. Realistically, AM TerraForm doesn't really need this option, but I wanted to add it, it should freaking work and it doesn't, so now I'm just going to be a stubborn bastard and sit on the final beta until textured vertices change their attitude.

Share this post


Link to post
Share on other sites

I for one am glad you are so stubborn. Its definitely showing in the quality of your work.

I'm hoping to do some tests on some Oz mountains soon as I find some time to do it.

 

Keep at it Mike!

 

(I still owe you an email... haven't forgot)

Share this post


Link to post
Share on other sites

BETA 6:

 

This will probably be the final beta version. Nothing much has changed except that I have added the option of disabling the 3D preview, switching between multi-colored vertices or single colored and I added some error catching code. I never got texture mapping to work but I did figure out why there was no image rendered at all.

 

As I got down to actually adding the texture, which would have come from the Topographic Map image, I ran into some issues that I decided weren't worth dealing with. The first was that apparently texture maps need to have dimensions in a factor of 2 for some video cards to use them; I don't know how that true that is but it if so, it would have created a lot of code to resize images and then they wouldn't have exactly matched the landscape contours.

 

But the biggest issue was that the 3D Preview is just to give you an idea of what the landscape mesh will look like before you save it and open the model in AM - it will never have the coloration you see in the 3D preview. I like to use large dimensions to get more detail and when I was envisioning the 3D preview when I first started programming AM TerraForm, it was with larger meshes in mind. As I neared completion of the implementation of displaying the 3D Preview using a texture map that was a color version of the image used to create the landscape heights, it suddenly dawned on me that this was incredibly stupid and short-sighted - if someone wanted a smaller 32x32 mesh with a large distance between points, I'd be texturing the mesh with a 33x33 pixel bitmap. It doesn't take a genius to imagine how crappy that would look, so I scrapped the texture mapping option.

 

The final version will just have an updated Help file covering the 3D Preview controls and any code optimizations that I can figure out.

 

Download AM TerraForm

Share this post


Link to post
Share on other sites

You are the man!!! Thanks alot for the hard work!!! Any intrest in coding a terrain shader maybe?...................... hahah just kidding!

Share this post


Link to post
Share on other sites

Would someone post a screencap of what this is all about? The more I read the description the more confused I got.

 

TerraForm = Earth form, as in earth maker? What can it be used for?

Share this post


Link to post
Share on other sites
Would someone post a screencap of what this is all about? The more I read the description the more confused I got.

 

TerraForm = Earth form, as in earth maker? What can it be used for?

Clicking Download AM TerraForm is a good place to start since it takes you to the AM TerraForm web page where there is a description and screen shots.

Share this post


Link to post
Share on other sites
You are the man!!! Thanks alot for the hard work!!! Any intrest in coding a terrain shader maybe?...................... hahah just kidding!

Someone already did. Check out the Toonation "Landscaper" plugin for Materials.

Share this post


Link to post
Share on other sites

I thought I would try and maybe sneak in an entry for the Image Contest, so I fire up the latest beta of AM TerraForm that I uploaded last night and immediately find a couple of problems. So the entry will be set aside for the moment and with a little luck, I might have one more beta uploaded sometime today.

Share this post


Link to post
Share on other sites
I thought I would try and maybe sneak in an entry for the Image Contest, so I fire up the latest beta of AM TerraForm that I uploaded last night and immediately find a couple of problems. So the entry will be set aside for the moment and with a little luck, I might have one more beta uploaded sometime today.

 

Thanks Mike.

Didn't have the time last night that I thought I would to experiment.

For some reason I had to reinstall .NET (perhaps it was never installed on this computer though)

I'm reinstalled and after getting caught up on storyboards and certificates I'll give it a try.

 

If anyone else is experimenting please post!

Share this post


Link to post
Share on other sites

BETA 7:

 

I fixed a couple of issues I ran into today: clicking the Create Terrain button to prep the landscape for saving, and Smoothing a randomly generated landscape didn't update the landscape in the 3D preview window. While I was at it I updated the Help file, the EULA and the website with new screen shots so they reflect the same landscape from start to importing into AM.

 

Download AM TerraForm

Share this post


Link to post
Share on other sites

PROGRESS REPORT:

 

I had planned on releasing v1.0 this weekend, but I got an idea today when I was studying Perlin and Voroni noise. I think I can create a better way than the usual implementation of fBm (not that fBm is a BAD way) to generate a landscape. The major drawback to fBm, to me, is that it's pretty obviously derived from recursive rectangle processing. It's not like I can't "jitter" or "jog" the image to get rid of that, but I think I have a better way altogether. I have no idea if it will work - heck, I don't even know how to program it, but I'm going to play around with it for a few days and if it looks promising, then I'll probably delay the release of v1.0 until I implement this new concept into the code.

Share this post


Link to post
Share on other sites

Just a little feedback here Mike of the Danger Danger Danger type.

 

I attempted to create a randomly generated landscape but it restarted my computer.

Can't afford to do that too much as it takes too long to reboot.

 

Perhaps a word of caution here as whatever I had opened at the time... gone!

Suggest everyone save first before diving in.

 

I'll try again and keep track of what I'm doing when I'm in a position to reboot.

Its quite possible that .NET was not fully installed.

Share this post


Link to post
Share on other sites

This is what I get when I run it.

 

terraformwarning.png

 

A lot of people will wonder why a geometry generating program needs to be a server on the internet, open to incoming connections. :huh:

Share this post


Link to post
Share on other sites
A lot of people will wonder why a geometry generating program needs to be a server on the internet, open to incoming connections. :huh:

I can't do anything about that. AM TerraForm requires .NET 2.0 to be installed. There is absolutely no code that I have included that would access the internet for any reason. I can only assume that Windows itself is attempting to access the internet in order to locate and install .Net 2.0. The best I can do is include something in the installer to alert the user that this may occur.

Share this post


Link to post
Share on other sites
I attempted to create a randomly generated landscape but it restarted my computer.

 

I'll try again and keep track of what I'm doing when I'm in a position to reboot.

It's possible that it's a Stack Overflow error. I get them constantly when I'm debugging, but so far have not gotten one when running an actual installation. Still, that kind of error shouldn't reboot your machine either (As far as I know). I've logged the sections of code where I recieved these errors (all DirectX related!) and added Try/Catch code to shut down AM TerraForm.

Share this post


Link to post
Share on other sites
I think I can create a better way than the usual implementation of fBm (not that fBm is a BAD way) to generate a landscape. I'm going to play around with it for a few days and if it looks promising, then I'll probably delay the release of v1.0 until I implement this new concept into the code.

This thing looks like it's going to work. Essentially, I'm manually creating a fractalesque image rather than simply using an algorithm. I'm starting with random noise, then blurring, tiling and scaling different images recursively and blending them together to form the final image. It's not all that difficult to code, but in order to really be useful, I have to do a lot more coding to allow the user some finesse over what's happening. The question becomes one of how much finesse and how many choices? For example, when tiling images, do I use a factor of, 2, 3, 4 or whatever. Do I let the user decide? If so, where do I set the the limit? I want to give the user as much choice as is reasonable but the trade-off might be slower calculations.

 

What I find amusing is that this is turning out to be almost an entire application itself, not just an option over fBm in AMT. I'm going to have to create a whole new topic in the AMT Help file just so people will know how it works and what they can modify.

Share this post


Link to post
Share on other sites

I was just testing some output from the new height map feature I'm implementing and AMT shut down without warning. So I tried it from the Visual Studio environment debugger and it's stopping exactly where I expected it would but for some reason, even though it's stopping because of an exception, it's NOT displaying the message that is being caught to display. I have no idea why since that is exactly what the Try/Catch statements are for. In any case, if AMT is shutting down on you without warning, it's because it's supposed to shut down after displaying the warning that it's actually not displaying.

Share this post


Link to post
Share on other sites

PROGRESS REPORT:

 

My own idea for creating a fractal image to be used as a height might worked, in so far as creating an image was concerned, but the images created weren't particularly suited to be used for creating landscapes. With some tweaking of the parameters I can get something useful, but it's too process-intensive to be practical - some images took almost 2 hours and that was just to get a 256x256 image. However, I did come up with some ideas for limiting grayscale values that I can implement into the fBm code (and any other fractal code for that matter). This essentially gives the user a lot of control over how many high points/mountainous regions there will be in their landscape.

Share this post


Link to post
Share on other sites
The major drawback to fBm, to me, is that it's pretty obviously derived from recursive rectangle processing.

Perlin have released an improved Noise function that removes some of the "grid" regularity and the new algorithm is also faster. In fBm algorithm the "visible grid" effect can be greatly reduced by using a lacunarity other than 0.5. In fact the user could control the lacunarity to his liking. As for smoothness, this is controled by the "Fractal dimension" which could also be controled by the user.

Share this post


Link to post
Share on other sites
Perlin have released an improved Noise function that removes some of the "grid" regularity and the new algorithm is also faster. In fBm algorithm the "visible grid" effect can be greatly reduced by using a lacunarity other than 0.5. In fact the user could control the lacunarity to his liking. As for smoothness, this is controled by the "Fractal dimension" which could also be controled by the user.

My code uses the classic mid-point subdivision concept. I have no clue on how to add a setting for lacunarity or fractal dimension. I have some examples in C++ and have seen some in Java but even though they show parameters of the functions they are using, they don't show what the user is actually supposed to enter into the GUI that will be passed to the function as a parameter. While I might be able to cobble something together based on copying other's code examples, I wouldn't really be learning anything or understanding exactly what is going on - I prefer understanding what I'm seeing and then writing my functions line by line so that I can modify them along the way.

Share this post


Link to post
Share on other sites

Oh! I thought you already owned the book "Texturing and Modeling: A Procedural Approach". All of that and much much more are explained in that book. A must have IMO for what you are doing. Most of the section on terrain modeling is written by Mr. Musgrave, the guy who wrote Mojo World.

 

When you mentioned that you were combining bitmaps at different scales instead of an fBm function, I thought you were using the fBm as a displacement function for the grid.

Share this post


Link to post
Share on other sites
Oh! I thought you already owned the book "Texturing and Modeling: A Procedural Approach". All of that and much much more are explained in that book. A must have IMO for what you are doing. Most of the section on terrain modeling is written by Mr. Musgrave, the guy who wrote Mojo World.

I do have it. So far, while I get the gist of it, a lot of it is still incomprehensible. I have this function that I haven't attempted to do anything with yet that is an attempt to rewrite the example on page 437 in VB.Net:

 

Public Function fBm(ByVal MyPoint As Double, ByVal H As Double, ByVal Lacunarity As Double, ByVal Octaves As Double) As Double

	Dim Value, Remainder, Noise() As Double
	Dim i As Integer

	Value = 0.0

	For i = 0 To Octaves
		Value += Noise(MyPoint) * Math.Pow(Lacunarity, -H * i)
		MyPoint *= Lacunarity
	Next

	Remainder = Octaves - Int(Octaves)

End Function

 

When you mentioned that you were combining bitmaps at different scales instead of an fBm function, I thought you were using the fBm as a displacement function for the grid.

I was actually trying to do something like this: Cloud Cover

Share this post


Link to post
Share on other sites

This fBm function should work as is, no need to bother with the remainder for now. It already got the lacunarity and Fractal dimansion in it. Next, you need to process the output from this function through a smoothstep (also in the book) function to create spots of clouds and clear sky. Adjusting an offset before the smoothstep will allow adjusting the amount of cloud vs sky. This would still be much simpler than attempting to combine bitmaps.

 

The illustrations on the web page you pointed to is misleading IMO. Actual noise functions are not just simple small squares like that, they extend quite large before releating patterns start to show. The illustrations uses small repeating square pattern only to illustrate the concept of fractal combinations. I don't think the author meant to say that he actually uses scaled bitmaps.

Share this post


Link to post
Share on other sites
This fBm function should work as is, no need to bother with the remainder for now. It already got the lacunarity and Fractal dimansion in it. Next, you need to process the output from this function through a smoothstep (also in the book) function to create spots of clouds and clear sky. Adjusting an offset before the smoothstep will allow adjusting the amount of cloud vs sky. This would still be much simpler than attempting to combine bitmaps.

There's only one problem: I have no idea how to use it. In his example, "point" is a vector; I'm assuming that for a 2D image that it should be a pixel. But what is Value and what do I do with the Noise array?

 

The illustrations on the web page you pointed to is misleading IMO. Actual noise functions are not just simple small squares like that, they extend quite large before releating patterns start to show. The illustrations uses small repeating square pattern only to illustrate the concept of fractal combinations. I don't think the author meant to say that he actually uses scaled bitmaps.

Actually, it works ok. I just used random grayscale values to create the noise starting from pixel 0.0 moving down in the Y direction and left to right in the X direction. Then I smoothed it and used GDI+ graphics functions to scale the image up.

Share this post


Link to post
Share on other sites
There's only one problem: I have no idea how to use it. In his example, "point" is a vector; I'm assuming that for a 2D image that it should be a pixel.
For an image, you would pass a 3D vector but set the z value to some constant. Actually, you could select a different value of Z for ever octave. If you were to build an animated surface, you would increment Z by a small value on each successive frame. But for your terrain generator, you just need to select one constant Z value.

 

But what is Value
"Value" is the value returned by the fBm function. I believe in vbasic, this would be the name of the function "fBm".

 

and what do I do with the Noise array?
Noise is not an array. It is a function. A function that takes a 3D points and returns a value between 0 and 1 (or is it between -1 and 1 ?). You will find the Noise function on pages 344 to 347 in the book and on Ken Perlin' web page. The new and improved Noise function is mentioned but its implementation is not given in the book. However, you can find the Java reference implementation by Ken Perlin. It is a much shorter code and shouldn't be too difficult to translate in basic.

 

I don't think the author meant to say that he actually uses scaled bitmaps.
Actually, the author does use bitmaps. That is because he was doing the fBm fractalization on an old graphics card and he couldn't program procedures on those cards.

Share this post


Link to post
Share on other sites

×