Fixed lack of specular mapping on default-shader objects in reduced detail mode, then limited default-shader materials to three texture maps in reduced detail mode. Who uses reduced detail mode and shaders anyway? Reduced detail mode.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3428 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2010-05-29 19:09:34 +00:00
parent 4f9b0a21d5
commit 01afc05c13
5 changed files with 24 additions and 6 deletions

View File

@ -98,4 +98,10 @@ SOFTWARE.
- (uint8_t)shininess;
- (void)setShininess:(uint8_t)value; // Clamped to [0, 128]
/* For subclasses: return true to permit specular settings, false to deny
them. By default, this is ![UNIVERSE reducedDetail].
*/
- (BOOL) permitSpecular;
@end

View File

@ -78,7 +78,7 @@ static OOBasicMaterial *sDefaultMaterial = nil;
if (colorDesc != nil) [self setEmissionColor:[OOColor colorWithDescription:colorDesc]];
shininessVal = [configuration oo_shininess];
if (shininessVal != 0 && ![UNIVERSE reducedDetail])
if (shininessVal != 0 && [self permitSpecular])
{
colorDesc = [configuration oo_specularColor];
[self setShininess:shininessVal];
@ -331,4 +331,10 @@ static OOBasicMaterial *sDefaultMaterial = nil;
shininess = MIN(value, 128);
}
- (BOOL) permitSpecular
{
return ![UNIVERSE reducedDetail];
}
@end

View File

@ -89,6 +89,11 @@ static void SynthSpecular(OOMaterialSynthContext *context);
.uniforms = [NSMutableDictionary dictionary]
};
if ([UNIVERSE reducedDetail])
{
context.maxTextures = 3;
}
// Basic stuff.
/* Set up the various material attributes.

View File

@ -656,6 +656,12 @@ static NSString *MacrosToString(NSDictionary *macros);
bindingTarget = [target weakRetain];
}
- (BOOL) permitSpecular
{
return YES;
}
@end

View File

@ -791,11 +791,6 @@ shaderBindingTarget:(id<OOWeakReferenceSupport>)target
_shaderMacros = [macros copy];
_shaderBindingTarget = [target weakRetain];
if ([name isEqualToString:@"new_coriolis.dat"])
{
OOLog(@"temp", @"Caught a coriolis");
}
[self rebindMaterials];
PROFILE(@"finished material setup");