|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Is there a way to get Povray to automatically calculate smoothed normals
for a mesh2?
I'm generating huge meshes from an external procedural terrain
generator. The generator assumes that the renderer doesn't need explicit
normals, so not only does it not write them but it lacks the
functionality internally to go from a vertex to the facets containing
the vertex. So adding support for calculating smoothed normals is going
to be non-trivial.
Most other renderers I've looked at have an option to do this
automatically. Does Povray?
--
┌─── 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
David Given <dg### [at] cowlarkcom> wrote:
> Is there a way to get Povray to automatically calculate smoothed normals
> for a mesh2?
Currently, no.
(Such a feature might be added in the future, either as a direct feature,
or by enhancing the language so that it could be easily written as a
script.)
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 06/12/2013 15:09, Warp a écrit :
> David Given <dg### [at] cowlarkcom> wrote:
>> Is there a way to get Povray to automatically calculate smoothed normals
>> for a mesh2?
>
> Currently, no.
And the real tricky question is: how do you weight the various normals
at a vertex ?
So far I came with at least 4 different ways.
And for information: mesh2 is only a syntax, mesh & mesh2 are the same
internal object inside povray.
(yet, mesh2 is parsed much faster when it becomes long)
>
> (Such a feature might be added in the future, either as a direct feature,
Done as a direct feature: smooth{...}
Illustration at:
http://wiki.povray.org/content/User:Le_Forgeron#smooth
Source code at:
https://bitbucket.org/LeForgeron/hgpovray
> or by enhancing the language so that it could be easily written as a
> script.)
>
--
Just because nobody complains does not mean all parachutes are perfect.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 06.12.2013 14:26, schrieb David Given:
> Is there a way to get Povray to automatically calculate smoothed normals
> for a mesh2?
>
> I'm generating huge meshes from an external procedural terrain
> generator. The generator assumes that the renderer doesn't need explicit
> normals, so not only does it not write them but it lacks the
> functionality internally to go from a vertex to the facets containing
> the vertex. So adding support for calculating smoothed normals is going
> to be non-trivial.
POV-Ray has essentially the same problem: While it does know which
vertices belong to a given facet, it would need an exhaustive search of
the facets list to figure out which faces meet at a given vertex.
One thing you might do is first render the non-smoothed mesh in an
orthographic scene with a gradient pattern applied, giving you a height
map image; you can then feed that image into a smoothed height field.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le_Forgeron <lef### [at] freefr> wrote:
> And the real tricky question is: how do you weight the various normals
> at a vertex ?
> So far I came with at least 4 different ways.
Well, the most common way is that, for each vertex, you take the normal
vectors of all the triangles that share that vertex, and calculate their
weighted average, the weight factor being the area of the triangle.
(This works better than just a regular average because it gives a smoother
result with meshes containing triangles of very differing sizes.)
Of course mesh models often contain sharp edges. It's naturally impossible
to know which edges are supposed to be sharp and which smooth because that
information is lost, but the algorithm can make an educated guess by
simply considering the edge between two triangles to be sharp if the
angle between the normals of those triangles is larger than a threshold
(which can be user-specified.)
Vertices at sharp edges/corners naturally require for two or more normals
to be created (one for each set of triangles that's on one side of the
sharp edge.)
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka <ano### [at] anonymousorg> wrote:
> POV-Ray has essentially the same problem: While it does know which
> vertices belong to a given facet, it would need an exhaustive search of
> the facets list to figure out which faces meet at a given vertex.
Well how did the subdivision patch do it, then? As I recall it was very fast, at
both subdivision and automatically calculating vertex normals. (I really miss
that patch!)
Sam
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
David Given <dg### [at] cowlarkcom> wrote:
> Is there a way to get Povray to automatically calculate smoothed normals
> for a mesh2?
>
> I'm generating huge meshes from an external procedural terrain
> generator. The generator assumes that the renderer doesn't need explicit
> normals, so not only does it not write them but it lacks the
> functionality internally to go from a vertex to the facets containing
> the vertex. So adding support for calculating smoothed normals is going
> to be non-trivial.
>
> Most other renderers I've looked at have an option to do this
> automatically. Does Povray?
>
If the mesh can be saved as obj and is not to large than PoseRay may be an
option to (re)calculate normals and save the object as pov-source. PoseRay
provides some options to calculate the normals and you have a preview. But IIRC
the grid can not be to large.
Best regards,
Micahel
Post a reply to this message
|
|
| |
| |
|
|
From: Jaime Vives Piqueres
Subject: Re: Smooth normals for mesh2 objects
Date: 6 Dec 2013 14:39:06
Message: <52a227da@news.povray.org>
|
|
|
| |
| |
|
|
> David Given <dg### [at] cowlarkcom> wrote:
>> Is there a way to get Povray to automatically calculate smoothed normals
>> for a mesh2?
>>
> If the mesh can be saved as obj and is not to large than PoseRay may be an
> option to (re)calculate normals and save the object as pov-source. PoseRay
> provides some options to calculate the normals and you have a preview. But IIRC
> the grid can not be to large.
>
IIRC, Poseray will even take a mesh2 in POV-Ray format...
--
jaime
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 06.12.2013 19:12, schrieb Samuel Benge:
> clipka <ano### [at] anonymousorg> wrote:
>> POV-Ray has essentially the same problem: While it does know which
>> vertices belong to a given facet, it would need an exhaustive search of
>> the facets list to figure out which faces meet at a given vertex.
>
> Well how did the subdivision patch do it, then? As I recall it was very fast, at
> both subdivision and automatically calculating vertex normals. (I really miss
> that patch!)
I don't know that patch in detail, but it might have added extra data
structures to keep track of the information required.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 06/12/13 16:44, clipka wrote:
[...]
> One thing you might do is first render the non-smoothed mesh in an
> orthographic scene with a gradient pattern applied, giving you a height
> map image; you can then feed that image into a smoothed height field.
I'm modelling entire planets, which are unfortunately round, so the
heightfield primitive isn't much use to me. I've previously been using
isosurfaces but they're just too horrifically painfully slow,
particularly if I want to avoid render artifacts. Going for a polygon
mesh is a new improved system to try and avoid all that.
One day someone's going to come up with a way of storing efficient,
interpolatable spherical heightmap data without the distortion involved
in forcing it into a 2D matrix...
--
┌─── 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
|
|
| |
| |
|
|
|
|
| |