POV-Ray : Newsgroups : povray.binaries.images : city building generator WIP Server Time
28 Dec 2024 21:24:59 EST (-0500)
  city building generator WIP (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From: Kenneth
Subject: city building generator WIP
Date: 21 Jul 2017 15:10:01
Message: <web.59724f15a32fe9a2883fb31c0@news.povray.org>
I've been working on a 'city building generator'-- part of my earlier post re:
'green gas cloud.' I put aside the media cloud for now...

Currently, the buildings are just randomly placed. I've made no attempt to put
them into a 'street grid' yet. (Perhaps real-world real-estate prices will be so
high in the future that buildings will NEED to be overlapped by economic
necessity, ha!)

The buildings' facades and windows are from photos I got off the 'net-- then
re-worked in Photoshop to be small 'tiles' that can be repeated. Then I took the
same tiles and made 'reflection hold-out mattes', for the windows themselves.
(That took a lot of manual labor.) The two different images are combined in the
many textures' image_pattern {...} blocks, so that reflections only show up in
the glass windows. The 'image_pattern' feature is great for creating 'texture
masks'.

The photo tiles (I've used only eleven so far, randomly repeated) are all in
different shapes and resolutions. I *could* have re-made them to be the same rez
and shape (more or less) in PS-- but it was more fun to write SDL code to take
care of that, using 3.7xx's new max_extent feature for finding the X/Y rez of an
image.

Applying image_maps to all four sides of a box shape would seem to be a simple
procedure (and it is, if that's all that's required.) But I decided to 'enclose'
the image tiles in POV-Ray's 'boxed' pattern-- to create a thin 'concrete
outline' around the (four) faces of each building, with a larger one at the top.
I didn't want the buildings' window images to go all the way to the side edges;
that would look odd and unrealistic. This extra step took most of the coding
effort-- making sure that it worked at all building scales, while also keeping
all the buildings' windows at the SAME relative scale. (Obviously, each floor of
each building should be the same height!)

I made an interesting discovery with the windows: The raw photos already showed
natural reflections there-- which didn't look correct when applying 'extra'
reflection in POV-Ray. In real life, windows in buildings are very dark (when
NOT reflecting anything) because the room interiors behind them are dark,
*compared to* the buildings' bright sunlit exteriors. SO, I had to darken the
window areas in all the photos to remove that reflected look, then add it back
in in POV-ray.

Instead of using real photos for this, it would be interesting
to try and create some sort of 'window/facade' generator, using procedural
textures in POV-Ray instead. As a guess, it might be done with a combination of
the 'boxed' pattern, the 'cells' pattern, and warp{repeat...} in some kind of
combination, along with random variations of all the elements. (BTW, I haven't
yet looked at any of the building generator .inc files or macros that are
available; I first wanted to see how far I could go, before I needed help!)

Still to do: Figuring out a way for each building's width and height to be
strict multiples of its image_map tile size-- so that a building's edge doesn't
end in the middle of a window! (Which is currently what happens, as the
buildings are just randomly sized.) I may have to rewrite a good chunk of my
code to do that :-/

Another way to make a building would be with *heightfields* for the faces, to
show their natural 3-D appearance (balconies, recessed windows, etc.) I'm
working on that too-- I've already made HF image_maps from most of the image
tiles-- but it's a tedious Photoshop procedure (and involves rewriting my
code yet again.)


Post a reply to this message


Attachments:
Download 'buildings 1 kenw.png' (1686 KB)

Preview of image 'buildings 1 kenw.png'
buildings 1 kenw.png


 

From: Bald Eagle
Subject: Re: city building generator WIP
Date: 21 Jul 2017 17:00:00
Message: <web.59726a89164bd7b0c437ac910@news.povray.org>
Really, REALLY nice work, Kenneth!

"Still to do: Figuring out a way for each building's width and height to be
strict multiples of its image_map tile size--"

select and mod (a, B) ?

