POV-Ray : Newsgroups : povray.binaries.images : billboard tint Server Time
27 Apr 2024 06:47:17 EDT (-0400)
  billboard tint (Message 1 to 10 of 21)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Mike Miller
Subject: billboard tint
Date: 3 Nov 2023 12:55:00
Message: <web.654524992e6f6abcf22cdb33dabc9342@news.povray.org>
After taking some time off from POV, I'm ready to tackle a few new scenes I have
in mind. One involves a landscape with some foreground vegetation. I started
collecting some 2D sprite images of moss, grasses, and weeds thinking that I
could populate the ground with them. I've run into a problem with the
transparent portion of the png when turning on fog. The fog is tinting the
billboard shape. I've removed the finish and have tried a variety of things in
the shader with no success. I can fall back on 3D models if I can't get the
sprites to work.  Below is what I used to texture this example. I understand
that the bump statement will not have much of an effect without a finish. Any
help would be appreciated.
Thanks,
Mike.

#declare imgDiffuse = "plants/grass_A.png"
#declare imgBump    = "plants/grass_A.png"

#declare M_grass_A =
material {
    texture {
       pigment {
            image_map {
                png imgDiffuse premultiplied 0 gamma 2.2
                map_type 0
                interpolate 4
                }
      }
    normal  {
        bump_map {
            png imgBump premultiplied 0 gamma 2.2
            map_type 0
            interpolate 4

        }
        bump_size 5
    }
    finish {
        phong 0
        phong_size 0
        ambient 0
        }
    }
    scale <1,1,1>
    translate <-.5,0,0>
}

#declare sprite = box {<-.5,0,-.01>,<.5,1,.01> } ;
object { sprite material {M_grass_A} scale <30,40,1> translate <0,-1,0>}


Post a reply to this message


Attachments:
Download 'plant_sprite_fog_problem.jpg' (252 KB)

Preview of image 'plant_sprite_fog_problem.jpg'
plant_sprite_fog_problem.jpg


 

From: William F Pokorny
Subject: Re: billboard tint
Date: 3 Nov 2023 14:57:13
Message: <65454289$1@news.povray.org>
On 11/3/23 12:49, Mike Miller wrote:
> I've run into a problem with the
> transparent portion of the png when turning on fog. The fog is tinting the
> billboard shape.

The fog feature is a faked effect which works, solely, with initial 
camera rays. More specifically fog is added using the distance from the 
camera to the first intersection - or effective infinity (2,000,000 
units?). Those initial camera rays will intersect the billboards whether 
the pigment is transparent or not.

So, I'm not surprised the bill board tint is different, but at this 
moment, I don't understand why it appears to be more foggy rather than 
less. Most probably your fog is set up to be more dense at distance (not 
ground fog)?

Maybe we'd get what you see, if using ground fog that is not oriented 
correctly? Not sure. Could be some bug too - there are some in the 
official POV-Ray code - and probably some unknown ones still in my 
playpen code too. Faked effects are tricky.

In any case, distance based features will struggle with a "billboards 
technique".

Bill P.


Post a reply to this message

From: Mike Miller
Subject: Re: billboard tint
Date: 3 Nov 2023 16:45:00
Message: <web.65455b99310e11ef22cdb33dabc9342@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 11/3/23 12:49, Mike Miller wrote:
> > I've run into a problem with the
> > transparent portion of the png when turning on fog. The fog is tinting the
> > billboard shape.
>
> The fog feature is a faked effect which works, solely, with initial
> camera rays. More specifically fog is added using the distance from the
> camera to the first intersection - or effective infinity (2,000,000
> units?). Those initial camera rays will intersect the billboards whether
> the pigment is transparent or not.
>
> So, I'm not surprised the bill board tint is different, but at this
> moment, I don't understand why it appears to be more foggy rather than
> less. Most probably your fog is set up to be more dense at distance (not
> ground fog)?
>
> Maybe we'd get what you see, if using ground fog that is not oriented
> correctly? Not sure. Could be some bug too - there are some in the
> official POV-Ray code - and probably some unknown ones still in my
> playpen code too. Faked effects are tricky.
>
> In any case, distance based features will struggle with a "billboards
> technique".
>
> Bill P.

Thanks Bill,
I'll mess around with it a bit more before giving up. I'll let you know if I
find a solution before using triangle mesh for these plants. :)
Best regards,
Mike.


Post a reply to this message

