sprockets Live Answer Time Demo Tinkering Gnome's Sparkler PRJ Shelton's new Char: Hans It's just donuts by ItsJustMe 3D Printing Free model: USS Midnight Rodger Reynolds' 1950s Street Car
sprockets
Recent Posts | Unread Content
Jump to content
Hash, Inc. - Animation:Master

MSFlynn

Craftsman/Mentor
  • Posts

    193
  • Joined

  • Last visited

Posts posted by MSFlynn

  1. 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.

  2. 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

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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

  11. 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.

  12. 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

  13. 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.

  14. 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:

  15. 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.

  16. 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.

  17. 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

  18. 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.

  19. 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.

×
×
  • Create New...