Check out some of the code in
http://dataduppedings.no/subcube/POV-Ray/Isosurface-Cubic_Space_Division.txt

Good luck!   Looking _good_.


Post a reply to this message

From: omniverse
Subject: Re: city building generator WIP
Date: 22 Jul 2017 01:00:00
Message: <web.5972db3e164bd7b09c5d6c810@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> Currently, the buildings are just randomly placed. I've made no attempt to put
> them into a 'street grid' yet. (Perhaps real-world real-estate prices will be so
> high in the future that buildings will NEED to be overlapped by economic
> necessity, ha!)

Impressive none-the-less. I was thinking about the Spider-Man movie (what CGI
movie haven't I seen?!) as I looked at your city. Movie magic could do wonders
with this already, just by showing only a few moments in motion. Not sure how
many people would notice there aren't streets if only from this diagonal view.

> The buildings' facades and windows are from photos I got off the 'net-- then
> re-worked in Photoshop to be small 'tiles' that can be repeated. Then I took the
> same tiles and made 'reflection hold-out mattes', for the windows themselves.
> (That took a lot of manual labor.) The two different images are combined in the
> many textures' image_pattern {...} blocks, so that reflections only show up in
> the glass windows. The 'image_pattern' feature is great for creating 'texture
> masks'.

Effective.

> The photo tiles (I've used only eleven so far, randomly repeated) are all in
> different shapes and resolutions. I *could* have re-made them to be the same rez
> and shape (more or less) in PS-- but it was more fun to write SDL code to take
> care of that, using 3.7xx's new max_extent feature for finding the X/Y rez of an
> image.
>
> Applying image_maps to all four sides of a box shape would seem to be a simple
> procedure (and it is, if that's all that's required.) But I decided to 'enclose'
> the image tiles in POV-Ray's 'boxed' pattern-- to create a thin 'concrete
> outline' around the (four) faces of each building, with a larger one at the top.
> I didn't want the buildings' window images to go all the way to the side edges;
> that would look odd and unrealistic. This extra step took most of the coding
> effort-- making sure that it worked at all building scales, while also keeping
> all the buildings' windows at the SAME relative scale. (Obviously, each floor of
> each building should be the same height!)

Heh. Did I notice that until you said? Nope.  ;) Again, I glance over these type
of images and eventually look more, but I know there's going to be something
amiss if I look long enough at anything like this. Well, usually anyhow.
Main thing I was seeing was the cleanliness of the outer tops, especially
compared to the interior of roofs.

> I made an interesting discovery with the windows: The raw photos already showed
> natural reflections there-- which didn't look correct when applying 'extra'
> reflection in POV-Ray. In real life, windows in buildings are very dark (when
> NOT reflecting anything) because the room interiors behind them are dark,
> *compared to* the buildings' bright sunlit exteriors. SO, I had to darken the
> window areas in all the photos to remove that reflected look, then add it back
> in in POV-ray.
>
> Instead of using real photos for this, it would be interesting
> to try and create some sort of 'window/facade' generator, using procedural
> textures in POV-Ray instead. As a guess, it might be done with a combination of
> the 'boxed' pattern, the 'cells' pattern, and warp{repeat...} in some kind of
> combination, along with random variations of all the elements. (BTW, I haven't
> yet looked at any of the building generator .inc files or macros that are
> available; I first wanted to see how far I could go, before I needed help!)
>
> Still to do: Figuring out a way for each building's width and height to be
> strict multiples of its image_map tile size-- so that a building's edge doesn't
> end in the middle of a window! (Which is currently what happens, as the
> buildings are just randomly sized.) I may have to rewrite a good chunk of my
> code to do that :-/
>
> Another way to make a building would be with *heightfields* for the faces, to
> show their natural 3-D appearance (balconies, recessed windows, etc.) I'm
> working on that too-- I've already made HF image_maps from most of the image
> tiles-- but it's a tedious Photoshop procedure (and involves rewriting my
> code yet again.)

If the result does well maybe it will be worthwhile!
^^ says me LOL

Bob


Post a reply to this message

From: Thomas de Groot
Subject: Re: city building generator WIP
Date: 22 Jul 2017 02:44:48
Message: <5972f460$1@news.povray.org>
On 21-7-2017 21:05, Kenneth wrote:
> I've been working on a 'city building generator'-- part of my earlier post re:
> 'green gas cloud.' I put aside the media cloud for now...
> 

That is really excellent! Good work and looking forward to the next stage.

-- 
Thomas


Post a reply to this message

From: Simon J  Cambridge
Subject: Re: city building generator WIP
Date: 22 Jul 2017 16:05:00
Message: <web.5973af26164bd7b0a5a417320@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> I've been working on a 'city building generator'-- part of my earlier post re:
> 'green gas cloud.' I put aside the media cloud for now...
>
> Currently, the buildings are just randomly placed. I've made no attempt to put
> them into a 'street grid' yet. (Perhaps real-world real-estate prices will be so
> high in the future that buildings will NEED to be overlapped by economic
> necessity, ha!)
>
> The buildings' facades and windows are from photos I got off the 'net-- then
> re-worked in Photoshop to be small 'tiles' that can be repeated. Then I took the
> same tiles and made 'reflection hold-out mattes', for the windows themselves.
> (That took a lot of manual labor.) The two different images are combined in the
> many textures' image_pattern {...} blocks, so that reflections only show up in
> the glass windows. The 'image_pattern' feature is great for creating 'texture
> masks'.
>
> The photo tiles (I've used only eleven so far, randomly repeated) are all in
> different shapes and resolutions. I *could* have re-made them to be the same rez
> and shape (more or less) in PS-- but it was more fun to write SDL code to take
> care of that, using 3.7xx's new max_extent feature for finding the X/Y rez of an
> image.
>
> Applying image_maps to all four sides of a box shape would seem to be a simple
> procedure (and it is, if that's all that's required.) But I decided to 'enclose'
> the image tiles in POV-Ray's 'boxed' pattern-- to create a thin 'concrete
> outline' around the (four) faces of each building, with a larger one at the top.
> I didn't want the buildings' window images to go all the way to the side edges;
> that would look odd and unrealistic. This extra step took most of the coding
> effort-- making sure that it worked at all building scales, while also keeping
> all the buildings' windows at the SAME relative scale. (Obviously, each floor of
> each building should be the same height!)
>
> I made an interesting discovery with the windows: The raw photos already showed
> natural reflections there-- which didn't look correct when applying 'extra'
> reflection in POV-Ray. In real life, windows in buildings are very dark (when
> NOT reflecting anything) because the room interiors behind them are dark,
> *compared to* the buildings' bright sunlit exteriors. SO, I had to darken the
> window areas in all the photos to remove that reflected look, then add it back
> in in POV-ray.
>
> Instead of using real photos for this, it would be interesting
> to try and create some sort of 'window/facade' generator, using procedural
> textures in POV-Ray instead. As a guess, it might be done with a combination of
> the 'boxed' pattern, the 'cells' pattern, and warp{repeat...} in some kind of
> combination, along with random variations of all the elements. (BTW, I haven't
> yet looked at any of the building generator .inc files or macros that are
> available; I first wanted to see how far I could go, before I needed help!)
>
> Still to do: Figuring out a way for each building's width and height to be
> strict multiples of its image_map tile size-- so that a building's edge doesn't
> end in the middle of a window! (Which is currently what happens, as the
> buildings are just randomly sized.) I may have to rewrite a good chunk of my
> code to do that :-/
>
> Another way to make a building would be with *heightfields* for the faces, to
> show their natural 3-D appearance (balconies, recessed windows, etc.) I'm
> working on that too-- I've already made HF image_maps from most of the image
> tiles-- but it's a tedious Photoshop procedure (and involves rewriting my
> code yet again.)

I really like it, and I will be really interested to see what you come up with
using heightfields.

