Shininess Table

Post Reply
Scribe
Posts: 6
Joined: Tue Nov 02, 2010 1:52 am

Shininess Table

Post by Scribe » Sun Dec 19, 2010 12:13 am

Hi guys,

I'm finding myself wanting to port a standard shininess exponent over to the shininess table, what's the formula I should be applying? (what does each location in the table represent - what are the lookup factors?)

Many thanks

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: Shininess Table

Post by zeromus » Sun Dec 19, 2010 2:45 am

i am a little disturbed that you havent looked for it in gbatek yet:

Code: Select all

  IF TexCoordTransformMode=2 THEN TexCoord=NormalVector*Matrix (see TexCoord)
  NormalVector=NormalVector*DirectionalMatrix
  VertexColor = EmissionColor
  FOR i=0 to 3
   IF PolygonAttrLight[i]=enabled THEN
    DiffuseLevel = max(0,-(LightVector[i]*NormalVector))
    ShininessLevel = max(0,(-HalfVector[i])*(NormalVector))^2
    IF TableEnabled THEN ShininessLevel = ShininessTable[ShininessLevel]
    ;note: below processed separately for the R,G,B color components...
    VertexColor = VertexColor + SpecularColor*LightColor[i]*ShininessLevel
    VertexColor = VertexColor + DiffuseColor*LightColor[i]*DiffuseLevel
    VertexColor = VertexColor + AmbientColor*LightColor[i]
   ENDIF
  NEXT i
But I believe gbatek is wrong,

http://desmume.svn.sourceforge.net/view ... iew=markup (line 1179) gives me better results

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests