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.
This commit is contained in:
parent
10df924f5d
commit
23af0abaa6
@ -260,13 +260,19 @@ static NSString *MacrosToString(NSDictionary *macros);
|
|||||||
if (OK)
|
if (OK)
|
||||||
{
|
{
|
||||||
// write gloss and index of refraction to the uniforms dictionary
|
// 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 (![uniforms objectForKey:@"uGloss"])
|
||||||
if (ior <= 0.0f) ior = 0.001f;
|
{
|
||||||
[self setUniform:@"uIOR" floatValue:ior];
|
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)
|
if (!OK)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user