I have tried to do this (on and off) but was never satisfied with the result.
The only efforts I did like were ones where the results were viewed from a
distance (at night, in fog, in outline, with focal blur and the camera pointing
in the opposite direction).

I have tried the cell pattern with mild turbulence (<= 0.1) and it can be made
to work at a distance. Up close I have only ever used it for flagstones. I have
also tried a variety of brick textures, but again was only ever satisfied with
them at a distance.

Cheers,

Simon.


Post a reply to this message

From: Kenneth
Subject: Re: city building generator WIP
Date: 22 Jul 2017 18:30:01
Message: <web.5973d156164bd7b0883fb31c0@news.povray.org>
"omniverse" <omn### [at] charternet> wrote:
>
> Main thing I was seeing was the cleanliness of the outer tops, especially
> compared to the interior of roofs.
>

Fixed!

I also added some 'rain stains' under the windows, of the two most prominent
buildings in the attached image.

Currently, the buildings look too 'clean'. I'd *like* to add some overall subtle
stains to the structural faces of the buildings-- but not to the glass windows.
And that presents a practical problem, of how to go about it (due to the TILED
nature of the window images.) Simply painting stains onto particular areas of
the image tiles would end up looking too 'regular' and repetitive. The stains
need to be larger and more random (like overlaying a subtle bump pigment onto
the entire building face-- minus windows!)

Hmm, I need to give this some thought...


Post a reply to this message


Attachments:
Download 'buildings 2 kenw.png' (1373 KB)

Preview of image 'buildings 2 kenw.png'
buildings 2 kenw.png


 

From: Thomas de Groot
Subject: Re: city building generator WIP
Date: 23 Jul 2017 03:04:04
Message: <59744a64$1@news.povray.org>
On 23-7-2017 0:27, Kenneth wrote:
> "omniverse" <omn### [at] charternet> wrote:
>>
>> Main thing I was seeing was the cleanliness of the outer tops, especially
>> compared to the interior of roofs.
>>
> 
> Fixed!
> 
> I also added some 'rain stains' under the windows, of the two most prominent
> buildings in the attached image.
> 
> Currently, the buildings look too 'clean'. I'd *like* to add some overall subtle
> stains to the structural faces of the buildings-- but not to the glass windows.
> And that presents a practical problem, of how to go about it (due to the TILED
> nature of the window images.) Simply painting stains onto particular areas of
> the image tiles would end up looking too 'regular' and repetitive. The stains
> need to be larger and more random (like overlaying a subtle bump pigment onto
> the entire building face-- minus windows!)
> 
> Hmm, I need to give this some thought...
> 
Too exclude the window areas you would need a (for instance) black/white 
image alongside each tile and use the eval_pigment() test to exclude the 
window areas.

-- 
Thomas


Post a reply to this message

From: omniverse
Subject: Re: city building generator WIP
Date: 23 Jul 2017 04:55:01
Message: <web.597463e6164bd7b09c5d6c810@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "omniverse" <omn### [at] charternet> wrote:
> >
> > Main thing I was seeing was the cleanliness of the outer tops, especially
> > compared to the interior of roofs.
>
> Fixed!
>
> I also added some 'rain stains' under the windows, of the two most prominent
> buildings in the attached image.

Looks good! Of course, now I see the things you were talking about before,
overlapped buildings and windows on corners. All because of the closer look.
Amazing what size does to details. Probably helps that I use only a smartphone
or 15" notebook. LOL

> Currently, the buildings look too 'clean'. I'd *like* to add some overall subtle
> stains to the structural faces of the buildings-- but not to the glass windows.
> And that presents a practical problem, of how to go about it (due to the TILED
> nature of the window images.) Simply painting stains onto particular areas of
> the image tiles would end up looking too 'regular' and repetitive. The stains
> need to be larger and more random (like overlaying a subtle bump pigment onto
> the entire building face-- minus windows!)
>
> Hmm, I need to give this some thought...

