Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: KeldorKatarn on March 30, 2009, 10:57:29 am

Title: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on March 30, 2009, 10:57:29 am
Is this a Direct3D OpenGL difference or what is it?

I mean, there's only one specular exponent, isn't there?
Title: Re: Difference -ogl_spec and -spec_exp
Post by: redsniper on March 30, 2009, 11:36:48 am
-spec_exp isn't exponent, it's explosion. It affects how bright the lights from explosions are.
Title: Re: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on March 30, 2009, 01:12:48 pm
In that case this wiki-entry sould be revised:

http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-spec_exp
Title: Re: Difference -ogl_spec and -spec_exp
Post by: redsniper on March 30, 2009, 04:15:09 pm
huh, well either the wiki's wrong, or I'm wrong and I don't know how people are supposed to change the explosion brightness.
Title: Re: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on March 30, 2009, 04:48:01 pm
Maybe someone who knows the could could confirm either one here?

Explosions might also be bound to the point light factor actually. But then I'd still not understand what exp stands for if ogl_spec is the exponent...
Title: Re: Difference -ogl_spec and -spec_exp
Post by: Aardwolf on April 01, 2009, 08:47:28 pm
how about explosion ?
Title: Re: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on April 02, 2009, 11:55:22 am
it isn't explosion.. it is the exponent. I looked it up inside the code.

I'm still not sure what the difference to the OpenGL shininess value is.. I think the OpenGL value is used in the shaders, the exp value in the fixed function pipeline, but I'm not 100% sure, the code isn't exactly easy to read. But it is NOT explosions. Those are affected by the point light factor.
Title: Re: Difference -ogl_spec and -spec_exp
Post by: taylor on April 02, 2009, 03:05:02 pm
Both refer to the specular exponent of all lights, they just get applied in different areas.  The -spec_exp value is directly applied to the light itself before any other lighting calculations are done.  The -ogl_spec value is for the final lighting calculation of all lights and is used the same way in both the fixed function lighting calculations and in the shaders.
Title: Re: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on April 02, 2009, 04:59:45 pm
What does that mean "applied to the light itself" how so? And where is it accessed? Multiplied to what?

Is that value used in the shaders at all?  I'm not really sure I'm getting this... how can the specular light be calculated before any other calculation?
Title: Re: Difference -ogl_spec and -spec_exp
Post by: Aardwolf on April 02, 2009, 10:11:14 pm
Oh, I get it; ogl_spec is a coefficient and spec_exp is the exponent.

i.e. the total specular component of the lighting is ogl_spec * (n ^ spec_exp), where n is probably some dot product
Title: Re: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on April 03, 2009, 08:18:48 am
Wrong. The OpenGL shininess is accessed by the shaders and used as an exponent by gl_FrontMaterial.Shininess.
Title: Re: Difference -ogl_spec and -spec_exp
Post by: Aardwolf on April 03, 2009, 10:03:46 pm
Are you asking or telling?
Title: Re: Difference -ogl_spec and -spec_exp
Post by: Tolwyn on April 05, 2009, 11:50:51 am
Are you asking or telling?

What's life without the ability to ask stupid question?
Title: Re: Difference -ogl_spec and -spec_exp
Post by: Zacam on April 05, 2009, 02:43:27 pm
/me laughs coffee out his nose
Title: Re: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on April 05, 2009, 04:10:54 pm
So would anyone knowing this code like to contribute any more information? Even a "I simply have no idea" would be helpful... So far I haven't found out what the heck this is supposed to change once shaders are used...
Title: Re: Difference -ogl_spec and -spec_exp
Post by: Zacam on April 05, 2009, 06:57:23 pm
Both refer to the specular exponent of all lights, they just get applied in different areas.  The -spec_exp value is directly applied to the light itself before any other lighting calculations are done.  The -ogl_spec value is for the final lighting calculation of all lights and is used the same way in both the fixed function lighting calculations and in the shaders.

Seems to sum it up rather nicely, I think.
Title: Re: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on April 06, 2009, 08:33:42 am
Ok fine.. I'll refrain from asking any question here from now on.
Title: Re: Difference -ogl_spec and -spec_exp
Post by: Zacam on April 06, 2009, 09:06:12 am
Reh? I am not understanding what the issue is then. But that is a rather dramatic way to decide you haven't gotten what you are after.

Perhaps further clarification would allow us to provide a better response.

Applied to the light itself means that it sets the overall factor for the lighting before it's effects on, with or by any other surfaces or means takes place.

The shaders and fixed render pipeline operate with-ogl_spec the same way, the shaders act with gl.FrontMaterialShininess, which it can derive adjusted values from the usage of -ogl_spec as well as the resultant light from -spec_exp.

Now mind, as I am not a coder, I could be wrong. But this is what I infer with what little OpenGL knowledge I have and a great deal of assumption.
Title: Re: Difference -ogl_spec and -spec_exp
Post by: KeldorKatarn on May 31, 2009, 07:29:54 am
Could anyone give a DEFINITE answer to this that REALLY clearifies this?
Title: Re: Difference -ogl_spec and -spec_exp
Post by: Zacam on May 31, 2009, 05:15:26 pm
Could anyone give a DEFINITE answer to this that REALLY clearifies this?

Apparently not. If taylors answer and my attempted exposition has not helped any, I don't know what will.