|
eigenbom
|
 |
« Reply #45 on: May 10, 2012, 02:20:23 PM » |
|
i seem to recall that ridge multifractal made the terrain rough on mountains and smooth on plains (as shown in the second pic) ... but here's some tips: - Why don't you first update your rendering code to render the terrain solid and smooth. I can't really see what's going on (have wireframe, solid, smooth, and smooth+wireframe modes). - then just try as rivon suggests. you should see big hills with smaller scale detail. the trick is to scale the amplitude too. See e.g., the NOISE(x) function here.
|
|
|
|
|
Logged
|
|
|
|
|
Hedgehodg
|
 |
« Reply #46 on: May 11, 2012, 01:05:42 AM » |
|
When you say "subdivide it" do you mean I do it on my tessellating quad? Or can I do this straight on a height-map? So for each iteration of the quad I apply it's parent's height-map to itself? O_o And I added the functionality to swap between wire-frame and solid, the problem is you can't really see the different in height (no lighting) so I guess I'll have to implement very basic lighting in order to be able to differentiate between different heights...
|
|
|
|
|
Logged
|
Previously known as "darestium"...
|
|
|
|
rivon
|
 |
« Reply #47 on: May 11, 2012, 04:11:44 AM » |
|
I would do something like generate the first big terrain, subdivide it. Generate another 4 heightmaps and add them with some scale modifier (height(x, y) * 0.4) to the four smaller parts. Repeat... If you know what I mean.
|
|
|
|
|
Logged
|
|
|
|
|
nikki
|
 |
« Reply #48 on: May 11, 2012, 02:56:43 PM » |
|
Maybe slightly off topic but what are good methods to look into for creating rivers in a world thats created with noise(x,y,z)?
can't really find anything particular about it
|
|
|
|
|
Logged
|
|
|
|
|
eigenbom
|
 |
« Reply #49 on: May 11, 2012, 03:18:21 PM » |
|
yeh you'll need to turn lighting on, and also the vertex normals so they shaded properly. just try to do it slowly and methodically.  Maybe slightly off topic but what are good methods to look into for creating rivers in a world thats created with noise(x,y,z)?
can't really find anything particular about it
i'm not sure, but my guess is that there isn't really a nice explicit function for believable rivers. i guess if i were to do it, i'd just write a 'river' generator that drops a point in the map and then travels down stream "carving" out the river along the way...
|
|
|
|
|
Logged
|
|
|
|
|
nikki
|
 |
« Reply #50 on: May 11, 2012, 03:26:52 PM » |
|
but when 'chunks' are generated dynamically -on request it could just as be be an upstream location that's generated later then the downstream place, so there is no carving along the way ?
|
|
|
|
|
Logged
|
|
|
|
|
Hedgehodg
|
 |
« Reply #51 on: May 11, 2012, 08:45:21 PM » |
|
Okay, my attempt at lighting (top view). So now just play with the noise functions and continue to wait for the book to arrive?  Now, back to Super meat boy :D
|
|
|
|
|
Logged
|
Previously known as "darestium"...
|
|
|
|
eigenbom
|
 |
« Reply #52 on: May 11, 2012, 09:31:36 PM » |
|
but when 'chunks' are generated dynamically -on request it could just as be be an upstream location that's generated later then the downstream place, so there is no carving along the way ?
ha hah, yes, you're right. it's a tricky problem. i'm sure you could hack a local noise(x,y,z)-like solution to generating channels that look like rivers. But I think a more realistic solution like the one i proposed means that chunks are no longer independent. in this case you could do a rough pass of lower res terrain to get the global structure of the river network. Okay, my attempt at lighting (top view). So now just play with the noise functions and continue to wait for the book to arrive?
great work! But let's have an isometric view. Yes, keep playing around with it. Try to get a feel for what noise is actually doing. Do some summed fractal noise .. it should be like noise, but "rougher" ... function summed_fractal_noise(x,y) val = 0 for i=0 to 3 do scale = pow(2,i) val += noise(x*scale,y*scale)/scale end return val end
|
|
|
|
|
Logged
|
|
|
|
|
Hedgehodg
|
 |
« Reply #53 on: May 12, 2012, 01:03:08 AM » |
|
Wow! That function is awesome - super rough (using summed perlin noise):  public static float NoiseSummed(double x, double y) { float val = 0; double scale = 0;
for (int i = 0; i < 3; i++) { scale = Math.Pow(2, i);
val += (float)Noise(x * scale, y * scale, 0) / 2; }
return val; }
By isometric do you simply mean rotated 45 degrees? or with a isometric projection?
|
|
|
|
|
Logged
|
Previously known as "darestium"...
|
|
|
|
eigenbom
|
 |
« Reply #54 on: May 12, 2012, 03:48:02 PM » |
|
That code is wrong in an important way... val += (float)Noise(x * scale, y * scale, 0) / 2;
should be val += (float)Noise(x * scale, y * scale, 0) / scale;
because you want to make each new term in the sum contribute less to the shape of the terrain. In English ... you make big hills with i=0, then smaller hills on those hills with i=1, then even smaller hills on those hills, etc.. And yeh, i just meant a view-point that is looking down at an angle. It's hard to see what's going on looking straight down. something like that: 
|
|
|
|
|
Logged
|
|
|
|
|
Hedgehodg
|
 |
« Reply #55 on: May 12, 2012, 04:53:30 PM » |
|
Okay, I fixed the code up and moved the camera and it's target...  Yup, I think that makes sense; the larger the scale the smaller the hill.
|
|
|
|
|
Logged
|
Previously known as "darestium"...
|
|
|
|
eigenbom
|
 |
« Reply #56 on: May 12, 2012, 05:01:16 PM » |
|
looks good, but it still doesn't look correct ... turn the for loop into the following.. const int LEVELS = 3; for (int i = 0; i < LEVELS; i++) { ... }
then render (and post) images for different LEVELS values, e.g., LEVELS = 1, LEVELS = 2, LEVELS = 3, ... at levels=1 you want just a couple of hills in your terrain
|
|
|
|
|
Logged
|
|
|
|
|
Hedgehodg
|
 |
« Reply #57 on: May 12, 2012, 05:46:07 PM » |
|
The screenshot in the previous post had a height-map with a sized of 600x600 Level 1 (100x100 sized height-map):  Level 2 (100x100 sized height-map):  Level 3 (100x100 sized height-map): 
|
|
|
|
|
Logged
|
Previously known as "darestium"...
|
|
|
|
eigenbom
|
 |
« Reply #58 on: May 12, 2012, 09:09:17 PM » |
|
Yeh that looks correct, so the scale and everything looks alright. Now increase the terrain resolution and the number of LEVELS, maybe 1000x1000 verts and 8 LEVELS?
After that the next step is either to implement ridged multifractal noise, which should give you much more 'realistic' terrain..
|
|
|
|
|
Logged
|
|
|
|
|
Hedgehodg
|
 |
« Reply #59 on: May 12, 2012, 09:54:29 PM » |
|
There is one problem according to this runtime error: XNA Framework HiDef profile supports a maximum of 1048575 primitives per draw call, so I'll have to split the terrain into sections and render then individually if I want to get more then 1048575 primitives... The maximum I could get to (rounded to the nearest 100) is 700x700. 700x700, 8 Levels: 
|
|
|
|
|
Logged
|
Previously known as "darestium"...
|
|
|
|