I sure wouldn't be too concerned about repetition; city buildings are
themselves, more often than not, are like a series of sameness all over. Yet
again, that would be probably be about size and amount of details visible I
guess.
Keep thinking anyhow, always fun to create.

Bob


Post a reply to this message

From: Kenneth
Subject: Re: city building generator WIP
Date: 23 Jul 2017 06:20:00
Message: <web.59747750164bd7b0883fb31c0@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
>
> To exclude the window areas you would need a (for instance) black/white
> image alongside each tile and use the eval_pigment() test to exclude the
> window areas.
>

That sounds intriguing. Although, I'm not quite sure how to go about it, in this
case. Each building's face is actually a single squashed-and-stretched 'boxed'
pattern (with the window image tiles 'inside the box', and repeated.) And the
windows' reflection 'hold-out matte(s)' are just black-and-white masks-- but the
same size as the small image tiles. Just thinking out loud: For the eval_pigment
trick to work as I imagine, the final FULL boxed pattern would need to be
evaluated pixel by pixel, then another (larger) black-and-white 'holdout matte'
generated from that, to be used as the hold-out for the additional overall
'dirt' texture on the entire building face.(?) But I'm not sure how to actually
*generate* such an image, pixel by pixel. The only time I've ever done something
like that was to assign a tiny flat box to each evaluated pixel! Thousands of
tiny boxes, in other words, in a grid. I've never created an actual *single*
IMAGE that way.

The bigger *main* problem I'm currently running into is that 'patterned
textures' cannot have additional overlayed textures applied to them. (I'm
currently using texture{boxed{texture_map{...}}  and  texture{image_pattern...}
to create the building faces-- both(?) of which are considered 'patterened'
textures.) I haven't yet found a way to work around this limitation... and have
had to write some rather inelegant code just to get the buildings into their
current state!


Post a reply to this message

From: Thomas de Groot
Subject: Re: city building generator WIP
Date: 23 Jul 2017 07:15:58
Message: <5974856e$1@news.povray.org>
On 23-7-2017 12:15, Kenneth wrote:
> Thomas de Groot <tho### [at] degrootorg> wrote:
>>
>> To exclude the window areas you would need a (for instance) black/white
>> image alongside each tile and use the eval_pigment() test to exclude the
>> window areas.
>>
> 
> That sounds intriguing. Although, I'm not quite sure how to go about it, in this
> case. Each building's face is actually a single squashed-and-stretched 'boxed'
> pattern (with the window image tiles 'inside the box', and repeated.) And the
> windows' reflection 'hold-out matte(s)' are just black-and-white masks-- but the
> same size as the small image tiles. Just thinking out loud: For the eval_pigment
> trick to work as I imagine, the final FULL boxed pattern would need to be
> evaluated pixel by pixel, then another (larger) black-and-white 'holdout matte'
> generated from that, to be used as the hold-out for the additional overall
> 'dirt' texture on the entire building face.(?) But I'm not sure how to actually
> *generate* such an image, pixel by pixel. The only time I've ever done something
> like that was to assign a tiny flat box to each evaluated pixel! Thousands of
> tiny boxes, in other words, in a grid. I've never created an actual *single*
> IMAGE that way.

Hmmmm... I may have been a bit fast in my answering. I need to think a 
bit about this. I am sure it can be done somehow.

> 
> The bigger *main* problem I'm currently running into is that 'patterned
> textures' cannot have additional overlayed textures applied to them. (I'm
> currently using texture{boxed{texture_map{...}}  and  texture{image_pattern...}
> to create the building faces-- both(?) of which are considered 'patterened'
> textures.) I haven't yet found a way to work around this limitation... and have
> had to write some rather inelegant code just to get the buildings into their
> current state!
> 
> 

yes, that is a huge hurdle. I have to browse through my files to see if 
something I did in the past might be relevant. I have that nagging 
feeling...

-- 
Thomas


Post a reply to this message

Goto Latest 10 Messages Next 8 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.