POV-Ray : Newsgroups : povray.general : Smooth normals for mesh2 objects : Re: Smooth normals for mesh2 objects Server Time
29 Jul 2024 06:27:55 EDT (-0400)
  Re: Smooth normals for mesh2 objects  
From: David Given
Date: 7 Dec 2013 13:29:20
Message: <52a36900$1@news.povray.org>
On 07/12/13 18:18, Le_Forgeron wrote:
[...]
> It would be fine for a pigment (evaluation of some points only, when
> intersection spot them), but not with a set of triangles which must all
> be tested for intersection against all rays.

I'm mainly thinking of pigments --- I have (well, used to have) several
user functions which used pigments as big lookup tables. But it would
also be useful for huge meshes. Even if you have to touch every element,
having a big array of floats or doubles in a memory mapped file is still
going to be better than parsing them out of a text file.

> mmap is not portable (different code for Windows).

boost::memory_mapped_source hides all the platform details. It makes
mapping a file literally two lines of code.

[...]
> 2. would every data be individually visible (at least have such potential) ?

Depends where I put the camera.

Since I'm rendering a planet, then obviously a maximum of half the
dataset will be visible at any one time. The further down the camera is,
then the smaller the subset of the data. But again, one of the
advantages of using a memory mapped file is that I don't have to worry
about this. Only the data that actually gets accessed is loaded into
memory (and then persists to subsequent runs).

-- 
┌─── dg@cowlark.com ─────
http://www.cowlark.com ─────
│ "There does not now, nor will there ever, exist a programming
│ language in which it is the least bit hard to write bad programs." ---
│ Flon's Axiom


Post a reply to this message

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