|
From: Roger H. <rog...@mi...> - 2007-04-27 20:14:47
|
On 27 Apr, 2007, at 13:45, Jose' Cruanyes wrote:
>
> Il giorno 27/apr/07, alle ore 12:30, Roger Holmes ha scritto:
>
>>
>> Well done! But please can you explain.
>>
>> With other renderers a specular control of 200 is matt, and a
>> specular control of 0.2 is gloss.
>>
>> Not only are the values bigger, they are also inverted.
>>
>> Can't we make these compatible with other renderers?
>>
>
> mmm which other renderers?
The Quesa Interactive renderer, the QuickDraw3D Interactive renderer =20
and the Microspot renderer.
> I'm taking those values going back and forth from the values passed
> in the open GL renderer in GL_SHININESS (it's not the same, I know,
> but is clese anough)
So if you have a matt object and a glossy object and switch between =20
the interactive render and RayShade, do they look (about) the same?
>
> I want the parameters in the geometry were used untouched by every
> renderer, but I can be wrong - (not tested too much indeed)
I don't quite get your meaning.
>
> this parameter controls how big is the reflection light spot on the
> figure.
>
> in GL it goes from
>
> 0 (no spot (because too big) and hence rough and hence not reflecting)
> to
> 128 (pointy spot, hence polish hence reflecting)
Is it the other way round perhaps?
>
> in Rayshade it goes from
> 0 no reflecting
> to
> 100 perfect mirror
>
> seems obvious to map rayshade =3D GL_SHININESS / 1.28
>
> now lets map this to Quesa specular control values (that BTW defaults
> to 4)
>
> the mapping between Quesa-OGl is done in GLUtils.c 419:441
>
> --8<------8<------8<------8<------8<------8<------8<------8<------8<--=20=
> --
> --8<------8<------8<----
>
> //
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
> =3D=3D
> =3D=3D=3D=3D=3D
> // GLUtils_SpecularControlToGLShininess :
> // Map Quesa specular control to =
OpenGL shininess.
> //--------------------------------------------------------------------=20=
> --
> -------
> // This function was arrived at heuristically, but notice =
several
> properties:
> // 1. as long as specularControl >=3D 0, shininess >=3D 0.
> // 2. as specularControl increases, shininess increases.
> // 3. as specularControl tends to infinity, shininess =
approaches 128
> (the maximum
> // allowed by OpenGL).
> GLfloat GLUtils_SpecularControlToGLShininess( float =
inSpecControl )
> {
> GLfloat shininess;
> =09
> if (inSpecControl < 0.0f)
> inSpecControl =3D 0.0f;
>
>
> shininess =3D 128.0f - (20.0f * 128.0f)/(inSpecControl + 20.0f);
> =09
> return shininess;
> }
>
> --8<------8<------8<------8<------8<------8<------8<------8<------8<--=20=
> --
> --8<------8<-----
>
> the default 4 value of specularControl, maps to 21 of shininess
> but 17 is too reflecting for a default value, so instead of do a
> linear interpolation, I've adjusted the curve of translation to
>
> result->reflect =3D (128.0f - (100.0f * 128.0f)/(data-
>> specularControl + 100.0f))*0.008;
>
> of course all this reasoning is genuine out of my a**, so it can be
> discussed
>
>
> Pax et Bonum
>
> # Dott. Jos=E9 Cruanyes Aguilar - C.E. Soft srl
> # Pzza. Firenze,4 MILANO - XX Settembre 10, CREMONA
> # 02,3923101 0372,460602
>
>
>
> ----------------------------------------------------------------------=20=
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Quesa-develop mailing list
> Que...@li...
> https://lists.sourceforge.net/lists/listinfo/quesa-develop
|