POV-Ray : Newsgroups : povray.unofficial.patches : Direct Ray Tracing of Displacement Mapped Triangles : Re: Direct Ray Tracing of Displacement Mapped Triangles Server Time
1 Jul 2024 02:46:04 EDT (-0400)
  Re: Direct Ray Tracing of Displacement Mapped Triangles  
From: Wolfgang Wieser
Date: 26 Apr 2003 09:59:00
Message: <3eaa90a3@news.povray.org>
>> Ever tried to render a several-million-triangle mesh with POVRay?
> 
> No, but it shouldn't be a huge problem given enough RAM. A few million
> should stay well within the capabilities of 32 bit systems. If memory
> space is restricted, this algorithm could be very useful.
> 
The amount of consumed memory _IS_ the problem. 
Each triangle consumes quite a lot of memory. 
(Rendering 1 million triangles consumes 180 MB RAM, at least that is 
what I just measured.)

>> If you want to trace topography data you run out of memory much faster
>> than you think.
> 
> Why? What makes topography data inherently more memory consuming than
> other meshes?
> 
The problem is that in order to get a nice image of topography data 
it needs to have a very fine grid. Which requires either
- a huge amount of triangles
- an algorithm which adds subdivision surfaces or something similar 
  producing a decent image (the fine details won't be actual totpgraphy 
  but _look_ nice) -- but I repeat myself
- some other trick?

>> Staying at that example, a 1-million-triangle topography of a planet
>> looks not very well unless you add some "artificial" complexity like
>> subdivision surfaces. Or, maybe, something these people described
>> "addition of large amounts of geometric complexity into models".
> 
> This doesn't require doing it at render time, at the expense of CPU time
> that could be used for actual rendering.
>
?! You mean I should buy 256 GigaB RAM?
Furthermore, adding the complexity at render-time will effectively be 
faster because we save such a lot of parse time: 

One million triangles topography data showing the visible half of 
a planet traced at 800x600 full quality, two light sources, no 
anti-aliasing: 

Time For Parse:    0 hours  4 minutes  36.0 seconds (276 seconds)
Time For Trace:    0 hours  0 minutes   9.0 seconds (9 seconds)

That's a ratio 30 : 1 (!)

> Besides, why would you use a 1 million triangle mesh of an entire planet
> when you are close enough to see geometry that can't be represented with
> that mesh?
> 
First of all, there may be reasons: It is hard to know which triangles 
are needed for reflection. (I mean: Ever saw the hollow (culled) back-face 
of a planet on a reflective surface of a space craft?)

And then, maybe you are not aware about how many triangles you need 
for a decent landscape...
Of course, one could use meshes with different grid size for different 
image camera distances which brings other problems (wholes in surface, 
lots of meshes for camera flights). 

The easiest solution for the mentioned problem would be to implement a 
height sphere for POVRay using only 2 bytes per triangle (storing the 
data as 16 bit spherically-mapped height field). 

But the more general solution would be some support for auto-generated 
"artificial" complexity in meshes (added at render time). 

Or, maybe, support for "mesh textures" for primitive objects (i.e. 
height fields on top of sphere, cylinder/cone, torus)

Wolfgang


Post a reply to this message

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