POV-Ray : Newsgroups : povray.binaries.programming : Idea: Sprite rendering option Server Time
22 Dec 2024 04:33:28 EST (-0500)
  Idea: Sprite rendering option (Message 1 to 8 of 8)  
From: PoD
Subject: Idea: Sprite rendering option
Date: 10 Jan 1999 14:53:54
Message: <3699054B.42C3@merlin.net.au>
When using POV-Ray to render sprites for a game and using AA, the edges
of the sprite are AAd with the background. So I have been thinking of
modifying the way AA works as follows.

Count the number of supersamples which hit objects and the number that
hit nothing.
Add up the colour values of the 'hit' rays only and divide by the number
of 'hit' rays.

Now the objects should be AAd but still have sharp edges and not contain
any of the background colour.

Another option would be to AA only the transmit value with the
background and thus get soft (transparent)
edges so rendered objects could be pasted over other images in a paint
program. I was trying to add POV rendered buildings to a photo and the
object edges were driving me crazy.

Anyway, does this sound like a sensible idea? Has anyone done it before?
Anyone see any problems?

Thanks, PoD.


Post a reply to this message

From: Nathan Kopp
Subject: Re: Idea: Sprite rendering option
Date: 10 Jan 1999 15:10:57
Message: <36702A8B.D1EDECEF@Kopp.com>
Here's the solution that I use:  I render the image at much higher resolution
than I intend to use, with antialiasing turned OFF.  Then I open it in a paint
program that handles transparancy (I use Paint Shop Pro 5).  Next, I remove the
background color, then resize the image down to the size I want.  PSP does a
good job resampling, so you get the effect of antialiasing but the edges
antialias to the alpha channel instead of to black.

-Nathan


Post a reply to this message

From: Mike
Subject: Re: Idea: Sprite rendering option
Date: 10 Jan 1999 15:31:13
Message: <36990D8A.548AC142@aol.com>
This is just an idea, but perhaps if the object being rendered was given
a white ambient finish and rendered with a black background with AA on,
this would make a good alpha channel for the color render. I haven't
tried it before though.

-Mike

Nathan Kopp wrote:
> 
> Here's the solution that I use:  I render the image at much higher resolution
> than I intend to use, with antialiasing turned OFF.  Then I open it in a paint
> program that handles transparancy (I use Paint Shop Pro 5).  Next, I remove the
> background color, then resize the image down to the size I want.  PSP does a
> good job resampling, so you get the effect of antialiasing but the edges
> antialias to the alpha channel instead of to black.
> 
> -Nathan


Post a reply to this message

From: PoD
Subject: Re: Idea: Sprite rendering option
Date: 10 Jan 1999 15:34:22
Message: <36990EBE.2C8E@merlin.net.au>
Nathan Kopp wrote:
> 
> Here's the solution that I use:  I render the image at much higher resolution
> than I intend to use, with antialiasing turned OFF.  Then I open it in a paint
> program that handles transparancy (I use Paint Shop Pro 5).  Next, I remove the
> background color, then resize the image down to the size I want.  PSP does a
> good job resampling, so you get the effect of antialiasing but the edges
> antialias to the alpha channel instead of to black.
> 
> -Nathan

Thanks, that's a good solution but a lot of work for lots of animated
sprites (I'm lazy).
Also I'd like to do it just as a project.

Cheers, PoD.


Post a reply to this message

From: Ronald L  Parker
Subject: Re: Idea: Sprite rendering option
Date: 10 Jan 1999 21:18:14
Message: <36995e9e.11063814@news.povray.org>
On Mon, 11 Jan 1999 06:23:47 +1030, PoD <pod### [at] merlinnetau> wrote:

>Another option would be to AA only the transmit value with the
>background and thus get soft (transparent)
>edges so rendered objects could be pasted over other images in a paint
>program. I was trying to add POV rendered buildings to a photo and the
>object edges were driving me crazy.

If you don't use a background, and you render to a format that
supports an alpha channel, and you turn on the alpha channel support
using +UA, you get soft edges on the alpha mask.  Perhaps this is what
you want.


Post a reply to this message

From: Peter Popov
Subject: Re: Idea: Sprite rendering option
Date: 10 Jan 1999 22:46:07
Message: <36997386.125256196@news.povray.org>
On Sun, 10 Jan 1999 14:28:58 -0600, Mike <Ama### [at] aolcom> wrote:

>This is just an idea, but perhaps if the object being rendered was given
>a white ambient finish and rendered with a black background with AA on,
>this would make a good alpha channel for the color render. I haven't
>tried it before though.
>
>-Mike

I've tried this when I have complex texturing etc., but it's generally
easier to use the +UA option and output to png or tga. The alpha
channel thus generated is pretty much what you need, though on a
bright backgtound you still have to remove the black matte.

>Nathan Kopp wrote:
>> 
>> Here's the solution that I use:  I render the image at much higher resolution
>> than I intend to use, with antialiasing turned OFF.  Then I open it in a paint
>> program that handles transparancy (I use Paint Shop Pro 5).  Next, I remove the
>> background color, then resize the image down to the size I want.  PSP does a
>> good job resampling, so you get the effect of antialiasing but the edges
>> antialias to the alpha channel instead of to black.
>> 
>> -Nathan


Post a reply to this message

From: Peter Popov
Subject: Re: Idea: Sprite rendering option
Date: 10 Jan 1999 22:51:31
Message: <369a7437.125433341@news.povray.org>
On Thu, 10 Dec 1998 15:09:47 -0500, Nathan Kopp <Nat### [at] Koppcom>
wrote:

>Here's the solution that I use:  I render the image at much higher resolution
>than I intend to use, with antialiasing turned OFF.  Then I open it in a paint
>program that handles transparancy (I use Paint Shop Pro 5).  Next, I remove the
>background color, then resize the image down to the size I want.  PSP does a
>good job resampling, so you get the effect of antialiasing but the edges
>antialias to the alpha channel instead of to black.
>
>-Nathan

Good tip, though not very effective for complex images. You can render
with alpha channel and then fix it in PSP. A mild blur followed by a
high contrast + low brightness correction will shrink the alpha
channel by about a pixel, which is acceptable for 800x600 and better..

Peter


Post a reply to this message

From: Robert Dawson
Subject: Re: Idea: Sprite rendering option
Date: 6 Aug 1999 14:46:28
Message: <37ab2d84@news.povray.org>
Mike <Ama### [at] aolcom> wrote in message news:36990D8A.548AC142@aol.com...
> This is just an idea, but perhaps if the object being rendered was given
> a white ambient finish and rendered with a black background with AA on,
> this would make a good alpha channel for the color render. I haven't
> tried it before though.

    I have tried (successfully) using quick_color and lowest render quality
to generate an alpha channel. Works beautifully.

    -Robert Dawson


Post a reply to this message

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