Planetside Software Forums

General => Terragen Discussion => Topic started by: Goms on October 23, 2010, 06:33:57 AM

Title: Another approach to functional city scapes...
Post by: Goms on October 23, 2010, 06:33:57 AM
ok, here we go again.... :D

i'm still trying to get a city-like displacement shader with build-in options only.
what i discovered while playing around with the voronoi function was that you can alter the seed of the noise with a function.
using this, you get pretty random results by first creating random stripes in y direction and use this as seed input for random stripes in x direction.

(http://img806.imageshack.us/img806/8364/41192334.jpg)

and with some conditional functions i could also assign colors to the buildings corresponding to their height:

(http://img525.imageshack.us/img525/854/54967310.jpg)

one of the problems i see in this approach is that you have these very ugly verticals; anyone with a good idea how to get rid of them?
tgd attached
Title: Re: Another approach to functional city scapes...
Post by: Henry Blewer on October 23, 2010, 08:13:46 AM
Could this be put into the Fake Stones Shader?
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 23, 2010, 08:32:12 AM
nah, i dont think so, as the fake stones does not have a seed input. however, you could try to build one. ill try
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 23, 2010, 08:38:12 AM
hm, one sec. what exactly do you mean?
make a fake stones shader like this or just put this into the surface shader input?
this is possible, just adjust the size.
Title: Re: Another approach to functional city scapes...
Post by: inkydigit on October 23, 2010, 10:16:24 AM
thanks Goms, I will check this out..
Title: Re: Another approach to functional city scapes...
Post by: Henry Blewer on October 23, 2010, 01:26:08 PM
Actually the fake stones have a seed. You have the enter the number by hand. But honestly, this is way beyond my skill. :P 8)
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 23, 2010, 01:38:33 PM
Yep, but there is no way to give them an input-seed as the noise functions have.
Title: Re: Another approach to functional city scapes...
Post by: Dune on October 24, 2010, 03:51:11 AM
This is a very interesting method you came up with, Goms! The ugly verticals are of course (?) due to the perpendicularity of the displacement to the planet's surface. What if you slightly tilted the whole area? Only 1 degree or so in 2 directions, and the verticals wouldn't be as vertical anymore. The angle wouldn't really be noticable.
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 24, 2010, 03:55:48 AM
i thought about that too, but was not able to do so yet...
but have an idea: :)
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 24, 2010, 05:26:10 AM
no... what you need is a blur function.
the problem is that the seed rounds automatically....
also just tilling the whole displacement a little bit does not help.

any idea about how to get a blur function in tg2?
smoothing with the compute terrain does not help either.
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 24, 2010, 09:01:00 AM
ok, now each "building" has some space between the next one (see picture below).
i also have a version where every building is a little bit smaller in x and z (what is also great for the colors; more on this later).
the only problem remaining is how to get from one version to another without a sharp step...

ideas, anyone?

(http://img41.imageshack.us/img41/9831/84774213.jpg)
Title: Re: Another approach to functional city scapes...
Post by: Henry Blewer on October 24, 2010, 12:47:50 PM
What if you used the tile method for the buildings? A black and white color patch could be made. This would be used as a mask to stop the vertical displacement in some areas.
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 24, 2010, 12:50:13 PM
hm, tile method? :D
what exactly do you mean by that?
Title: Re: Another approach to functional city scapes...
Post by: Henry Blewer on October 24, 2010, 01:00:18 PM
Well, the city itself is really an array of tiles extruded/displaced vertically. (I am guessing) The same method could be use 2D and somehow this could become the mask to breakup the areas of buildings.
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 24, 2010, 01:40:32 PM
nah, the city is a x-only cell voronoi which seed is altered by a z-only voronoi. ;)

new tgd with shrink function and spaces between buildings attached.
Title: Re: Another approach to functional city scapes...
Post by: Hetzen on October 24, 2010, 02:22:35 PM
Hey Goms, the problem I've found with modulating the seed, is that there is no transition colour range for you to smooth your verticle cut offs. I've attached a clip file that allows you to put a slight slant on your verticles by using a clipped difference voronoi to multiply your cellular voronoi. The steepness is controlled by clipping the white point of the diff voronoi. I know you don't like conditionals, but these here allow higher vallues through.

Anyway, it maybe of some use here.

***Edit*** Just added a TGD file

Cheers

Jon
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 24, 2010, 02:57:23 PM
thx for the input, looks quite interesting!
Title: Re: Another approach to functional city scapes...
Post by: Dune on October 25, 2010, 02:49:07 AM
I love this communal effort!
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 25, 2010, 05:24:45 AM
couldn't get it to work with your file, jon. i think the best would be to use some kind of blur functoin.
i also thought about using two versions, the normal one and the shrinked one, and then merge them by height before displacement, but that wasn't working either.

i tried to figure out a way to make the Gaussian blur function work here, but as my mathematical skills are very basic, i had no success...

maybe one of the planetside staff members has a tip for me? :)

