Planetside Software Forums

General => Terragen Discussion => Topic started by: skarlath on September 19, 2012, 08:35:57 AM

Title: 1x1m world generation
Post by: skarlath on September 19, 2012, 08:35:57 AM
Doing a minecraft video for someone and is there some function you could create that would make the world out of 1x1m  blocks, so still having the shape of mountains and all but just out of blocks?
Title: Re: 1x1m world generation
Post by: Tangled-Universe on September 19, 2012, 08:51:33 AM
Interesting question :)

I think what you would need is a lowish resolution heigtfield and try to disable the interpolation for it.
A 512x512 pixel heightfield on a 512x512m terrain should give you 1m square blocks if no type of interpolation and smoothing is performed on it.

I'm not exactly sure how to do it, but I'm interested to see if it's possible once I'm back home from work.
Title: Re: 1x1m world generation
Post by: dandelO on September 19, 2012, 04:21:45 PM
Damn! I always wanted a voxel sculptor to render within TG2, imagine how cool that would be.

To add to TU's answer, using 'stepped' as the interpolation method in a heightfield would help to this effect, I'd think. I made this with the stepped interpolation option (http://www.planetside.co.uk/forums/index.php?topic=7278.msg77556#msg77556), the pyramid terrain was originally a flat heightfield. I don't know if there's a way(maybe compute terrain's 'patch size'?) to adjust the interpolation step scale...

* Sometimes I noticed the stepped interpolation method caused an app'crash when the 3D preview tried to draw it, would be interesting to see if it still does that or if it's been fixed.

** I'd also disable 'fractal detail' in any heightfields using it. Then you'll get the real shape of your terrain.
Title: Re: 1x1m world generation
Post by: skarlath on September 19, 2012, 08:17:46 PM
this is what stepped gets me. looks a bit odd, and why does tg2 hate vertical faces?
Title: Re: 1x1m world generation
Post by: Kadri on September 19, 2012, 08:23:24 PM

You could use image maps too.
The smaller the image map is the more pixelleted-blocky result you get.
Uncheck the "Smooth disp interpolation" box in the "Image map shader" "Displacement" tab.

Or you could use a pixelate effect on your image maps (maybe with just a little blur added) and use your big-normal textures etc.

You can play additionally with the "Compute terrain" node settings too.

[attachimg=1]


[attachimg=2]


[attachimg=3]



Or you could try it with a real cubic object population:

[attachimg=4]


Title: Re: 1x1m world generation
Post by: Kadri on September 19, 2012, 08:26:48 PM

I saw your post now. What did you use skarlath ?
"Bluring your image map" was for  that too much vertical look.
Title: Re: 1x1m world generation
Post by: skarlath on September 19, 2012, 09:41:04 PM
i wasnt using an image map it was a height field gen with interpolation on stepped
Title: Re: 1x1m world generation
Post by: dandelO on September 20, 2012, 12:17:40 PM
No luck with the stepped method then. I just thought it might have been a good base to go from since TU mentioned the interpolation methods in a heightfield shader.

Kadri has it, I think. You could make a top-down ortho render of the greyscale image of your terrain by using 'shade by height' in the heightfield shader. Disable the following base colours node and anything that follows them in the meantime. Also disable shadows and GI for this render, place the Sun at 90 degree elevation.
Then use Kadri's image map method on that as your base heightfield. Use 'plan Y' and give it the same size/coord's as the old terrain had.
Title: Re: 1x1m world generation
Post by: Hetzen on September 21, 2012, 01:03:33 PM
TG doesn't surface 90 degree planes, so you have to cheat it a little, by putting in a slight slant. Saying that, Kadri's cube object population would probably give you the best results, as hard displacements tend to crack at corners.

Here's something I was playing with using modulo set at 100m in x,y,z, which warped a PF to create a 100m chequred patern that used the grey value to displace verticly. The edges are smoothed using the same modulo output to drive a half cycle sine curve which is compressed into a square shape with a gain shader and clamped with a colour adjust, this is used to multiply the chequred output to give the sides a gradient to avoid the 90 texture stretch.

The windows use the same function to create the towers, but this time set to a modulo distance of 10m.
Title: Re: 1x1m world generation
Post by: j meyer on September 22, 2012, 10:54:54 AM
Could you please show a node view,too,Jon?
Title: Re: 1x1m world generation
Post by: Hetzen on September 22, 2012, 05:52:18 PM
Quote from: j meyer on September 22, 2012, 10:54:54 AM
Could you please show a node view,too,Jon?

I think I'd rather put this in a tutorial on greyscales to be honest. It's not very optimal at the moment. This took a while to render, with bucket errors.

Title: Re: 1x1m world generation
Post by: j meyer on September 23, 2012, 11:01:41 AM
Ok.  Anyway,a promising approach,should be great in conjunction with
the other procedural city examples.
I especially like the smoothed corners.
Title: Re: 1x1m world generation
Post by: bobbystahr on October 05, 2012, 10:55:20 AM
This is such a cool thread I've enabled notify....way t go folks....
Title: Re: 1x1m world generation
Post by: TheBlackHole on October 07, 2012, 07:51:56 PM
I would load a Minecraft map into jmc2obj and import the mesh into TG2. Then add light sources wherever needed, such as near glowstone, torches, lava, etc.
Title: Re: 1x1m world generation
Post by: mhaze on October 10, 2012, 05:39:19 AM
Brilliant!  This technique could be useful for as variety of uses so a tut would be handy.