iOS Developer Library

Developer

GLKit Framework Reference GLKEffectPropertyFog Class Reference

Options
Deployment Target:

On This Page
Language:

GLKEffectPropertyFog

Inheritance


Conforms To


Import Statement


Swift

import GLKit

Objective-C

@import GLKit;

Availability


Available in iOS 5.0 and later.

The GLKEffectPropertyFog class defines properties used to configure how fog is applied to an effect. These properties are specifically designed to mimic the fog calculations provided by OpenGL ES 1.1.

When fog is enabled, the fog component is calculated and clamped to a range from 0.0 to 1.0. Then, the fog value is used as a blending factor between the computed fragment color and the fog color.

  • enabled enabled Property

    A Boolean value that indicates whether fog is applied to the fragment color.

    Declaration

    Swift

    var enabled: GLboolean

    Objective-C

    @property(nonatomic, assign) GLboolean enabled

    Discussion

    If the value of this property is GL_TRUE, then fog calculations are performed each time a fragment is computed. If the value of this property is GL_FALSE, then fog calculations are skipped. The default value is GL_TRUE.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • mode mode Property

    The algorithm used to compute the density of the fog applied to the fragment color.

    Declaration

    Swift

    var mode: GLint

    Objective-C

    @property(nonatomic, assign) GLint mode

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    “GLKFogMode”

  • color color Property

    The color of the fog at maximum density.

    Declaration

    Swift

    var color: GLKVector4

    Objective-C

    @property(nonatomic, assign) GLKVector4 color

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • density density Property

    The rate at which the fog exponent increases.

    Declaration

    Swift

    var density: GLfloat

    Objective-C

    @property(nonatomic, assign) GLfloat density

    Discussion

    This property is ignored when the mode property is set to GLKFogModeLinear.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • start start Property

    The minimum distance in eye coordinates before fog is applied to the fragment color.

    Declaration

    Swift

    var start: GLfloat

    Objective-C

    @property(nonatomic, assign) GLfloat start

    Discussion

    This property is ignored when the mode property is set to GLKFogModeExp or GLKFogModeExp2.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • end end Property

    The distance in eye coordinates where fog completely covers the color fragment.

    Declaration

    Swift

    var end: GLfloat

    Objective-C

    @property(nonatomic, assign) GLfloat end

    Discussion

    This property is ignored when the mode property is set to GLKFogModeExp or GLKFogModeExp2.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • A mode that describes how the fog component is calculated for the fragment.

    Declaration

    Swift

    enum GLKFogMode : GLint { case Exp case Exp2 case Linear }

    Objective-C

    typedef enum GLKFogMode : GLint { GLKFogModeExp =0, GLKFogModeExp2, GLKFogModeLinear } GLKFogMode;

    Constants

    • Exp

      GLKFogModeExp

      The fog component is calculated as exp(-density * distance) and clamped to the range [0.0, 1.0].

      Available in iOS 5.0 and later.

    • Exp2

      GLKFogModeExp2

      The fog component is calculated as exp(-(density * distance)^2) and clamped to the range [0.0, 1.0].

      Available in iOS 5.0 and later.

    • Linear

      GLKFogModeLinear

      The fog component is calculated as (end - distance) / (end - start) and clamped to the range [0.0, 1.0].

      Available in iOS 5.0 and later.

    Import Statement

    Objective-C

    @import GLKit;

    Swift

    import GLKit

    Availability

    Available in iOS 7.0 and later.