Fixed shader gloss and ior uniforms overriding material definitions of the same. Now both shaders and materials definitions of those uniforms should work nicwly together.
parent
10df924f5d
commit
23af0abaa6
|
@ -260,13 +260,19 @@ static NSString *MacrosToString(NSDictionary *macros);
|
|||
if (OK)
|
||||
{
|
||||
// write gloss and index of refraction to the uniforms dictionary
|
||||
|
||||
float gloss = OOClamp_0_1_f([configuration oo_floatForKey:@"gloss" defaultValue:0.5f]);
|
||||
[self setUniform:@"uGloss" floatValue:gloss];
|
||||
|
||||
float ior = [configuration oo_floatForKey:@"ior" defaultValue:1.0f];
|
||||
if (ior <= 0.0f) ior = 0.001f;
|
||||
[self setUniform:@"uIOR" floatValue:ior];
|
||||
if (![uniforms objectForKey:@"uGloss"])
|
||||
{
|
||||
float gloss = OOClamp_0_1_f([configuration oo_floatForKey:@"gloss" defaultValue:0.5f]);
|
||||
[self setUniform:@"uGloss" floatValue:gloss];
|
||||
}
|
||||
|
||||
if (![uniforms objectForKey:@"uIOR"])
|
||||
{
|
||||
float ior = [configuration oo_floatForKey:@"ior" defaultValue:1.0f];
|
||||
if (ior <= 0.0f) ior = 0.001f;
|
||||
[self setUniform:@"uIOR" floatValue:ior];
|
||||
}
|
||||
}
|
||||
|
||||
if (!OK)
|
||||
|
|
Loading…
Reference in New Issue