POV-Ray : Newsgroups : povray.binaries.images : Shot glass test Server Time
25 Apr 2024 18:48:13 EDT (-0400)
  Shot glass test (Message 22 to 31 of 31)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Kenneth
Subject: Re: Shot glass test, with liquid
Date: 25 Oct 2018 18:25:01
Message: <web.5bd242609da521643b397d0@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> 2) Try applying a JPEG image instead of a PNG (made in a graphics program with a
> transparent mask in the outer area)...

Sorry, ignore that; I wasn't thinking. (A jpeg image can't have an alpha-channel
mask, AFAIK.) Duh.

INSTEAD...
Try applying a jpeg image to the glass with the 'once' keyword (instead of your
png image), to see if there is any visual change in the transparent areas. I'm
still thinking that the 'darkness' problem might be PNG/gamma related.


Post a reply to this message

From: clipka
Subject: Re: Shot glass test, with liquid
Date: 25 Oct 2018 22:33:21
Message: <5bd27cf1$1@news.povray.org>
> I thought that I would try this with a transparent texture. 
> Unfortunately this is the best I could get. Your method is better.
> I used a png with a RGB=0 set to transparent. You can see the darkened 
> area of the transparent part of the image map. Also the copy of the 
> image at the back is a question mark. It is not a reflection.

Looks like a reflection to me.

As for the alpha thing, it might be worth trying `use_alpha on` in the 
finish block. That'll turn off that texture layer's highlights and 
specular reflections wherever the image is transparent.


Post a reply to this message

From: Stephen
Subject: Re: Shot glass test, with liquid
Date: 26 Oct 2018 05:07:02
Message: <5bd2d936@news.povray.org>
On 25/10/2018 23:23, Kenneth wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> 
>> 2) Try applying a JPEG image instead of a PNG (made in a graphics program with a
>> transparent mask in the outer area)...
> 
> Sorry, ignore that; I wasn't thinking. (A jpeg image can't have an alpha-channel
> mask, AFAIK.) Duh.
> 
> INSTEAD...
> Try applying a jpeg image to the glass with the 'once' keyword (instead of your
> png image), to see if there is any visual change in the transparent areas. I'm
> still thinking that the 'darkness' problem might be PNG/gamma related.
> 
> 

How right you were. I use Paint Shop Pro for image editing. Hidden away 
in File Format Preferences, is the setting: Load and save transparency 
to / from layer transparency OR Load and save transparency to / from 
alpha channel. It was set to layer transparency. Changing it to alpha 
solved the problem. I had to reinstall PSP a year or so ago and had 
forgotten those settings. So does that mean there is a problem when 
using the colour pallet for transparency?

Clipka was right about the reflection. My brain must have been addled 

forgotten setting.


-- 

Regards
     Stephen


Post a reply to this message


Attachments:
Download 'label_c_b3_c0000.png' (235 KB)

Preview of image 'label_c_b3_c0000.png'
label_c_b3_c0000.png


 

From: Stephen
Subject: Re: Shot glass test, with liquid
Date: 26 Oct 2018 05:26:16
Message: <5bd2ddb8$1@news.povray.org>
On 25/10/2018 23:08, StephenS wrote:
> On 2018-10-25 1:58 p.m., Stephen wrote:
> ....
>> I thought that I would try this with a transparent texture. 
>> Unfortunately this is the best I could get. Your method is better.
>> I used a png with a RGB=0 set to transparent. You can see the darkened 
>> area of the transparent part of the image map. Also the copy of the 
>> image at the back is a question mark. It is not a reflection.
>>
> My texture is:
> 
> #declare Nova_Scotia_Crest_ =
> texture {
>    pigment {
>      image_map{
>        png 
> "E:/Documents/Bishop3d/Objects/Glass_containers/Nova_Scotia_image.png"
>        map_type 0
>        once
>      }
>      scale     <1.000,1.250,1.000>
>      translate <-0.500,0.750,0.000>
>    }
> 
> }
> 

I'll show you mine.

#declare Glass_Image =
material{
   texture {
     #declare BISHOP3D_TEMPORARY_IDENTIFIER =
       texture {
         pigment {
           colour rgbft <0.259,0.384,0.200,0.000,0.950>
         }

         finish {
           ambient     rgb <0.000,0.000,0.000>
           brilliance  1.000
           crand       0.000
           diffuse     0.190
           metallic    0.000
           phong       0.000
           phong_size  40.000
           specular    1.000
           roughness   0.001
           conserve_energy
           reflection {
             rgb <0.040,0.040,0.040>, rgb <0.500,0.500,0.500>
             fresnel   0
             falloff   1.500
             exponent  2.000
             metallic  0.000
           }
           irid {
             0.275
             thickness 0.100
             turbulence 0.000
           }
         }

       }
       texture {
         pigment {
           image_map{
             png "F:\Graphics\B3D Data\Maps\Odds\Mask_1a.png"
             map_type 2
             once
           }
           scale     <2.000,2.000,2.000>
           translate <-0.500,-0.500,-0.500>
         }

         finish {
           ambient     rgb <0.000,0.000,0.000>
           brilliance  1.000
           crand       0.000
           diffuse     0.850
           metallic    0.000
           phong       0.000
           phong_size  40.000
           specular    1.000
           roughness   0.001
           conserve_energy
           reflection {
             rgb <0.040,0.040,0.040>, rgb <0.040,0.040,0.040>
             fresnel   0
             falloff   1.500
             exponent  2.000
             metallic  0.000
           }
         }

       }
     ;/* the semicolon is necessary or POV-Ray will not figure out that 
the declarations has ended /*
     BISHOP3D_TEMPORARY_IDENTIFIER
   }

   interior{
     ior                 2.010
     caustics            0.000
     dispersion          1.030
     dispersion_samples  7.000
     fade_power          0.000
     fade_distance       0.000
     fade_color          rgb <0.000,0.000,0.000>
   }

}


> I think all of the magic is in the alpha channel, in a graphics program 
> (Gimp) it looks like a black/white mask.
> 

I need to do some reading on the png file format, transparency and alpha.

-- 

Regards
     Stephen


Post a reply to this message

From: Stephen
Subject: Re: Shot glass test, with liquid
Date: 26 Oct 2018 06:16:59
Message: <5bd2e99b$1@news.povray.org>
On 26/10/2018 10:06, Stephen wrote:
> 
> How right you were. I use Paint Shop Pro for image editing. Hidden away 
> in File Format Preferences, is the setting: Load and save transparency 
> to / from layer transparency OR Load and save transparency to / from 
> alpha channel. It was set to layer transparency. Changing it to alpha 
> solved the problem.

Wrong. :(

I'll start a new thread if I find a solution or need help.


-- 

Regards
     Stephen


Post a reply to this message

From: Kenneth
Subject: Re: Shot glass test, with liquid
Date: 26 Oct 2018 13:30:03
Message: <web.5bd34ec99da521643b397d0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

>
> As for the alpha thing, it might be worth trying `use_alpha on` in the
> finish block. That'll turn off that texture layer's highlights and
> specular reflections wherever the image is transparent.

Is that an undocumented feature of use_alpha? (Or perhaps I'm not reading the
docs correctly?) In '3.6.2.6.4 Using the Alpha Channel', the only thing I see
there that might give a clue is this:

"Note: The following mechanism has some limitations with colored highlights:

When generating non-premultiplied alpha output to a classic low-dynamic-range
file format (e.g. PNG), transparency of particularly bright areas will now be
reduced, in order to better preserve highlights on transparent objects."

But that description seems to imply the opposite of 'turning off' the
highlights.

Mea culpa: I've never used the 'use_alpha' keyword, so I don't really know what
visual effect it produces.


Post a reply to this message

From: Bald Eagle
Subject: Re: Shot glass test, with liquid
Date: 26 Oct 2018 19:15:00
Message: <web.5bd39f699da5216458c7afe0@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> clipka <ano### [at] anonymousorg> wrote:
>
> >
> > As for the alpha thing, it might be worth trying `use_alpha on` in the
> > finish block. That'll turn off that texture layer's highlights and
> > specular reflections wherever the image is transparent.
>
> Is that an undocumented feature of use_alpha?

No...


Imagine use_alpha as being sort of a texture map.
In the areas of the image map that have an alpha-channel "flag" for those
pixels, POV-Ray turns it on, which negates the texture - including the
highlights and specular reflections of the finish so that it's truly invisible -
NOT just clear yet still reflective like glass.

http://wiki.povray.org/content/Reference:Finish

New in version 3.8 you can now specify use_alpha in the finish block. If set to
off, the default and also the old behavior, then pigment filter and transmit
only hide the surface's diffuse, ambient and emission components. If set to on
then pigment filter and transmit also hide the surface's highlights and specular
reflection.


Post a reply to this message

From: clipka
Subject: Re: Shot glass test, with liquid
Date: 28 Oct 2018 06:44:33
Message: <5bd59311$1@news.povray.org>
Am 26.10.2018 um 19:28 schrieb Kenneth:

>> As for the alpha thing, it might be worth trying `use_alpha on` in the
>> finish block. That'll turn off that texture layer's highlights and
>> specular reflections wherever the image is transparent.
> 
> Is that an undocumented feature of use_alpha? (Or perhaps I'm not reading the
> docs correctly?) In '3.6.2.6.4 Using the Alpha Channel', the only thing I see
> there that might give a clue is this:
> 
> "Note: The following mechanism has some limitations with colored highlights:

That's the documentation on alpha channel /output/. What we're looking 
at here is alpha channel /input/, which for the most part is documented 
in the section on image_map, including the old `use_alpha` mechanism.

But the additional new use of `use_alpha` keyword in the finish block is 
documented in the section on finish (pretty much as a side note). As a 
matter of fact it not only applies to image_map, but any pigment that 
features transparency.


Post a reply to this message

From: Kenneth
Subject: Re: Shot glass test, with liquid
Date: 28 Oct 2018 12:15:01
Message: <web.5bd5dfcf9da521643b397d0@news.povray.org>
[Bald Eagle wrote:]
> > http://wiki.povray.org/content/Reference:Finish

[Clipka wrote:]
>
> That's the documentation on alpha channel /output/. What we're looking
> at here is alpha channel /input/, which for the most part is documented
> in the section on image_map, including the old `use_alpha` mechanism.
>
> But the additional new use of `use_alpha` keyword in the finish block is
> documented in the section on finish (pretty much as a side note)...

Thanks. All clear now.

I see now that my confusion is just documentation-related. The keyword index for
'use_alpha' (in the 'newer' documentation that can be downloaded for v3.7.1 etc)
takes the user to only one docs section,  3.6.2.4.2 Image Pattern  --with only a
single link there to "Using the Alpha Channel". Seems that the keyword should
instead have two (or three?) entries in the index, additionally for 'Finish' and
'image_map'.


Post a reply to this message

From: Stephen
Subject: Re: Shot glass test, with liquid
Date: 30 Oct 2018 04:03:17
Message: <5bd81045@news.povray.org>
On 25/10/2018 23:08, StephenS wrote:
> I think all of the magic is in the alpha channel, 


Yes, the alpha channel of the image map is the key. I think that I have 
worked out how to make one in the right proportions.

I prefer my medicine in a taller glass.


-- 

Regards
     Stephen


Post a reply to this message


Attachments:
Download 'test_k4b_0000.png' (405 KB)

Preview of image 'test_k4b_0000.png'
test_k4b_0000.png


 

<<< Previous 10 Messages Goto Initial 10 Messages

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