From: Alain Martel
Subject: Re: billboard tint
Date: 3 Nov 2023 17:19:21
Message: <654563d9$1@news.povray.org>
Le 2023-11-03 à 12:49, Mike Miller a écrit :
> After taking some time off from POV, I'm ready to tackle a few new scenes I have
> in mind. One involves a landscape with some foreground vegetation. I started
> collecting some 2D sprite images of moss, grasses, and weeds thinking that I
> could populate the ground with them. I've run into a problem with the
> transparent portion of the png when turning on fog. The fog is tinting the
> billboard shape. I've removed the finish and have tried a variety of things in
> the shader with no success. I can fall back on 3D models if I can't get the
> sprites to work.  Below is what I used to texture this example. I understand
> that the bump statement will not have much of an effect without a finish. Any
> help would be appreciated.
> Thanks,
> Mike.
> 
> #declare imgDiffuse = "plants/grass_A.png"
> #declare imgBump    = "plants/grass_A.png"
> 
> #declare M_grass_A =
> material {
>      texture {
>         pigment {
>              image_map {
>                  png imgDiffuse premultiplied 0 gamma 2.2
>                  map_type 0
>                  interpolate 4
>                  }
>        }
>      normal  {
>          bump_map {
>              png imgBump premultiplied 0 gamma 2.2
>              map_type 0
>              interpolate 4
> 
>          }
>          bump_size 5
>      }
>      finish {
>          phong 0
>          phong_size 0
>          ambient 0
>          }
>      }
>      scale <1,1,1>
>      translate <-.5,0,0>
> }
> 
> #declare sprite = box {<-.5,0,-.01>,<.5,1,.01> } ;
> object { sprite material {M_grass_A} scale <30,40,1> translate <0,-1,0>}
> 

The fog is more visible between the billboards because there is less of 
it. It's evaluation stops at the billboard.

You may try adding hollow to those. Not sure that it'll work with fog in 
this case, but it can make a huge difference with media.
Adding hollow MAY allow the evaluation of the fog behind the billboards. 
But, then, the fog could become more intense in those areas. Hard to tell.

Try
#declare sprite = box {<-.5,0,-.01>,<.5,1,.01> hollow} ;
object { sprite material {M_grass_A} scale <30,40,1> translate <0,-1,0>}
or
#declare sprite = box {<-.5,0,-.01>,<.5,1,.01> } ;
object { sprite material {M_grass_A} scale <30,40,1> translate 
<0,-1,0>hollow}


Post a reply to this message

From: William F Pokorny
Subject: Re: billboard tint
Date: 3 Nov 2023 17:45:52
Message: <65456a10$1@news.povray.org>
On 11/3/23 16:44, Mike Miller wrote:
> I'll mess around with it a bit more before giving up.

Alain just mentioned media -and his opening comment makes me think I'm 
assuming the billboards position incorrectly...

With media - where we almost always use contained media these days - we
sometimes forget we can still implement global media.

It might be worth a try in your case. As long as the billboards have 
enough depth POV-Ray can track whether inside or outside the billboards, 
but not a depth appreciable enough(a) to greatly affect the media 
results - I think it might work.

(a) Try to stick with more perpendicular billboards with respect to the 
initial camera rays.

You'll need a complete scene backstop shape at "media fog" end effect 
distance. In other words, you cannot have only 'background' or a 
'skysphere', global media needs rays which eventually terminate 
somewhere with a final intersection.

Bill P.


Post a reply to this message

From: Mike Miller
Subject: Re: billboard tint
Date: 3 Nov 2023 18:20:00
Message: <web.65457017310e11ef22cdb33dabc9342@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
> > After taking some time off from POV, I'm ready to tackle a few new scenes I have
> > in mind. One involves a landscape with some foreground vegetation. I started
> > collecting some 2D sprite images of moss, grasses, and weeds thinking that I
> > could populate the ground with them. I've run into a problem with the
> > transparent portion of the png when turning on fog. The fog is tinting the
> > billboard shape. I've removed the finish and have tried a variety of things in
> > the shader with no success. I can fall back on 3D models if I can't get the
> > sprites to work.  Below is what I used to texture this example. I understand
> > that the bump statement will not have much of an effect without a finish. Any
> > help would be appreciated.
> > Thanks,
> > Mike.
> >
> > #declare imgDiffuse = "plants/grass_A.png"
> > #declare imgBump    = "plants/grass_A.png"
> >
> > #declare M_grass_A =
> > material {
> >      texture {
> >         pigment {
> >              image_map {
> >                  png imgDiffuse premultiplied 0 gamma 2.2
> >                  map_type 0
> >                  interpolate 4
> >                  }
> >        }
> >      normal  {
> >          bump_map {
> >              png imgBump premultiplied 0 gamma 2.2
> >              map_type 0
> >              interpolate 4
> >
> >          }
> >          bump_size 5
> >      }
> >      finish {
> >          phong 0
> >          phong_size 0
> >          ambient 0
> >          }
> >      }
> >      scale <1,1,1>
> >      translate <-.5,0,0>
> > }
> >
> > #declare sprite = box {<-.5,0,-.01>,<.5,1,.01> } ;
> > object { sprite material {M_grass_A} scale <30,40,1> translate <0,-1,0>}
> >
>
> The fog is more visible between the billboards because there is less of
> it. It's evaluation stops at the billboard.
>
> You may try adding hollow to those. Not sure that it'll work with fog in
> this case, but it can make a huge difference with media.
> Adding hollow MAY allow the evaluation of the fog behind the billboards.
> But, then, the fog could become more intense in those areas. Hard to tell.
>
> Try
> #declare sprite = box {<-.5,0,-.01>,<.5,1,.01> hollow} ;
> object { sprite material {M_grass_A} scale <30,40,1> translate <0,-1,0>}
> or
> #declare sprite = box {<-.5,0,-.01>,<.5,1,.01> } ;
> object { sprite material {M_grass_A} scale <30,40,1> translate
> <0,-1,0>hollow}

Thanks Alain - I gave that a shot. It didn't seem to work.


Post a reply to this message

From: Bald Eagle
Subject: Re: billboard tint
Date: 3 Nov 2023 18:25:00
Message: <web.65457245310e11e1f9dae3025979125@news.povray.org>
"Mike Miller" <mil### [at] gmailcom> wrote:
> I've run into a problem with the transparent portion of the png when turning on fog.


https://wiki.povray.org/content/Reference:Fog

I think that you're going to have a hard time with the fog since it's purely
distance based.

Also, there's no really good way to make a "cutout" from the transparent image.

You could do a few things.
Try and make a custom prism from the image with a macro.
Make a heightfield from the sprite and difference away a box, leaving just the
visible portion.

fake the fog using a large upward-curving surface toward the rear of the scene
and pigmented using a distance-based function.

Try a thin wedge with a white pigment and slight filter value that gets higher
toward the rear.  The filter may mimic the fog/media effect and be cheaper.
If you need to speckle it like real media, maybe use a noise pattern to make a
texture with white / clear.

Do a 2-pass render with the plants billboarded over the fogged scene afterward.

That's all I got for now.

- BW


Post a reply to this message

From: Mike Miller
Subject: Re: billboard tint
Date: 3 Nov 2023 18:30:00
Message: <web.6545736a310e11ef22cdb33dabc9342@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 11/3/23 16:44, Mike Miller wrote:
> > I'll mess around with it a bit more before giving up.
>
> Alain just mentioned media -and his opening comment makes me think I'm
> assuming the billboards position incorrectly...
>
> With media - where we almost always use contained media these days - we
> sometimes forget we can still implement global media.
>
> It might be worth a try in your case. As long as the billboards have
> enough depth POV-Ray can track whether inside or outside the billboards,
> but not a depth appreciable enough(a) to greatly affect the media
> results - I think it might work.
>
> (a) Try to stick with more perpendicular billboards with respect to the
> initial camera rays.
>
> You'll need a complete scene backstop shape at "media fog" end effect
> distance. In other words, you cannot have only 'background' or a
> 'skysphere', global media needs rays which eventually terminate
> somewhere with a final intersection.
>
> Bill P.

Thanks Bill,
my scene is enclosed/surrounded with a mapped sphere object. I did try Alain's
idea....same results. I added depth to the billboards but it renders both front
and back resulting in a double image. Is there backface culling in POV? ...don't
see it in the help files. I'll try a clipped plane just to test.
Mike.


Post a reply to this message

From: William F Pokorny
Subject: Re: billboard tint
Date: 3 Nov 2023 18:57:16
Message: <65457acc$1@news.povray.org>
On 11/3/23 18:25, Mike Miller wrote:
> my scene is enclosed/surrounded with a mapped sphere object. I did try Alain's
> idea....same results. I added depth to the billboards but it renders both front
> and back resulting in a double image. Is there backface culling in POV? ...don't
> see it in the help files. I'll try a clipped plane just to test.

There is interior_texture{}.

I think you could make the normal texture{} completely transparent and 
the interior_texture{} your image map. It should be the first 
intersection on the billboard uses the exterior texture{} and the second 
interior_texture{}.

Aside: By default texture{} gets used for the interior texture of shapes 
too - if you only specify a texture{}.

Bill P.


Post a reply to this message

From: Mike Miller
Subject: Re: billboard tint
Date: 3 Nov 2023 19:45:00
Message: <web.654585b5310e11ef22cdb33dabc9342@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 11/3/23 18:25, Mike Miller wrote:
> > my scene is enclosed/surrounded with a mapped sphere object. I did try Alain's
> > idea....same results. I added depth to the billboards but it renders both front
> > and back resulting in a double image. Is there backface culling in POV? ...don't
> > see it in the help files. I'll try a clipped plane just to test.
>
> There is interior_texture{}.
>
> I think you could make the normal texture{} completely transparent and
> the interior_texture{} your image map. It should be the first
> intersection on the billboard uses the exterior texture{} and the second
> interior_texture{}.
>
> Aside: By default texture{} gets used for the interior texture of shapes
> too - if you only specify a texture{}.
>
> Bill P.

I'll give that a shot...keep you posted. Mike


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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