#import <CC3UtilityMeshNodes.h>
Class Methods | |
(id) | + fog |
CC3Fog is a mesh node that can render fog in the 3D scene.
Typically, instances of this class are not generally used within the node assembly of a scene. Instead, a single instance of this class is used in the fog property of the CC3Scene.
Fog color is controlled by the diffuseColor property.
The style of attenuation imposed by the fog is set by the attenuationMode property. See the notes of that property for information about how fog attenuates visibility.
Using the performanceHint property, you can direct the GL engine to trade off between faster or nicer rendering quality.
Under OpenGL ES 1.1, fog is implemented as a direct feature of the GL engine, and this class establishes the GL state for that fog.
Under OpenGL versions that support GLSL, fog is rendered as a post-processing effect, typically by rendering the scene to a surface that has both color and depth textures. Add the color and depth textures from the scene-rendering surface to this node, and a shader program that can render the node in clip-space, and provide fog effects. A good choice is the combination of the CC3ClipSpaceTexturable.vsh vertex shader and the CC3Fog.fsh fragment shader.
+ (id) fog |
Allocates and initializes an autoreleased instance.
- (void) update: | (CCTime) | __deprecated |
|
readwritenonatomicassign |
|
readwritenonatomicassign |
Indicates how the fog attenuates visibility with distance.
The value of this property must be one of the following sybolic constants: GL_LINEAR, GL_EXP or GL_EXP2.
When the value of this property is GL_LINEAR, the relative visibility of an object in the fog will be determined by the linear function ((e - z) / (e - s)), where s is the value of the start property, e is the value of the end property, and z is the distance of the object from the camera
When the value of this property is GL_EXP, the relative visibility of an object in the fog will be determined by the exponential function e^(-(d - z)), where d is the value of the density property and z is the distance of the object from the camera.
When the value of this property is GL_EXP2, the relative visibility of an object in the fog will be determined by the exponential function e^(-(d - z)^2), where d is the value of the density property and z is the distance of the object from the camera.
The initial value of this property is GL_EXP2.
|
readwritenonatomicassign |
The density value used in the exponential functions.
This property is only used when the attenuationMode property is set to GL_EXP or GL_EXP2.
See the description of the attenuationMode for a discussion of how the exponential functions determine visibility.
The initial value of this property is 1.0.
|
readwritenonatomicassign |
The distance from the camera, at which linear attenuation ends.
Objects between this distance and the far clipping plane of the camera will be completely obscured.
This property is only used when the attenuationMode property is set to GL_LINEAR.
See the description of the attenuationMode for a discussion of how the linear function determine visibility.
The initial value of this property is 1.0.
|
readwritenonatomicassign |
Indicates how the GL engine should trade off between rendering quality and speed.
The value of this property should be one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE.
The initial value of this property is GL_DONT_CARE.
|
readwritenonatomicassign |
The distance from the camera, at which linear attenuation starts.
Objects between this distance and the near clipping plane of the camera will be completly visible.
This property is only used when the attenuationMode property is set to GL_LINEAR.
See the description of the attenuationMode for a discussion of how the linear function determine visibility.
The initial value of this property is 0.0.