ObjReader Community

Tips & Tricks => Tips & Tricks => Topic started by: Patrice Terrier on May 02, 2016, 02:31:47 pm

Title: GL_LIGHT_MODEL_TWO_SIDE
Post by: Patrice Terrier on May 02, 2016, 02:31:47 pm
Mike--

Because i am tired of small normal errors, i have added a new menu/material option to turn both side illumination on/off.

In the material file use:
#bothsides
Enable the GL_LIGHT_MODEL_TWO_SIDE parameter, to illuminate both sides of polygons. By default, only the front of polygons is illuminated.
Syntax: #bothsides

There is also a new contextual menu option to turn it On or Off on the fly.



Title: Re: GL_LIGHT_MODEL_TWO_SIDE
Post by: Michael Lobko-Lobanovsky on May 02, 2016, 06:24:47 pm
Thanks for the updates, Patrice.

However you should be aware of the following:

1. Lighting both sides of the objects aggravates lighting equation calculation stress on OpenGL, is effectively equivalent to doubling the number of active lights, and may lead to a substantial drop in the FPS rate for complex models. It is practically as stressful as not culling the model's backfaces.

2. GL_LIGHT_MODEL_TWO_SIDE toggle has no effect on GLSL shaders. Those must implement this functionality explicitly in their own code, recalculating the light incident from mirror reflected light positions.

I'd also suggest using a somewhat more grammatically correct collocation #bothsides.
Title: Re: GL_LIGHT_MODEL_TWO_SIDE
Post by: Patrice Terrier on May 02, 2016, 07:14:02 pm
Quote
I'd also suggest using a somewhat more grammatically correct collocation #bothsides.
Done ;)

Quote
GL_LIGHT_MODEL_TWO_SIDE toggle has no effect on GLSL shaders
Most of the time this occures with simple FFP models, and models that have not been reworked yet.