chiahsien / iphonewavefrontloader

Automatically exported from code.google.com/p/iphonewavefrontloader
1 stars 0 forks source link

Shininess value mis-interpreted #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Material files have been known to use Ns values (Shininess) values in the range 
of 0-1000.  The 
Wave front loader cleanly passes the value into openGL which uses a 0-128 value 
limit on this 
data.  Thusly, we need to ratio the data.  If anyone has shininess issues... 
here is the fix>>

Open:
OpenGLWaveFrontMaterial.m:65

Was:

else if ([parseLine hasPrefix:@"Ns "])
    material.shininess = [[parseLine substringFromIndex:3] floatValue];

Change To:

else if ([parseLine hasPrefix:@"Ns "])
    material.shininess = ([[parseLine substringFromIndex:3] floatValue] / 1000) * 128;

Kind Regards,
Chris Danielson
MaxPowerSoft, LLC

Original issue reported on code.google.com by danielsonchris@gmail.com on 17 Jun 2009 at 4:40