|
32 | 32 | */
|
33 | 33 | @property (nonatomic) CCSpriteFrame *normalMap;
|
34 | 34 |
|
| 35 | +/** The overall shininess of the attached sprite. This value is in the range [0..1] and it controls |
| 36 | + * how much of the reflected environment contributes to the final color of the affected pixels. |
| 37 | + */ |
| 38 | +@property (nonatomic) float shininess; |
| 39 | + |
35 | 40 | /** The bias term in the fresnel reflectance equation:
|
36 | 41 | * reflectance = max(0.0, fresnelBias + (1 - fresnelBias) * pow((1 - nDotV), fresnelPower))
|
37 | 42 | * This value is in the range [0..1] and it controls the constant (view angle independent) contribution
|
|
63 | 68 | * Initializes a CCEffectReflection object with the specified environment and normal map and the following default parameters:
|
64 | 69 | * fresnelBias = 1.0, fresnelPower = 0.0, normalMap = nil
|
65 | 70 | *
|
| 71 | + * @param shininess The overall shininess of the effect. |
66 | 72 | * @param environment The environment image that will be reflected by the affected node.
|
67 | 73 | *
|
68 | 74 | * @return The CCEffectReflection object.
|
69 | 75 | */
|
70 |
| --(id)initWithEnvironment:(CCSprite *)environment; |
| 76 | +-(id)initWithShininess:(float)shininess environment:(CCSprite *)environment; |
71 | 77 |
|
72 | 78 | /**
|
73 | 79 | * Initializes a CCEffectReflection object with the specified environment and normal map and the following default parameters:
|
74 | 80 | * fresnelBias = 1.0, fresnelPower = 0.0
|
75 | 81 | *
|
| 82 | + * @param shininess The overall shininess of the effect. |
76 | 83 | * @param environment The environment image that will be reflected by the affected node.
|
77 | 84 | * @param normalMap The normal map of the affected node. This can also be specified as a property of the affected sprite.
|
78 | 85 | *
|
79 | 86 | * @return The CCEffectReflection object.
|
80 | 87 | */
|
81 |
| --(id)initWithEnvironment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap; |
| 88 | +-(id)initWithShininess:(float)shininess environment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap; |
82 | 89 |
|
83 | 90 | /**
|
84 | 91 | * Initializes a CCEffectReflection object with the specified parameters and a nil normal map.
|
85 | 92 | *
|
| 93 | + * @param shininess The overall shininess of the effect. |
86 | 94 | * @param bias The bias term in the fresnel reflectance equation.
|
87 | 95 | * @param power The power term in the fresnel reflectance equation.
|
88 | 96 | * @param environment The environment image that will be reflected by the affected node.
|
89 | 97 | *
|
90 | 98 | * @return The CCEffectReflection object.
|
91 | 99 | */
|
92 |
| --(id)initWithFresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment; |
| 100 | +-(id)initWithShininess:(float)shininess fresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment; |
93 | 101 |
|
94 | 102 | /**
|
95 | 103 | * Initializes a CCEffectReflection object with the specified parameters.
|
96 | 104 | *
|
| 105 | + * @param shininess The overall shininess of the effect. |
97 | 106 | * @param bias The bias term in the fresnel reflectance equation.
|
98 | 107 | * @param power The power term in the fresnel reflectance equation.
|
99 | 108 | * @param environment The environment image that will be reflected by the affected node.
|
100 | 109 | * @param normalMap The normal map of the affected node. This can also be specified as a property of the affected sprite.
|
101 | 110 | *
|
102 | 111 | * @return The CCEffectReflection object.
|
103 | 112 | */
|
104 |
| --(id)initWithFresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap; |
| 113 | +-(id)initWithShininess:(float)shininess fresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap; |
105 | 114 |
|
106 | 115 |
|
107 | 116 | /// -----------------------------------------------------------------------
|
|
112 | 121 | * Creates a CCEffectReflection object with the specified environment and the following default parameters:
|
113 | 122 | * fresnelBias = 1.0, fresnelPower = 0.0, normalMap = nil
|
114 | 123 | *
|
| 124 | + * @param shininess The overall shininess of the effect. |
115 | 125 | * @param environment The environment image that will be reflected by the affected node.
|
116 | 126 | *
|
117 | 127 | * @return The CCEffectReflection object.
|
118 | 128 | */
|
119 |
| -+(id)effectWithEnvironment:(CCSprite *)environment; |
| 129 | ++(id)effectWithShininess:(float)shininess environment:(CCSprite *)environment; |
120 | 130 |
|
121 | 131 | /**
|
122 | 132 | * Creates a CCEffectReflection object with the specified environment and normal map and the following default parameters:
|
123 | 133 | * fresnelBias = 1.0, fresnelPower = 0.0
|
124 | 134 | *
|
| 135 | + * @param shininess The overall shininess of the effect. |
125 | 136 | * @param environment The environment image that will be reflected by the affected node.
|
126 | 137 | * @param normalMap The normal map of the affected node. This can also be specified as a property of the affected sprite.
|
127 | 138 | *
|
128 | 139 | * @return The CCEffectReflection object.
|
129 | 140 | */
|
130 |
| -+(id)effectWithEnvironment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap; |
| 141 | ++(id)effectWithShininess:(float)shininess environment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap; |
131 | 142 |
|
132 | 143 | /**
|
133 | 144 | * Creates a CCEffectReflection object with the specified parameters and nil normal map.
|
134 | 145 | *
|
| 146 | + * @param shininess The overall shininess of the effect. |
135 | 147 | * @param bias The bias term in the fresnel reflectance equation.
|
136 | 148 | * @param power The power term in the fresnel reflectance equation.
|
137 | 149 | * @param environment The environment image that will be reflected by the affected node.
|
138 | 150 | *
|
139 | 151 | * @return The CCEffectReflection object.
|
140 | 152 | */
|
141 |
| -+(id)effectWithFresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment; |
| 153 | ++(id)effectWithShininess:(float)shininess fresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment; |
142 | 154 |
|
143 | 155 | /**
|
144 | 156 | * Creates a CCEffectReflection object with the specified parameters.
|
145 | 157 | *
|
| 158 | + * @param shininess The overall shininess of the effect. |
146 | 159 | * @param bias The bias term in the fresnel reflectance equation.
|
147 | 160 | * @param power The power term in the fresnel reflectance equation.
|
148 | 161 | * @param environment The environment image that will be reflected by the affected node.
|
149 | 162 | * @param normalMap The normal map of the affected node. This can also be specified as a property of the affected sprite.
|
150 | 163 | *
|
151 | 164 | * @return The CCEffectReflection object.
|
152 | 165 | */
|
153 |
| -+(id)effectWithFresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap; |
| 166 | ++(id)effectWithShininess:(float)shininess fresnelBias:(float)bias fresnelPower:(float)power environment:(CCSprite *)environment normalMap:(CCSpriteFrame *)normalMap; |
154 | 167 |
|
155 | 168 | @end
|
0 commit comments