Hi guys,
Him currently trying to finish my cocos3D project but I'm having some trouble with the lighting. The problem is that, on the device, the lighting is really bad.
As you can see, the first picture is from 3D's max and the second is from my iphone app, the lighting is really bad.
http://prntscr.com/ly378
http://prntscr.com/ly2io
I manually add my spots and the ambiant light.
Here is all my lighting code :
_spot = [CC3Light lightWithName: @"Spot" withLightIndex: 0];
// Set the ambient scene lighting.
ccColor4F ambientColor = { 1, 1, 1, 1 };
self.ambientLight = ambientColor;
//Positioning
_spot.target = [self getNodeNamed:kCharacterName];
_spot.location = cc3v( 400, 400, -600 );
// Adjust the relative ambient and diffuse lighting of the main light to
// improve realisim, particularly on shadow effects.
_spot.diffuseColor = CCC4FMake(0.8, 0.8, 0.8, 1.0);
_spot.specularColor = CCC4FMake(0, 0, 0, 1);
[_spot setAttenuationCoefficients:CC3AttenuationCoefficientsMake(0, 0, 1)];
// Another mechansim for adjusting shadow intensities is shadowIntensityFactor.
// For better effect, set here to a value less than one to lighten the shadows
// cast by the main light.
_spot.shadowIntensityFactor = 0.75;
[self addChild:_spot];
_spot2 = [CC3Light lightWithName: @"Spot2" withLightIndex: 1];
//Positioning
_spot2.target = [self getNodeNamed:kCharacterName];
_spot2.location = cc3v( -550, 400, -800 );
_spot2.diffuseColor = CCC4FMake(0.8, 0.8, 0.8, 1.0);
_spot2.specularColor = CCC4FMake(0, 0, 0, 1);
[_spot2 setAttenuationCoefficients:CC3AttenuationCoefficientsMake(0, 0, 1)];
_spot2.shadowIntensityFactor = 0.75;
[self addChild:_spot2];
I was wondering, is it possible to change or add something to have a better lighting?