Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question.

2 views
Skip to first unread message

Scott Baillie

unread,
Mar 8, 1999, 3:00:00 AM3/8/99
to
Hi,

Is it possible to have iterated polygons, textures, transparency and basic
lighting effects at the same time in Glide 2.x? If so, does this mean that I
will have to change the grColorCombine, grAlphaCombine, grTexCombine and
grAlphaBlendFunction functions at runtime depending on the type of object?

Also, could anyone tell me where I could get any info on fairly basic
lighting effects.

Thanks all.

PS how do you guys calculate the FPS in your programs?


Marc Moulis

unread,
Mar 9, 1999, 3:00:00 AM3/9/99
to

Scott Baillie wrote in message <7c1c6u$fh1$1...@news.3dfx.com>...

>Hi,
>
>Is it possible to have iterated polygons, textures, transparency and basic
>lighting effects at the same time in Glide 2.x? If so, does this mean that
I
>will have to change the grColorCombine, grAlphaCombine, grTexCombine and
>grAlphaBlendFunction functions at runtime depending on the type of object?
>

Hi

What do you mean by "iterated polygons" and "iterated textures" ? If you're
talking about Gouraud shading applied on a flat polygon or a textured
polygon, then the answer is yes, you can mix all these types of rendering.
And of course, you'll have to change the ColorCombine setup, depending on
your needs. It's the same thing for the Alpha Combine (though you could only
set it up once, if you only need iterated alpha, and then act on Alpha
Blending to switch it on/off). I strongly suggest that you keep somewhere
the current configuration of each unit, and change configuration only when
required to avoid useless calls to grXXXXCombine(). Also try to sort your
polygons by "styles", I mean try to draw in one row polygons that are
textured and gouraud shaded, then polygons that are only gouraud shaded,
etc....

>Also, could anyone tell me where I could get any info on fairly basic
>lighting effects.
>

You could start by having a look at some 3D books. They give complete infos
about standard lighting models (from flat to complete lighting with
specular, diffuse, etc..). Anyway, I can already give you the basic models
that are usually implemented:

* Simple flat lighting : Just use the dot product between your polygon and
the light vector to determine a coefficient to attenuate polygon color.
* Simple gouraud lighting : The same thing, but do it for each vertex of
your face (of course, vertices normals are supposed to be different, or else
you'll get the same thing as above...)

These two models are basically for a monochromatic light, but can easily be
adapted for colored light sources. You can also add light attenuation.

There are two approaches you can use : additive or multiplicative lighting.
In the first model, the color of the light is added to the color of the face
(leads to saturations effects), in the second one the light factor
attenuates the face color (used for specular effects for example).
Physically, an object color cannot emit more light than its components
permit, that means for example if an object has color (255, 0, 0), then if
you use a light which has color (0, 255, 255), the object is supposed to
appear black (this may sounds strange but it's physics !). So the
multiplicative model might look more "natural".

Marc

Scott Baillie

unread,
Mar 9, 1999, 3:00:00 AM3/9/99
to

Marc Moulis wrote in message <7c2rra$3pi$1...@news.3dfx.com>...

>
>Hi
>
>What do you mean by "iterated polygons" and "iterated textures" ? If you're
>talking about Gouraud shading applied on a flat polygon or a textured
>polygon, then the answer is yes, you can mix all these types of rendering.
>And of course, you'll have to change the ColorCombine setup, depending on
> .....

Thanks Marc - much appreciated.

0 new messages