Ensure that gloss input in material dictionaries is always clamped between 0.0 and 1.0.
parent
1e73156d2e
commit
0509f8d8c0
|
@ -568,7 +568,7 @@ static void SynthSpecular(OOMaterialSynthContext *context)
|
|||
else specularColor = [context->inConfig oo_specularColor];
|
||||
if ([specularColor isBlack]) return;
|
||||
|
||||
SetUniformFloat(context, @"uGloss", [context->inConfig oo_gloss]);
|
||||
SetUniformFloat(context, @"uGloss", gloss);
|
||||
|
||||
[context->outConfig setObject:[NSNumber numberWithUnsignedInt:shininess] forKey:kOOMaterialSpecularExponentLegacyName];
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ NSString * const kOOMaterialLightMapsName = @"light_map";
|
|||
|
||||
- (float) oo_gloss
|
||||
{
|
||||
return [self oo_floatForKey:kOOMaterialGlossName defaultValue:0.375f];
|
||||
return OOClamp_0_1_f([self oo_floatForKey:kOOMaterialGlossName defaultValue:0.375f]);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue