POV-Ray : Newsgroups : povray.advanced-users : LDraw user needs POV help Server Time
5 May 2024 06:46:41 EDT (-0400)
  LDraw user needs POV help (Message 11 to 17 of 17)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: clipka
Subject: Re: LDraw user needs POV help
Date: 19 Nov 2016 18:10:13
Message: <5830dbd5$1@news.povray.org>
Am 19.11.2016 um 01:20 schrieb Roland Melkert:

>> That said, maybe I can add a switch to layered textures in POV-Ray that
>> would cause the alpha channel of a layer to knock out not only that
>> layer's diffuse component, but also highlights and reflection. I guess
>> such a switch might come in handy for non-LDraw users as well.
> That would be very helpful especially when coming from an OpenGL background.

Done. If you like to test-drive the extension, have a look at this version:

https://github.com/POV-Ray/povray/releases/tag/v3.7.1-x.knockout.8881807

The syntax isn't finalized yet.


Post a reply to this message

From: Roland Melkert
Subject: Re: LDraw user needs POV help
Date: 21 Nov 2016 15:55:01
Message: <web.58335ef8a94cadc5369a059c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 19.11.2016 um 01:20 schrieb Roland Melkert:
>
> >> That said, maybe I can add a switch to layered textures in POV-Ray that
> >> would cause the alpha channel of a layer to knock out not only that
> >> layer's diffuse component, but also highlights and reflection. I guess
> >> such a switch might come in handy for non-LDraw users as well.
> > That would be very helpful especially when coming from an OpenGL background.
>
> Done. If you like to test-drive the extension, have a look at this version:
>
> https://github.com/POV-Ray/povray/releases/tag/v3.7.1-x.knockout.8881807
>
> The syntax isn't finalized yet.
use_alpha on on the 2nd texture's finish seems to work great, no more double
ambient/reflection exposure for the transparent part of the image.

This prevents having to generate different textures for transparent or non
transparent png's. It also improves the overall surface as the non transparent
parts now use the finish block of the image_map pigment while all transparent
pixels use the one from the lower rgb pigment. This results in even surface
behavior.

Will this be added for the normal block too?


Thanks for implementing this test.


I used it like so:

#macro ldrawTexPlastic(ldCode, pngIdx)

 #local doPng=(pngIdx>=0);
 #local idx=getColorIndex(ldCode);
 #local r=ldColor[idx][1];
 #local g=ldColor[idx][2];
 #local b=ldColor[idx][3];
 #local a=ldColor[idx][4];

 #local basePigment=
   pigment {

    #if (a<1.0)
     srgbft <r,g,b, 0.85, 0.2>
    #else
     srgb <r,g,b>
    #end
   }
  ;

 #local baseNormal=
  normal {
   bumps 0.005
   scale 0.5
   turbulence 0
  }
 ;

 #macro fin(ua)
   diffuse 1
   brilliance 1
   conserve_energy

   specular albedo 0.6
   roughness 0.02

   reflection 0.15

   #if (ua)
     use_alpha on
   #end
 #end

 #local baseFinish=finish { fin(false) }

 #if (doPng)
   #local pngPigment=
    pigment {
     uv_mapping
     image_map {
      png getPngName(pngIdx)
      map_type 0
      interpolate 2
     }
    }
  ;

  #local pngFinish=finish { fin(true) }

  #local result=
    texture {
     pigment { basePigment }
     normal { baseNormal }
     finish { baseFinish }
    }
    texture {
     pigment { pngPigment }
     normal { baseNormal }
     finish { pngFinish }
    }
   ;
   result
 #else
   pigment { basePigment }
   normal { baseNormal }
   finish { baseFinish }
 #end
#end


Post a reply to this message

From: clipka
Subject: Re: LDraw user needs POV help
Date: 21 Nov 2016 16:08:53
Message: <58336265@news.povray.org>
Am 21.11.2016 um 21:54 schrieb Roland Melkert:

> use_alpha on on the 2nd texture's finish seems to work great, no more double
> ambient/reflection exposure for the transparent part of the image.
> 
> This prevents having to generate different textures for transparent or non
> transparent png's. It also improves the overall surface as the non transparent
> parts now use the finish block of the image_map pigment while all transparent
> pixels use the one from the lower rgb pigment. This results in even surface
> behavior.
> 
> Will this be added for the normal block too?

With the diffuse, highlights and reflection all knocked out, how could
normals still be bothering you?


Post a reply to this message

From: Roland Melkert
Subject: Re: LDraw user needs POV help
Date: 21 Nov 2016 17:45:00
Message: <web.5833787ca94cadc5369a059c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> With the diffuse, highlights and reflection all knocked out, how could
> normals still be bothering you?
I was thinking e.g. dents could still be applied twice on the transparent
portions?


Post a reply to this message

From: clipka
Subject: Re: LDraw user needs POV help
Date: 21 Nov 2016 18:00:17
Message: <58337c81$1@news.povray.org>
Am 21.11.2016 um 23:43 schrieb Roland Melkert:
> clipka <ano### [at] anonymousorg> wrote:
>> With the diffuse, highlights and reflection all knocked out, how could
>> normals still be bothering you?
> I was thinking e.g. dents could still be applied twice on the transparent
> portions?

No; surface normal perturbations only affect the corresponding layer;
and they only become visible by how they affect diffuse, highlights and
reflections of that layer.


Post a reply to this message

From: William F Pokorny
Subject: Re: LDraw user needs POV help
Date: 22 Nov 2016 09:02:49
Message: <58345009$1@news.povray.org>
On 11/21/2016 03:54 PM, Roland Melkert wrote:
> srgbft <r,g,b, 0.85, 0.2>

I confess to not following this thread too closely, but the above line 
of code caught my eye because the F & T components add to more than 1.0.

I believe this results in the introduction of negative/complement 
<r,g,b> color which I'm guessing you'd not want.

Bill P.


Post a reply to this message

From: Roland Melkert
Subject: Re: LDraw user needs POV help
Date: 24 Nov 2016 13:50:00
Message: <web.583735dca94cadc5369a059c0@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 11/21/2016 03:54 PM, Roland Melkert wrote:
> > srgbft <r,g,b, 0.85, 0.2>
>
> I confess to not following this thread too closely, but the above line
> of code caught my eye because the F & T components add to more than 1.0.
>
> I believe this results in the introduction of negative/complement
> <r,g,b> color which I'm guessing you'd not want.
Thanks William

I missed that, the result of endless tweaking :)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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