Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoEnvironment.h
Go to the documentation of this file.
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Paul S. Strauss (MMM yyyy)
25**=======================================================================*/
26/*=======================================================================
27 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
28 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
29 *** ***
30 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
31 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
32 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
33 *** ***
34 *** RESTRICTED RIGHTS LEGEND ***
35 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
36 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
37 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
38 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
39 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
40 *** ***
41 *** COPYRIGHT (C) 1996-2021 BY FEI S.A.S, ***
42 *** BORDEAUX, FRANCE ***
43 *** ALL RIGHTS RESERVED ***
44**=======================================================================*/
45/*=======================================================================
46** Modified by : VSG (MMM YYYY)
47**=======================================================================*/
48
49
50#ifndef _SO_ENVIRONMENT_
51#define _SO_ENVIRONMENT_
52
60
62//
63// Class: SoEnvironment
64//
65// Node that describes global environmental attributes such as
66// ambient lighting, light attenuation, and fog.
67//
68// Ambient lighting is the amount of extra light impinging on each
69// surface point when computing Phong lighting.
70//
71// Light attenuation affects all subsequent lights in a scene. It is
72// a quadratic function of distance from a light source to a surface
73// point. The three coefficients are specified in the attenuation
74// field. Attenuation works only for light sources with a fixed
75// location, such as point and spot lights.
76//
77// Fog has one of four types, each of which blends each surface point
78// with the specified fog color. Each type interprets the visibility
79// field to be the distance at which fog totally obscures objects. A
80// visibility value of 0 (the default) causes the SoEnvironment node
81// to set up fog so that the visibility is the distance to the far
82// clipping plane of the current camera.
83//
84// Note that this node has effect only during rendering, and that it
85// does not inherit field values from other SoEnvironment nodes.
86//
88
163class SoEnvironment : public SoNode {
164
166
167 public:
187
188 // Fields
189
200
212
224
237
250
274
279
284 inline virtual void setOverride(const SbBool state)
285 { override.setValue(state); }
286
290 inline virtual SbBool isOverride() const
291 { return override.getValue(); }
292
293 private:
294 // Only rendering is implemented, since this node has no other effects
295 virtual void GLRender(SoGLRenderAction *action);
296 virtual void callback(SoCallbackAction *action);
297 virtual void doAction(SoAction *action);
298
299 private:
300 static void initClass();
301 static void exitClass();
302
303 SoSFBool override;
304
305 private:
306 virtual ~SoEnvironment();
307
308};
309
310#endif /* _SO_ENVIRONMENT_ */
311
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
Abstract base class for all actions.
Definition SoAction.h:132
Performs a generic traversal of a scene graph or path.
Global environment node.
SoSFFloat ambientOcclusionIntensity
Intensity of ambient occlusion: the higher the value, the darker the scene.
SoSFFloat ambientOcclusionRadius
Specifies the radius of the "sphere" (in world space) beyond which the ambient occlusion has no more ...
SoEnvironment()
Creates an environment node with default settings.
SoSFColor ambientColor
RGB color of ambient lighting (for Phong lighting).
virtual SbBool isOverride() const
Returns the state of the overridden field.
SoSFFloat fogVisibility
Fog visibility distance, which is the distance at which fog totally obscures objects.
SoSFBool ambientOcclusion
If set to TRUE, ambient occlusion is activated.
FogType
Type of fog.
@ FOG
Exponential increase in opacity.
@ HAZE
Linear increase in opacity with distance.
@ SMOKE
Exponential squared increase in opacity.
SoSFFloat ambientIntensity
Intensity of ambient light (for Phong lighting).
SoSFEnum fogType
Type of fog.
SoSFColor fogColor
Fog color.
SoSFVec3f attenuation
Squared, linear, and constant light attenuation coefficients (in that order).
virtual void setOverride(const SbBool state)
Sets the state of the overridden field.
SoSFFloat fogStart
Distance at which the linear fog HAZE starts to be applied.
Renders a scene graph using Open Inventor's Render Engine.
Abstract base class for all database nodes.
Definition SoNode.h:145
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an RGB color.
Definition SoSFColor.h:82
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
Field containing a three-dimensional vector.
Definition SoSFVec3f.h:80
int SbBool
Boolean type.
Definition SbBase.h:87