Skip to content

Commit 5f8b175

Browse files
committed
Added a drop shadow with blur radius (using guassian blur).
Made fixes to Blur/Bloom effect, users can now set whatever blur radius they want.
1 parent 38b723e commit 5f8b175

File tree

12 files changed

+582
-154
lines changed

12 files changed

+582
-154
lines changed

Resources/Images/output.png

14.2 KB
Loading

cocos2d-ios.xcodeproj/project.pbxproj

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,6 @@
261261
B7EE69E31819E75700B983FE /* CCLayoutBox.m in Sources */ = {isa = PBXBuildFile; fileRef = B7EE69DF1819E75700B983FE /* CCLayoutBox.m */; };
262262
B7EE6A1E181AE34600B983FE /* CCSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = B7EE6A1C181AE34600B983FE /* CCSlider.h */; };
263263
B7EE6A1F181AE34600B983FE /* CCSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = B7EE6A1D181AE34600B983FE /* CCSlider.m */; };
264-
D208E79F1993FEDA00BD8D6B /* CCEffectDropShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = D208E79C1993FEDA00BD8D6B /* CCEffectDropShadow.m */; };
265-
D208E7A01993FEDA00BD8D6B /* CCEffectDropShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = D208E79C1993FEDA00BD8D6B /* CCEffectDropShadow.m */; };
266-
D208E7AD19959A4800BD8D6B /* CCEffectOuterGlow.h in Headers */ = {isa = PBXBuildFile; fileRef = D208E7AB19959A4800BD8D6B /* CCEffectOuterGlow.h */; };
267-
D208E7AE19959A4800BD8D6B /* CCEffectOuterGlow.h in Headers */ = {isa = PBXBuildFile; fileRef = D208E7AB19959A4800BD8D6B /* CCEffectOuterGlow.h */; };
268-
D208E7AF19959A4800BD8D6B /* CCEffectOuterGlow.m in Sources */ = {isa = PBXBuildFile; fileRef = D208E7AC19959A4800BD8D6B /* CCEffectOuterGlow.m */; };
269-
D208E7B019959A4800BD8D6B /* CCEffectOuterGlow.m in Sources */ = {isa = PBXBuildFile; fileRef = D208E7AC19959A4800BD8D6B /* CCEffectOuterGlow.m */; };
270264
D23C5CB4194BC108007CA669 /* CCTouchIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = D23C5CB2194BC108007CA669 /* CCTouchIOS.h */; };
271265
D23C5CB5194BC108007CA669 /* CCTouchIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = D23C5CB3194BC108007CA669 /* CCTouchIOS.m */; };
272266
D23C5CBC194BC500007CA669 /* CCTouchAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = D23C5CBA194BC500007CA669 /* CCTouchAndroid.h */; };
@@ -330,6 +324,10 @@
330324
D272032C18FC89A000B100FF /* CCEffectNode.m in Sources */ = {isa = PBXBuildFile; fileRef = D272031F18FC89A000B100FF /* CCEffectNode.m */; };
331325
D272032D18FC89A000B100FF /* CCEffectStack.h in Headers */ = {isa = PBXBuildFile; fileRef = D272032018FC89A000B100FF /* CCEffectStack.h */; };
332326
D272032E18FC89A000B100FF /* CCEffectStack.m in Sources */ = {isa = PBXBuildFile; fileRef = D272032118FC89A000B100FF /* CCEffectStack.m */; };
327+
D27451AA19AD430A006DA0A1 /* CCEffectDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = D27451A819AD430A006DA0A1 /* CCEffectDropShadow.h */; };
328+
D27451AB19AD430A006DA0A1 /* CCEffectDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = D27451A819AD430A006DA0A1 /* CCEffectDropShadow.h */; };
329+
D27451AC19AD430A006DA0A1 /* CCEffectDropShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = D27451A919AD430A006DA0A1 /* CCEffectDropShadow.m */; };
330+
D27451AD19AD430A006DA0A1 /* CCEffectDropShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = D27451A919AD430A006DA0A1 /* CCEffectDropShadow.m */; };
333331
D285ECF0192EA92A009F4E88 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = D285ECEE192EA92A009F4E88 /* CCGLView.h */; };
334332
D285ECF1192EA92A009F4E88 /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = D285ECEF192EA92A009F4E88 /* CCGLView.m */; };
335333
D285ECF8192EF5B2009F4E88 /* CCDirectorAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = D285ECF6192EF5B2009F4E88 /* CCDirectorAndroid.h */; };
@@ -362,8 +360,6 @@
362360
D2DDB0A619805E8400233D80 /* CCQuaternion.m in Sources */ = {isa = PBXBuildFile; fileRef = D2DDB09119805E8400233D80 /* CCQuaternion.m */; };
363361
D2DDB0A719805E8400233D80 /* CCMatrix3.m in Sources */ = {isa = PBXBuildFile; fileRef = D2DDB09219805E8400233D80 /* CCMatrix3.m */; };
364362
D2DDB0A819805E8400233D80 /* CCMatrix3.m in Sources */ = {isa = PBXBuildFile; fileRef = D2DDB09219805E8400233D80 /* CCMatrix3.m */; };
365-
D2E8E1861999ABA2004F18DF /* CCEffectDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = D2F78CC71999AB6E00229357 /* CCEffectDropShadow.h */; };
366-
D2F78CC81999AB6E00229357 /* CCEffectDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = D2F78CC71999AB6E00229357 /* CCEffectDropShadow.h */; };
367363
D2EC6039199D9F82001A15E9 /* CCRendererGLSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = D36DFA2719996EC500DEC135 /* CCRendererGLSupport.m */; };
368364
D2FEB611194F6C9E00FC0574 /* CCBLocalizationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B7D273041822F4AA0054849B /* CCBLocalizationManager.h */; };
369365
D2FEB612194F6C9E00FC0574 /* CCAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 5018F2520DFDEAFF00C013A5 /* CCAction.h */; };
@@ -1015,9 +1011,6 @@
10151011
B7EE69DF1819E75700B983FE /* CCLayoutBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLayoutBox.m; sourceTree = "<group>"; };
10161012
B7EE6A1C181AE34600B983FE /* CCSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCSlider.h; path = "cocos2d-ui/CCSlider.h"; sourceTree = "<group>"; };
10171013
B7EE6A1D181AE34600B983FE /* CCSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCSlider.m; path = "cocos2d-ui/CCSlider.m"; sourceTree = "<group>"; };
1018-
D208E79C1993FEDA00BD8D6B /* CCEffectDropShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectDropShadow.m; sourceTree = "<group>"; };
1019-
D208E7AB19959A4800BD8D6B /* CCEffectOuterGlow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectOuterGlow.h; sourceTree = "<group>"; };
1020-
D208E7AC19959A4800BD8D6B /* CCEffectOuterGlow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectOuterGlow.m; sourceTree = "<group>"; };
10211014
D23C5CB2194BC108007CA669 /* CCTouchIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTouchIOS.h; sourceTree = "<group>"; };
10221015
D23C5CB3194BC108007CA669 /* CCTouchIOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTouchIOS.m; sourceTree = "<group>"; };
10231016
D23C5CBA194BC500007CA669 /* CCTouchAndroid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCTouchAndroid.h; path = Android/CCTouchAndroid.h; sourceTree = "<group>"; };
@@ -1058,6 +1051,8 @@
10581051
D272031F18FC89A000B100FF /* CCEffectNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectNode.m; sourceTree = "<group>"; };
10591052
D272032018FC89A000B100FF /* CCEffectStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectStack.h; sourceTree = "<group>"; };
10601053
D272032118FC89A000B100FF /* CCEffectStack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectStack.m; sourceTree = "<group>"; };
1054+
D27451A819AD430A006DA0A1 /* CCEffectDropShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectDropShadow.h; sourceTree = "<group>"; };
1055+
D27451A919AD430A006DA0A1 /* CCEffectDropShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectDropShadow.m; sourceTree = "<group>"; };
10611056
D285ECEE192EA92A009F4E88 /* CCGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCGLView.h; path = Android/CCGLView.h; sourceTree = "<group>"; };
10621057
D285ECEF192EA92A009F4E88 /* CCGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCGLView.m; path = Android/CCGLView.m; sourceTree = "<group>"; };
10631058
D285ECF6192EF5B2009F4E88 /* CCDirectorAndroid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDirectorAndroid.h; path = Android/CCDirectorAndroid.h; sourceTree = "<group>"; };
@@ -1079,7 +1074,6 @@
10791074
D2DDB09019805E8400233D80 /* CCVector2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCVector2.h; path = Platforms/Android/CCVector2.h; sourceTree = "<group>"; };
10801075
D2DDB09119805E8400233D80 /* CCQuaternion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCQuaternion.m; path = Platforms/Android/CCQuaternion.m; sourceTree = "<group>"; };
10811076
D2DDB09219805E8400233D80 /* CCMatrix3.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCMatrix3.m; path = Platforms/Android/CCMatrix3.m; sourceTree = "<group>"; };
1082-
D2F78CC71999AB6E00229357 /* CCEffectDropShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectDropShadow.h; sourceTree = "<group>"; };
10831077
D2FEB74F194F6C9E00FC0574 /* libcocos2dAndroid.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcocos2dAndroid.a; sourceTree = BUILT_PRODUCTS_DIR; };
10841078
D309054F18AC23110081BF11 /* CCRenderer_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderer_private.h; sourceTree = "<group>"; };
10851079
D31C794F19994126007921E1 /* CCMetalSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMetalSupport.m; sourceTree = "<group>"; };
@@ -1832,10 +1826,8 @@
18321826
9D856720191B019900573093 /* CCEffectContrast.m */,
18331827
9DF3761F191C594A00C6D27A /* CCEffectPixellate.h */,
18341828
9DF37620191C594A00C6D27A /* CCEffectPixellate.m */,
1835-
D2F78CC71999AB6E00229357 /* CCEffectDropShadow.h */,
1836-
D208E79C1993FEDA00BD8D6B /* CCEffectDropShadow.m */,
1837-
D208E7AB19959A4800BD8D6B /* CCEffectOuterGlow.h */,
1838-
D208E7AC19959A4800BD8D6B /* CCEffectOuterGlow.m */,
1829+
D27451A819AD430A006DA0A1 /* CCEffectDropShadow.h */,
1830+
D27451A919AD430A006DA0A1 /* CCEffectDropShadow.m */,
18391831
);
18401832
name = Effects;
18411833
sourceTree = "<group>";
@@ -1970,7 +1962,6 @@
19701962
B7705FE21831A07B0043CC67 /* ALCaptureDevice.h in Headers */,
19711963
5018F26F0DFDEAFF00C013A5 /* CCActionInstant.h in Headers */,
19721964
B7705FF21831A07B0043CC67 /* ALWrapper.h in Headers */,
1973-
D2F78CC81999AB6E00229357 /* CCEffectDropShadow.h in Headers */,
19741965
5018F2710DFDEAFF00C013A5 /* CCActionInterval.h in Headers */,
19751966
5018F2730DFDEAFF00C013A5 /* CCLabelTTF.h in Headers */,
19761967
5018F2750DFDEAFF00C013A5 /* CCNodeColor.h in Headers */,
@@ -1995,7 +1986,6 @@
19951986
B7705FF81831A07B0043CC67 /* OALSuspendHandler.h in Headers */,
19961987
D268FE0F198078FF00ECBCD0 /* CCEffectGlass.h in Headers */,
19971988
D24160FE1958F6EE003673BD /* CCAnimationManager.h in Headers */,
1998-
D208E7AD19959A4800BD8D6B /* CCEffectOuterGlow.h in Headers */,
19991989
50305AF40E40E33200F63373 /* cocos2d.h in Headers */,
20001990
D285ECF8192EF5B2009F4E88 /* CCDirectorAndroid.h in Headers */,
20011991
B7705FE81831A07B0043CC67 /* ALDevice.h in Headers */,
@@ -2090,6 +2080,7 @@
20902080
E0F924711224140400EF2362 /* CCTexturePVR.h in Headers */,
20912081
E0F92AC41224559800EF2362 /* CCNS.h in Headers */,
20922082
E02BB6D6126CA93A006E46A2 /* CCAnimationCache.h in Headers */,
2083+
D27451AA19AD430A006DA0A1 /* CCEffectDropShadow.h in Headers */,
20932084
5B063DD019637291002B1CDE /* ALWeakDictionary.h in Headers */,
20942085
E02BB704126CADEA006E46A2 /* CCAnimation.h in Headers */,
20952086
B7D273191822F4AA0054849B /* CCBuilderReader.h in Headers */,
@@ -2236,6 +2227,7 @@
22362227
D2FEB65F194F6C9E00FC0574 /* CCTexture.h in Headers */,
22372228
D2FEB660194F6C9E00FC0574 /* CCTiledMapLayer.h in Headers */,
22382229
D24161161958F738003673BD /* CCAnimationManager+FrameAnimation.h in Headers */,
2230+
D27451AB19AD430A006DA0A1 /* CCEffectDropShadow.h in Headers */,
22392231
D2FEB663194F6C9E00FC0574 /* ALListener.h in Headers */,
22402232
D2FEB664194F6C9E00FC0574 /* CCTiledMapObjectGroup.h in Headers */,
22412233
5BF32698195F947800D9A51A /* CCActivity.h in Headers */,
@@ -2285,9 +2277,7 @@
22852277
D2FEB68F194F6C9E00FC0574 /* ObjectALConfig.h in Headers */,
22862278
D2FEB690194F6C9E00FC0574 /* CCDirectorMac.h in Headers */,
22872279
D2FEB691194F6C9E00FC0574 /* CCGLView.h in Headers */,
2288-
D208E7AE19959A4800BD8D6B /* CCEffectOuterGlow.h in Headers */,
22892280
D2FEB692194F6C9E00FC0574 /* CCWindow.h in Headers */,
2290-
D2E8E1861999ABA2004F18DF /* CCEffectDropShadow.h in Headers */,
22912281
D2FEB693194F6C9E00FC0574 /* CCProgressNode.h in Headers */,
22922282
D2DDB09419805E8400233D80 /* CCMathUtilsAndroid.h in Headers */,
22932283
D2FEB694194F6C9E00FC0574 /* CCLayout.h in Headers */,
@@ -2509,10 +2499,8 @@
25092499
50F7B2790F28DE7C00057537 /* CCActionEase.m in Sources */,
25102500
571CD02919649E03003D460C /* CCPlatformTextField.m in Sources */,
25112501
D3A2E7D3181E12750033614C /* CCPhysicsShape.m in Sources */,
2512-
D208E79F1993FEDA00BD8D6B /* CCEffectDropShadow.m in Sources */,
25132502
B7705FE71831A07B0043CC67 /* ALContext.m in Sources */,
25142503
B7EE6A1F181AE34600B983FE /* CCSlider.m in Sources */,
2515-
D208E7AF19959A4800BD8D6B /* CCEffectOuterGlow.m in Sources */,
25162504
D37D197A18B6665700B23FDE /* CCTMXXMLParser.m in Sources */,
25172505
509A79980F6188420032F449 /* CCSprite.m in Sources */,
25182506
D37D197718B6665700B23FDE /* CCTiledMap.m in Sources */,
@@ -2597,6 +2585,7 @@
25972585
A0DA0BC415BCDCA200E80A92 /* CCDrawNode.m in Sources */,
25982586
B7705FF31831A07B0043CC67 /* ALWrapper.m in Sources */,
25992587
B7705FF91831A07B0043CC67 /* OALSuspendHandler.m in Sources */,
2588+
D27451AC19AD430A006DA0A1 /* CCEffectDropShadow.m in Sources */,
26002589
B7705FDB1831A07B0043CC67 /* OALAudioTracks.m in Sources */,
26012590
B7705FEE1831A07B0043CC67 /* ALSoundSourcePool.m in Sources */,
26022591
B7EE69E11819E75700B983FE /* CCLayout.m in Sources */,
@@ -2721,13 +2710,11 @@
27212710
D2FEB6FC194F6C9E00FC0574 /* CCPhysicsNode.m in Sources */,
27222711
D2FEB6FD194F6C9E00FC0574 /* CCGLView.m in Sources */,
27232712
D2FEB6FE194F6C9E00FC0574 /* CCLabelBMFont.m in Sources */,
2724-
D208E7A01993FEDA00BD8D6B /* CCEffectDropShadow.m in Sources */,
27252713
D2FEB701194F6C9E00FC0574 /* CCDirectorAndroid.m in Sources */,
27262714
D2FEB702194F6C9E00FC0574 /* CCGLView.m in Sources */,
27272715
D3903B18199528F3003AA81A /* CCEffectBlur.m in Sources */,
27282716
D2FEB703194F6C9E00FC0574 /* CCEffectBrightness.m in Sources */,
27292717
D24161171958F738003673BD /* CCAnimationManager+FrameAnimation.m in Sources */,
2730-
D208E7B019959A4800BD8D6B /* CCEffectOuterGlow.m in Sources */,
27312718
D2FEB705194F6C9E00FC0574 /* CCBKeyframe.m in Sources */,
27322719
D2FEB706194F6C9E00FC0574 /* CCTexturePVR.m in Sources */,
27332720
D2FEB707194F6C9E00FC0574 /* ALListener.m in Sources */,
@@ -2762,6 +2749,7 @@
27622749
D2DDB0A819805E8400233D80 /* CCMatrix3.m in Sources */,
27632750
D2FEB726194F6C9E00FC0574 /* ALSoundSourcePool.m in Sources */,
27642751
D2FEB727194F6C9E00FC0574 /* CCLayout.m in Sources */,
2752+
D27451AD19AD430A006DA0A1 /* CCEffectDropShadow.m in Sources */,
27652753
D2FEB728194F6C9E00FC0574 /* OALUtilityActions.m in Sources */,
27662754
D2FEB729194F6C9E00FC0574 /* CCClippingNode.m in Sources */,
27672755
D2FEB72B194F6C9E00FC0574 /* ccFPSImages.m in Sources */,

cocos2d-ui-tests/tests/CCEffectsTest.m

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,6 @@ -(id)init
1616
return self;
1717
}
1818

19-
-(void)setupOuterGlowEffectTest
20-
{
21-
self.subTitle = @"OuterGlow Effect Test";
22-
23-
// CCNodeColor* environment = [CCNodeColor nodeWithColor:[CCColor whiteColor]];
24-
CCSprite *environment = [CCSprite spriteWithImageNamed:@"Images/MountainPanorama.jpg"];
25-
environment.positionType = CCPositionTypeNormalized;
26-
environment.anchorPoint = ccp(0.5, 0.5);
27-
environment.position = ccp(0.5f, 0.5f);
28-
29-
[self.contentNode addChild:environment];
30-
31-
CCColor *glowColor = [CCColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:0.5];
32-
CCEffectOuterGlow* effect = [CCEffectOuterGlow effectWithGlowColor:glowColor];
33-
34-
CCSprite *sampleSprite = [CCSprite spriteWithImageNamed:@"Images/DistanceFieldX.png"];
35-
sampleSprite.position = ccp(0.5, 0.5);
36-
sampleSprite.positionType = CCPositionTypeNormalized;
37-
sampleSprite.effect = effect;
38-
39-
[self.contentNode addChild:sampleSprite];
40-
}
41-
4219
-(void)setupDropShadowEffectTest
4320
{
4421
self.subTitle = @"DropShadow Effect Test";
@@ -50,7 +27,7 @@ -(void)setupDropShadowEffectTest
5027
[self.contentNode addChild:environment];
5128

5229
CCColor *shadowColor = [CCColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:0.5];
53-
CCEffectDropShadow* effect = [CCEffectDropShadow effectWithShadowOffset:GLKVector2Make(2.0, -2.0) shadowColor:shadowColor];
30+
CCEffectDropShadow* effect = [CCEffectDropShadow effectWithShadowOffset:GLKVector2Make(2.0, -2.0) shadowColor:shadowColor blurRadius:5];
5431

5532
CCSprite *sampleSprite = [CCSprite spriteWithImageNamed:@"Images/Ohm.png"];
5633
sampleSprite.position = ccp(0.5, 0.5);
@@ -449,7 +426,7 @@ -(void)setupBloomEffectTest
449426
sampleSprite3.positionType = CCPositionTypeNormalized;
450427

451428
// Blend glow maps test
452-
CCEffectBloom* glowEffect3 = [CCEffectBloom effectWithBlurRadius:8 intensity:1.0f luminanceThreshold:1.0f - ((float)i/(float)(steps-1))];
429+
CCEffectBloom* glowEffect3 = [CCEffectBloom effectWithBlurRadius:3 intensity:1.0f luminanceThreshold:1.0f - ((float)i/(float)(steps-1))];
453430
sampleSprite3.effect = glowEffect3;
454431

455432
[self.contentNode addChild:sampleSprite3];
@@ -780,5 +757,32 @@ -(void)renderTextureHelper:(CCNode *)stage size:(CGSize)size
780757
]]];
781758
[node addChild:sprite];
782759
}
783-
@end
784760

761+
// Distance fields - work in progress
762+
763+
// WIP
764+
//-(void)setupOuterGlowEffectTest_dist
765+
//{
766+
// self.subTitle = @"OuterGlow Effect Test";
767+
//
768+
// // CCNodeColor* environment = [CCNodeColor nodeWithColor:[CCColor whiteColor]];
769+
// CCSprite *environment = [CCSprite spriteWithImageNamed:@"Images/MountainPanorama.jpg"];
770+
// environment.positionType = CCPositionTypeNormalized;
771+
// environment.anchorPoint = ccp(0.5, 0.5);
772+
// environment.position = ccp(0.5f, 0.5f);
773+
//
774+
// [self.contentNode addChild:environment];
775+
//
776+
// CCColor *glowColor = [CCColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:0.5];
777+
// CCEffectOuterGlow* effect = [CCEffectOuterGlow effectWithGlowColor:glowColor];
778+
//
779+
// CCSprite *sampleSprite = [CCSprite spriteWithImageNamed:@"Images/output.png"];
780+
// sampleSprite.position = ccp(0.5, 0.5);
781+
// sampleSprite.positionType = CCPositionTypeNormalized;
782+
// sampleSprite.effect = effect;
783+
// sampleSprite.scale = 2.0f;
784+
//
785+
// [self.contentNode addChild:sampleSprite];
786+
//}
787+
788+
@end

0 commit comments

Comments
 (0)