Title: Re: Another approach to functional city scapes...
Post by: Goms on October 25, 2010, 07:46:20 AM
ok, after thinking through this whole problem again, i fear there is no way to accomplish this atm.
The problems are:

- tg2 can't handle the step from 0 to x without something between these two values. therefore the "mesh" gets somehow messed up.

- its not possible, for as far as i know, to blur a fractional function.

- as the displacement shader seems to only work with scalar/color functions, there is no way to manipulate the input values by height, what could help when you use two versions (normal and shrinked) and choose between them by height.

well, its kinda sad as the overall look of this method was the best i could get so far.
but i also learned a bunch of stuff while doing this. :)
Title: Re: Another approach to functional city scapes...
Post by: Hetzen on October 25, 2010, 09:45:22 AM
Goms, I played a little more with my method last night, and had some further thoughts. I think you can get some decent variation, by maybe using difference scaler nodes or adding more of those chains in the .tgd with different seed and then masking between them. I had streets, pavements and grass areas by doing the last of those. Rather than relying on heights, I used the outputs of the conditionals as masks.

A 'Get Average' type node where you select a sample area would be quite usefull to make up a blur function, but I'm not sure it would help much in your case. What you could do, and it would be a bit of work, is comparing a voronoi noise with a spacial offset, then create a ramp between those two values. But I'm not sure if this would work when applied.

Another problem, is that TG really doesn't like sharp linear angles, you would have noticed this 'cracking' effect along your building edges. Unfortunately, if I had to animate something like this, I think it could become a world of hate with disapearing triangles on frame rendering. I would be tempted in using populations, at least I'd have decent textures.

That said, I was trying to make a form of squared rock a while back, which I think some of the techniques in this thread could be very useful, primarily mixing the x and z only cell scalar noises, coupled with the same seed diff scaler to blend, and conditionals to allow the tallest through. You could get some nice cracks and blocks when you apply this to a fractal terrain. But I guess I should reserect that topic rather than spam this one with idle ramblings from me.

Cheers
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 25, 2010, 10:47:01 AM
Regarding cracks, you can indeed use the same method I'm usind here; or at least a very similar one. I will add some more on this later, but essentially you can vary a second level of voronoi noise with the first one; meaning that the crack within a cell are different from the others. Ill post an example later. Sry for briefness, I'm on my blackberry right now. Regards, goms
Title: Re: Another approach to functional city scapes...
Post by: Hetzen on October 25, 2010, 10:59:28 AM
Just been mucking about a little...

A few towers in there, some lighting spots type texture, and streets. Hrm, going to have to play a little more with this.
Title: Re: Another approach to functional city scapes...
Post by: DVA99 on October 25, 2010, 11:09:36 AM
Looks very interesting Goms,

At first glance I'm thinking of a high altitide image of Mogadishu or millions of containers.

I saw something similar in a tutorial made by Daz3studio but, I think this will look better since it's made in Terragen.

Please don't forget to post the final result.
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 25, 2010, 12:03:28 PM
so, here is what i was talking about.
the seed of the smaller noise alters within the cells of the bigger one.
this could be useful for plenty of stuff. :)

@DVA99: i'll try, but as i said before, i don't think my approach is going to lead anywhere atm.

(http://img529.imageshack.us/img529/3145/29175086.jpg)
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 27, 2010, 08:07:58 AM
HARRRRRRRR  ;D ;D ;D ;D ;D ;D ;D

(http://img222.imageshack.us/img222/8219/cityalpha2.jpg)

more on this later
Title: Re: Another approach to functional city scapes...
Post by: rcallicotte on October 27, 2010, 09:18:55 AM
Thanks Goms.  This is cool.
Title: Re: Another approach to functional city scapes...
Post by: Hetzen on October 27, 2010, 10:14:41 AM
Cool. What did you do?
Title: Re: Another approach to functional city scapes...
Post by: Tangled-Universe on October 27, 2010, 10:41:17 AM
With less size variation and a way to make the shapes less straight it would make a very cool rectangular noise-shape.
Title: Re: Another approach to functional city scapes...
Post by: Goms on October 27, 2010, 10:47:14 AM
i did what you suggested before, but kept the seed variation.
just an gamma-changed diff-noise with the same seed, some multiplication, and it works.

see file attached. ;)

@Tangled-Universe:try it. just change the value of the scales and gamma adjustments.
Title: Re: Another approach to functional city scapes...
Post by: Hetzen on October 27, 2010, 10:58:42 AM
Nice one Goms. I'm trying to work out how to mask out some towers.

@Martin, it should be quite easy to just put an add vector in between the get function, and multiply a PF into the add node. I'll try it on Gom's tgd.
Title: Re: Another approach to functional city scapes...
Post by: Volker Harun on January 17, 2011, 06:16:28 PM
These are very fine results, you'll have problems inserting places, parks, broad roads while keeping the buildings look nice.

I tried your way 2 years ago to no avail ... I got very close to some solution but the tuning was so difficult that it was not portable to other scenes.

I am still very busy with real life, but might drive my imagination back to cityscapes ... thanks for the inspiration