 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2012-10-16 14:19, Samuel Benge wrote:
> A simple "gradient z" will not work because it doesn't contain any topographical
> information describing your landscape. The macro requires a height map, so
> you'll need to produce one from East_Land4 and then pass it to the macro. (You
> might even be able to use it for a height_field object instead of that union of
> objects you have now, but I'm not sure, since I don't know how your scene is set
> up.)
>
> Once you have your height_map, you'll be going forward again. If not, just give
> me a holler :)
Well, a little bit of progress, but something's obviously not right...
Here's what I've got now, with tamrielheightsmall.png being a straight
height-gradient render.
box{
<-7200,-4800,-0.1>,< 7200, 4800, 0.1>
#declare InputPigment = pigment{
image_pattern{ png "c:\downloads\tamrielheightsmall.png" }
rotate z*180
translate <-0.5, -0.5, 0.0>
scale <1,0.8,1>
}
pigment{
Pg_Elevation_Lines( InputPigment, 8, 2, 32, 0, off )
pigment_map{ [ 0 InputPigment][ 1 rgb x] }
}
finish{ ambient 1 diffuse 0 }
}
...and this is what it comes out as. (there's some weird noise at the
top and bottom that's there even with just using InputPigment as the
pigment, and the contour lines are all noisy)
Post a reply to this message
Attachments:
Download 'tamriel flat.png' (485 KB)
Preview of image 'tamriel flat.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tim Cook <z99### [at] gmail com> wrote:
> Well, a little bit of progress, but something's obviously not right...
>
> Here's what I've got now, with tamrielheightsmall.png being a straight
> height-gradient render.
>
<snip>
> ...and this is what it comes out as. (there's some weird noise at the
> top and bottom that's there even with just using InputPigment as the
> pigment, and the contour lines are all noisy)
Alright, after scratching my head for a while I've determined that the problem
is with your height data. I zoomed up on an unlined portion of your image and
saw a lot of noise; rendered it with Pg_Elevation_Lines, and got similar results
as yours.
So to get rid of the noise, try one of these options:
1) Open the height map in Gimp, and apply the Despeckle filter using its default
settings. Unfortunately, Gimp does not (yet!) support 16-bit grayscale.
-or-
2) Render your height map in POV-Ray using these command line options: +fng +f
+a0.01 +am2 +r3 This seems to be more accurate than Gimp's Depseckle filter,
although POV-Ray still cannot match the gamma of the original image, so
calculating the proper line spacing and offset with Pg_Elevation_Lines might
prove difficult.
Other program options include PhotoShop, Terragen, Wilbur, or any other program
that can manipulate 16-bit height maps.
Since I was unable to render your entire height map, I cannot say for certain if
the noise reduction techniques I tried would completely get rid of all the
artifacts, so you may need to tweak some settings here and there (interpolating
the image in POV-Ray comes to mind).
Sam
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2012-10-17 16:06, Samuel Benge wrote:
> Alright, after scratching my head for a while I've determined that the problem
> is with your height data. I zoomed up on an unlined portion of your image and
> saw a lot of noise; rendered it with Pg_Elevation_Lines, and got similar results
> as yours.
Hmm...I ran the height image through despeckle and a few blurs just now,
and it's not changing the amount of noise artifacts with the contour
lines...? Hmm.
--
Tim Cook
http://empyrean.sjcook.com
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2012-10-17 17:13, Tim Cook wrote:
> Hmm...I ran the height image through despeckle and a few blurs just now,
> and it's not changing the amount of noise artifacts with the contour
> lines...? Hmm.
Ah wait. If I run the original height map through POV using your
suggested settings it cleans up a lot...bit of an interesting result,
though.
Still noisy in places, hmm. Ok, using a lower number for +a increases
the noise...
Here's the render with +a0.05 +am2 +r4 and the function called with 20
lines, 1.05 width, 32 quality.
--
Tim Cook
http://empyrean.sjcook.com
Post a reply to this message
Attachments:
Download 'tamriel flat.png' (476 KB)
Preview of image 'tamriel flat.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tim Cook <z99### [at] gmail com> wrote:
> On 2012-10-17 16:06, Samuel Benge wrote:
> > Alright, after scratching my head for a while I've determined that the problem
> > is with your height data. I zoomed up on an unlined portion of your image and
> > saw a lot of noise; rendered it with Pg_Elevation_Lines, and got similar results
> > as yours.
>
> Hmm...I ran the height image through despeckle and a few blurs just now,
> and it's not changing the amount of noise artifacts with the contour
> lines...? Hmm.
Hmm, it should have at least helped.
I was wrong about POV-Ray not mapping the gamma correctly: it does. Also, when
trying to re-render the height map in POV, you need to use "interpolate 2" in
addition to high AA settings.
Try the attached. It's just a simple blur filter, but it works for the tiny
portion I cropped from your image.
Failing that, try the blur/resample file a posted a while back:
http://news.povray.org/povray.text.scene-files/thread/%3C4d34c72d@news.povray.org%3E/?ttop=372491
You might want to render your map at 2x resolution with a decent amount of blur
(2-6), and scale it back down to its original size.
If none of that works, would you mind posting your entire height map so I can
figure out what's going wrong?
Post a reply to this message
Attachments:
Download 'blendpixelsb.pov.txt' (1 KB)
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ah! A problem your macro doesn't take into account (not sure how it
would, either, but who knows?) is that of depressions, where a given
contour line loop isn't an ascending hill, but a shallower area. On the
other image I'd rendered, they're easy to spot because the fade is on
the outside rather than the inside, so can be marked appropriately when
redrawing everything by hand.
--
Tim Cook
http://empyrean.sjcook.com
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2012-10-17 17:33, Samuel Benge wrote:
> If none of that works, would you mind posting your entire height map so I can
> figure out what's going wrong?
The original height map I rendered at 7200x4800, so it's a 2.4 MB png,
here's the reduced-size version. (Ehm, re-rendered...oh hey, I had
jitter 'on' in the antialiasing options there, that might've been
contributing to the noise level, let's see what it turns out with that
off.) *waits*
Here we go.
--
Tim Cook
http://empyrean.sjcook.com
Post a reply to this message
Attachments:
Download 'tamrielheightsmall.png' (302 KB)
Preview of image 'tamrielheightsmall.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
And I get slightly different results when I pipe the original east or
west rendering into the macro.
I think Paint Shop Pro is not doing a very good job at maintaining PNG
fidelity when I combine the two halves. Blarg.
Maybe paint.net will be better.
--
Tim Cook
http://empyrean.sjcook.com
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tim Cook <z99### [at] gmail com> wrote:
> On 2012-10-17 17:33, Samuel Benge wrote:
> > If none of that works, would you mind posting your entire height map so I can
> > figure out what's going wrong?
>
> The original height map I rendered at 7200x4800, so it's a 2.4 MB png,
> here's the reduced-size version. (Ehm, re-rendered...oh hey, I had
> jitter 'on' in the antialiasing options there, that might've been
> contributing to the noise level, let's see what it turns out with that
> off.) *waits*
>
> Here we go.
Thanks, I'll see how it works out over here.
I noticed that your map uses elements of varying resolutions. Some parts are
sharp, while others are quite pixelated. That could be a big source of your
problems. AFAICT, noise reduction schemes assume that the noise is at or near
the pixel level (ie. sudden changes occur from one pixel to the next). If abrupt
changes occur over several pixels, you're going to have problems trying to
smooth things out.
There must be a magnification filter somewhere that can smooth the transitions,
like some sort of HQNx filter for height maps.
> Ah! A problem your macro doesn't take into account (not sure how it
> would, either, but who knows?) is that of depressions, where a given
> contour line loop isn't an ascending hill, but a shallower area.
It should. The attached render uses a converted and eroded digital elevation
model of Morongo Valley, CA (elevation lines were arbitrarily chosen). Near the
far upper right you can just make out an irregular depression ringed by a blue
line. Depressions in the desert aren't easy to come by--all the water flows down
hills and ravines--and consequently that is the only one I have found on this
particular map so far.
My macro takes everything literally, so a line is just as likely to loop around
a depression as it is a hill, it's just that depressions are less common and
might be missed if the spacing is too wide.
Post a reply to this message
Attachments:
Download 'mv-topo.jpg' (272 KB)
Preview of image 'mv-topo.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Samuel Benge" <stb### [at] hotmail com> wrote:
> Tim Cook <z99### [at] gmail com> wrote:
> > The original height map I rendered at 7200x4800, so it's a 2.4 MB png,
> > here's the reduced-size version.
>
> Thanks, I'll see how it works out over here.
Attached is an image combining contour lines from "tamrielheightsmall.png"
superimposed onto your relief map. The lines seem to behaving themselves. Is
this anywhere near what you wanted? I sure hope I haven't sent you on a wild
goose chase!
Here's the POV scene used to trace it:
// +fn +f +a0.1 +am2 +r3 +w1600 +h1067
#version 3.7;
global_settings{assumed_gamma 1.0}
#default{ finish{ ambient 1 } }
camera{
orthographic
right x*2 up y*2
location -z
look_at 0
}
#macro Pg_Elevation_Lines(PgInput, NLines, LineSize, Quality, LineOffs,
LineSmoothing)
#local Quality = max(1, int(Quality*LineSize));
#macro SampleLoop(Param)
max(
0
#for(N, 1, Quality)
#local C = 1/Quality*N;
#local R = pow(C*sqrt(N)/pow(Quality,.5),1/3);
#local Angle = N*137.508;
#local Pt = vrotate(y*R, z*Angle);
#local PtX = Pt.x*LineSizeX;
#local PtY = Pt.y*LineSizeY;
#if(Param)
, (1-R*LineSmoothing)*(1-FInput(x+PtX, y+PtY, 0))
#else
, (1-R*LineSmoothing)*FInput(x+PtX, y+PtY, 0)
#end
#end
)
#end
#local FInput =
function{
pattern{
pigment_pattern{
PgInput
phase 1-LineOffs/2
frequency NLines/2
color_map{
[.5 rgb 0]
[.5 rgb 1]
}
}
}
}
pigment_pattern{
#local LineSizeX = LineSize/image_width;
#local LineSizeY = LineSize/image_height;
function{
SampleLoop(1)*(FInput(x, y, 0)=1)
+
SampleLoop(0)*(FInput(x, y, 0)=0)
}
cubic_wave
warp{planar}
}
#end // Pg_Elevation_Lines
// map relief
plane{
z, 1
pigment{
average
pigment_map{
[.5 rgb 1]
[1
image_map{
"skyrim shaded relief low.jpg"
interpolate 2
}
scale 2
translate -1
]
}
}
}
// contour lines overlay
plane{z, 0
#declare InputPigment =
pigment{
image_pattern{
"tamrielheightsmall.png"
interpolate 2
}
scale 2
translate -1
}
pigment{
#declare NLines = 11;
Pg_Elevation_Lines( InputPigment, NLines, 3, 8, 0, off )
pigment_map{
[0
Pg_Elevation_Lines( InputPigment, NLines*5, 1.5, 8, 0, off)
pigment_map{
[0 rgb 0 transmit 1]
[1 rgb 0 transmit .5]
}
]
[1 rgb 0 transmit .5]
}
}
}
Post a reply to this message
Attachments:
Download 'tamriel-contours.jpg' (344 KB)
Preview of image 'tamriel-contours.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |