POV-Ray : Newsgroups : povray.advanced-users : Heightfield problem Server Time
27 Nov 2024 02:51:46 EST (-0500)
  Heightfield problem (Message 1 to 10 of 24)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Lars
Subject: Heightfield problem
Date: 16 Feb 2002 13:47:14
Message: <MPG.16d84912e546d13b989680@news.povray.org>
Help!

I'm working with a large height field object, rendered at very very high 
resolution and am coming across a strange artifact when I enable smooth.  
Basically, I see darkened boxes instead of a smooth shading (I'm also 
losing a lot of detail).  

I've got enough resolution in my height field source image, as the 
terrain is reasonably well contoured and the non smoothed image doesn't 
show large jaggies.  (although it shows serious stepping, making it 
unusable).  

Anyone have any suggestions on what might be going on, solutions or 
workarounds?  Am I hitting some upper limit in significant digits or 
precision, or is this related to the normal flipping issue in 
heightfields?

I've tried generating a mesh from the source bitmap image using Wilbur, 
but that took a LONG time to parse and couldn't ever get the same level 
of detail as the heightfield.   It also didn't make proper normals, so 
it was faceted.  I've tried different formats for the source image, with 
no change.

here's a jpg of the effect:
http://home.pacbell.net/selmo/smooth.jpg

and the same image without smoothing:
http://home.pacbell.net/selmo/no_smooth.jpg

I'm using POV 3.5 windows beta 11. 

It's a 16bit 5000x5000 pixel TIFF source image for the height field, 
rendered at 20K x 10K pixels.  (yes, I've got good reasons for needing 
such high res.  :)   I've tried disabling the shadow in case it was the 
normal-edge issue, but that didn't help either.

height_field
{
  tiff "topo.tif"
  scale < 1.0 , 0.02 , 1.0 >     
  smooth     
  no_shadow
  texture
          {
           finish {specular 0.15 roughness 0.8 crand 0.10 }
           pigment
            {          
	           White 
            }
                     
        }  
}    

Help!

Thanks
Lars


Post a reply to this message

From: Warp
Subject: Re: Heightfield problem
Date: 16 Feb 2002 14:05:08
Message: <3c6ead64@news.povray.org>
The very first thing you should try is to use double_illuminate to see if
it's the known problem about normal inversion (although it doesn't seem so).

  If it's not that, then it *might* be that your color depth is not high
enough with respect to the resolution of the image. Even though you say
that you are generating a 16-bit image, it just might be that the program
you are using to generate the heightfield image just uses 256 different
heights (which can be very insufficient with such high pixel resolution).

  If nothing helps, just try making your heightfield image with lower
pixel resolution.
  The algorithm POV-Ray uses for calculating the normal vectors (which I
think is just the regular average-the-normals-of-adjacent-triangles) is
not perfect and causes bad shading in some cases.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Lars
Subject: Re: Heightfield problem
Date: 17 Feb 2002 08:25:43
Message: <MPG.16d94f35c187afe989681@news.povray.org>
>   The very first thing you should try is to use double_illuminate to see if
> it's the known problem about normal inversion (although it doesn't seem so).
I tried that, but it didn't change anything, so I guess it's not the HF 
normal flipping problem.

> >   If it's not that, then it *might* be that your color depth is not high
> enough with respect to the resolution of the image. Even though you say
> that you are generating a 16-bit image, it just might be that the program
> you are using to generate the heightfield image just uses 256 different
> heights (which can be very insufficient with such high pixel resolution).

I'm guessing that probably wouldn't change the boxing effect I see in 
smoothed images, but that might help with trying to get the non smoothed 
image looking less stepped.  That's what I've been trying to do  
recently, but I am having problems finding a good image processing tool 
that can handle 16bit grayscale images.  I've been taking an 1000 x 1000 
8bit image (TGA converted from a DEM) and upscaling it to 5K x 5K, 
allowing Photoshop to do bicubic interpolation to create the additional 
16bit data between the original 8 bit image source pixels.  However, 
this obviously wouldn't create a truly smooth gradation since the delta 
is only a few pixels, so I'm probably seeing 500-1000 levels of gray 
instead of the full 16 bit range.  If I could get a smooth or blur 
operation on the 16bit data, I might get less stepping and hence get 
something usable.  

Any recommendations on good tools to smooth and manipulate 16bit 
grayscale images under win2000?  Photoshop is quite limited in it's 
16bit handling, and I'm not having any luck with Wilbur--it seems to 
produce a lot of empty images and lose data.  HLA didn't run under 
windows 2000.


> >   If nothing helps, just try making your heightfield image with lower
> pixel resolution.

yah, that makes correspondingly larger squares.  :)  I'm trying a few 
other tricks so see if I can figure out what's going on, including 
seeing if I can get a smoother 16bit terrain image souce.  Any other 
suggestions would be appreciated.

Thanks
Lars


Post a reply to this message

From: John Haiducek
Subject: Re: Heightfield problem
Date: 17 Feb 2002 09:48:20
Message: <3C6FC2B4.3000401@umich.edu>
> I've been taking an 1000 x 1000 8bit image (TGA converted from a DEM) 


Have you tried dem2pov? I haven't used it but it might give you better 
than 8bit height resolution.

John Haiducek


Post a reply to this message

From: Ken
Subject: Re: Heightfield problem
Date: 17 Feb 2002 10:07:13
Message: <3C6FC70E.72D721D4@pacbell.net>
Lars wrote:

> Any recommendations on good tools to smooth and manipulate 16bit
> grayscale images under win2000?  Photoshop is quite limited in it's
> 16bit handling, and I'm not having any luck with Wilbur--it seems to
> produce a lot of empty images and lose data.  HLA didn't run under
> windows 2000.

Have you looked at Leveller? - http://www.daylongraphics.com/

-- 
Ken Tyler


Post a reply to this message

From: Christoph Hormann
Subject: Re: Heightfield problem
Date: 17 Feb 2002 10:22:00
Message: <3C6FCA97.51D31352@gmx.de>
Lars wrote:
> 
> [...]
> I'm guessing that probably wouldn't change the boxing effect I see in
> smoothed images, but that might help with trying to get the non smoothed
> image looking less stepped.  That's what I've been trying to do
> recently, but I am having problems finding a good image processing tool
> that can handle 16bit grayscale images.  I've been taking an 1000 x 1000
> 8bit image (TGA converted from a DEM) and upscaling it to 5K x 5K,
> allowing Photoshop to do bicubic interpolation to create the additional
> 16bit data between the original 8 bit image source pixels.  

There are various types of so-called 'DEM' data formats which need
different conversion programs.  A lot of them are in a quite simple ASCII
form, but some are more complicated.  Nearly all are 16 bit data in the
original so the 8 bit you get are probably result of the conversion.  

> Any recommendations on good tools to smooth and manipulate 16bit
> grayscale images under win2000?  Photoshop is quite limited in it's
> 16bit handling, and I'm not having any luck with Wilbur--it seems to
> produce a lot of empty images and lose data.  HLA didn't run under
> windows 2000.

gforge/HF-Lab should compile with Cygwin without problems.  

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 06 Feb. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Lars
Subject: Re: Heightfield problem
Date: 17 Feb 2002 10:29:05
Message: <MPG.16d96c209cb4c61b989682@news.povray.org>
> Have you looked at Leveller? - http://www.daylongraphics.com/

I downloaded the demo and played with it for a bit, and honestly 
couldn't figure too much out!  :)  The cost was an issue for me, so I 
didn't look at it too seriously, but I'll look at it a bit further if 
you think it will work.  

> Have you tried dem2pov? 

I haven't--I'll look into it.  I used a DEM->TGA converter to begin 
with, but I do need to edit the files after they are converted from 
DEM--move features around, adjust them, add new features, etc.  So I 
need some way to edit them once they become 16bit files.  (editing them 
in 8 bit and then trying to convert them to 16bit after is what I was 
doing, but I've been running into the smoothness / stepping issue).  
Many of the DEM converters didn't look like an option for me, since I 
wouldn't have any way to manipulate the data afterwards.

I saw a couple more programs on the povray.org site, but many were dead 
links--earthscape, klevel, smooth, etc.  :(   If I can't find something 
that exists already, I might just write my own 8 to 16 bit converter 
with smoothing.  Or maybe set up a DOS box to run HLA.  

It sounds like the consensus so far is that I should attack this from 
the trying to get a smooth 16bit image angle and not use the heightfield 
smooth function.  None of my experiments to date have suceeded in 
getting the smooth function to work without the boxes effect in some 
degree.


Post a reply to this message

From: Lars
Subject: Re: Heightfield problem
Date: 17 Feb 2002 10:36:39
Message: <MPG.16d96dd9f17b4247989683@news.povray.org>
> There are various types of so-called 'DEM' data formats which need
> different conversion programs.  A lot of them are in a quite simple ASCII
> form, but some are more complicated.  Nearly all are 16 bit data in the
> original so the 8 bit you get are probably result of the conversion.  

I'm having to deliberately convert them to 8 bit, since that's the only 
way I have of editing them after I convert them.  If I had image editing 
software that could read and manipulate 16bit grayscale images, I'd 
start from there and probably not have the problem at all.  But so far, 
I've been unable to find anything that can manipulate 16bit grayscale 
images.  I tried UTSCSA's ImageTool 2.0, but it can't handle the large 
file sizes needed.

So the lack of a 16bit image editor is the reason why I have to go to 8 
bit, edit, then convert to 16, using bicubic interpolation while 
increasing the pixel scale to smooth out the results.  But it's not 
smoothing enough.  So I need something that can either edit the 16bit 
images, or at least run a good smoothing algorithm on the converted 
16bit image.

I'm assuming that if I could get the full dynamic range of 16bit 
grayscale, my stepping issue should go away.  If not, well, then I'm 
back to the drawing board.


Post a reply to this message

From: Lars
Subject: Re: Heightfield problem
Date: 18 Feb 2002 18:44:55
Message: <MPG.16db31d28d1977d6989684@news.povray.org>
Thanks for the suggestions so far.  

I've been able to create a full depth, smoothed 16bit test image for the 
heightfield.  Unfortunately, even with 16bits, the stepping remains 
quite noticable.  I've got many many more steps than before, but they 
don't blend and remain quite clear.  The edges of each change in 
elevation are highlighted and it looks like a million slug trails over 
the landscape--or maybe those architectural models where they make hills 
from layers and layers of flatboard.  I think the problem lies in the 
terrain is mostly flat, with subtle slow changes in elevation causing 
the stepping.  Plus it doesn't seem to smooth between to areas, instead 
making a dimensional bump between two values.  Places with more 
pronounced altitude changes don't look as bad.  So I think 16bit 
elevation data has failed to solve the problem.  It appears I need to 
find a way to get smooth to behave, or find a different approach.

Using Heightfield "Smooth" tends to produce a more muddied look-- it 
appears as if there are only three levels of lighting--dark, med and 
light with no gradation between them.  It looks very posterized.  It's 
almost as if the normals are quantized and only allowing for three 
levels of specular lighting effect.  Plus the boxes problem remains 
(which might be related--more gradations might make the boxes harder to 
notice).   I've tried changing my scale factor, in case it was a 
precision issue, but no change.  

Anyone have any further ideas on heightfield smooth?

Thanks
Lars


Post a reply to this message

From: Warp
Subject: Re: Heightfield problem
Date: 18 Feb 2002 19:19:12
Message: <3c719a00@news.povray.org>
In povray.general Lars <sel### [at] pacbellnet> wrote:
: Anyone have any further ideas on heightfield smooth?

  Did you try with a lower resolution? For example divide width and height
by 10. (You don't have to use it; just try it to see what happens).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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