gloss and ior are now valid keys also in shader material dictionaries.
This commit is contained in:
parent
5232e0a993
commit
360fc66373
@ -91,6 +91,9 @@ extern NSString * const kOOMaterialEmissionAndIlluminationMapName;
|
||||
extern NSString * const kOOMaterialParallaxScaleName;
|
||||
extern NSString * const kOOMaterialParallaxBiasName;
|
||||
|
||||
extern NSString * const kOOMaterialIORName;
|
||||
extern NSString * const kOOMaterialGlossName;
|
||||
|
||||
extern NSString * const kOOMaterialSpecularExponentName;
|
||||
extern NSString * const kOOMaterialSpecularExponentLegacyName;
|
||||
|
||||
|
@ -77,6 +77,8 @@ typedef uint16_t OOUniformConvertOptions;
|
||||
dictionaries containing:
|
||||
type "int", "texture" or "float"
|
||||
value number
|
||||
gloss gloss value of material, float between 0.0 and 1.0, defaults to 0.5
|
||||
ior index of refraction of material, positive float, defaults to 1.0
|
||||
|
||||
Macros is a dictionary which is converted to macro definitions and
|
||||
prepended to shader source code. It should be used to specify the
|
||||
|
@ -257,6 +257,18 @@ static NSString *MacrosToString(NSDictionary *macros);
|
||||
[self addTexturesFromArray:textureArray unitCount:textureUnits];
|
||||
}
|
||||
|
||||
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 (!OK)
|
||||
{
|
||||
[self release];
|
||||
|
Loading…
x
Reference in New Issue
Block a user