|
From: Frank C. <dev...@ch...> - 2005-01-21 17:28:14
|
On 21-Jan-05, at 12:11 PM, Keith Wiley wrote: > On Fri, 21 Jan 2005, James W. Walker wrote: > >> On Jan 21, 2005, at 12:10 AM, Keith Wiley wrote: >> >>> I am trying to use an alpha channel to make a soft sun that fades >>> into the background sky. It works perfectly except at the horizon, >>> where the square shape of the plane the sun texture is put on shows >>> up as a translucent square. This problem vanishes if I turn off >>> fog. I am aware of the discussions pointing out that fog does not >>> work properly with alpha channeled textures...and I assume you will >>> agree that this bug is the problem I am experiencing. My question >>> is, does anyone havea reccomendation for how to work around it? >> >> Why not use a disk instead of a square for the sun? > > The only reason I used a square was to reduce the number of triangles. > I considered a circle and thought it was "bad desig" to make shapes > with triangles that could be made with transparent textures instead. Indeed... > I'll try it with a disk...although I would still like the alpha > texture to work properly if I want the sun to have a fuzzy edge. A similar effect can be achieved by using a subdivided disk with per-vertex colour/transparency attributes that fade out towards the outer edges, but there is a solution for some additive blended textures... First ensure the alpha in your art is not pre-multiplied (likely the case already) then put the sun shape in a display group under a fog object with its visibility set to false. This will ensure no fog is drawn on the sun, which is typically a desired effect on all celestial bodies. Also place a Lambert shader before the sun geometry to turn off any potential specular highlights, since they may display a similar artifact as fog. HTH! Frank. ------------ <http://developer.chaoticbox.com> |