POV-Ray : Newsgroups : povray.binaries.images : POVghanistan Revisited! : Re: POVghanistan Revisited! Server Time
19 Apr 2024 23:51:50 EDT (-0400)
  Re: POVghanistan Revisited!  
From: Thomas de Groot
Date: 24 Nov 2019 06:47:11
Message: <5dda6dbf$1@news.povray.org>
Op 24/11/2019 om 11:21 schreef Melody:
> Thomas de Groot <tho### [at] degrootorg> wrote:
> 
>> I shouldn't be too concerned about the dots presently. As Melody also
>> suggests, once you add objects to the scene, especially in the
>> foreground, the dots will become invisible or at least inconspicuous.
>> The foreground texture(s) also will help. All that will be needed
>> additionally to help hide the triangles of course.
>>
>> --
>> Thomas
> 
> calculate normals of each point, respective to all adjacent faces and use smooth
> triangles, lines go bye bye. iterate verts and compare to each triangle face.
> 
> 
> #macro normal_vector(A,B,C)
>   #local result = vcross(C-B,A-B);
>   result
>   // 1
>   // |
>   // 2__ 3 vz points at you (neg) unless reverse y like pov, then
>   //
>   // 2__ 3
>   // |
>   // 1
> #end
> 
> #macro FastNorms77(sw)
>    // set norms based on ALL adjacent faces-lots of verts means lots of time
>    #local i=0;
>    #while (i<NumVertices)
>      #local nrm = <0,0,0>;
>      #local j = 0;
>      #while (j<NumFaces)
>        #if ((i = Face_Arr[j].x)|(i = Face_Arr[j].y)|(i = Face_Arr[j].z))
>          #local norm =
>
normal_vector(V_vec_Arr[Face_Arr[j].x],V_vec_Arr[Face_Arr[j].y],V_vec_Arr[Face_Arr[j].z]);
>          #local nrm = vnormalize(nrm+vnormalize(norm));
>        #end
>        #local j=j+1;
>      #end // Faces
>      #declare N_vec_Arr[i] = nrm;
>      #local i=i+1;
>      #if (sw)  // Progress on/off
>          #if (mod(100*i/NumVertices,20)<0.1)
>            #debug concat("Checking Normals  >
> ",str(int(100*i/NumVertices),5,1),"%\n")
>         #end
>      #end
>    #end // Verts
> #end
> 
> 
> 
> 
I think smooth triangles are already in use in this scene and lines 
appear because of the height_field size close to the camera. However, 
your macros are worth to be tried out here, I guess, to see if it 
improves the image.

-- 
Thomas


Post a reply to this message

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