Graphite  Version 3
An experimental 3D geometry processing program
ambient_occlusion.h
Go to the documentation of this file.
1 /*
2  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
3  * Copyright (C) 2000 Bruno Levy
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  * If you modify this software, you should include a notice giving the
20  * name of the person performing the modification, the date of modification,
21  * and the reason for such modification.
22  *
23  * Contact: Bruno Levy
24  *
25  * levy@loria.fr
26  *
27  * ISA Project
28  * LORIA, INRIA Lorraine,
29  * Campus Scientifique, BP 239
30  * 54506 VANDOEUVRE LES NANCY CEDEX
31  * FRANCE
32  *
33  * Note that the GNU General Public License does not permit incorporating
34  * the Software into proprietary programs.
35  */
36 
37 #ifndef H_OGF_SCENE_GRAPH_GFX_FULL_SCREEN_EFFECTS_AO_H
38 #define H_OGF_SCENE_GRAPH_GFX_FULL_SCREEN_EFFECTS_AO_H
39 
40 #include <OGF/scene_graph_gfx/common/common.h>
43 
49 namespace OGF {
50 
54  gom_class SCENE_GRAPH_GFX_API AmbientOcclusion : public FullScreenEffect {
55  public:
61 
66 
67  gom_properties:
68 
72  index_t get_lightness() const {
73  return impl_->get_lightness();
74  }
75 
79  void set_lightness(index_t value) {
80  impl_->set_lightness(value);
81  update();
82  }
83 
88  return impl_->get_contrast();
89  }
90 
94  void set_contrast(index_t value) {
95  impl_->set_contrast(value);
96  update();
97  }
98 
102  gom_attribute(help, "Size (in pixels) of the Gaussian blur kernel")
103  index_t get_blur_width() const {
104  return impl_->get_blur_width();
105  }
106 
110  void set_blur_width(index_t value) {
111  impl_->set_blur_width(value);
112  update();
113  }
114 
118  gom_attribute(help, "The higher, the better (but the slower !!)")
119  index_t get_nb_directions() const {
120  return impl_->get_nb_directions();
121  }
122 
127  impl_->set_nb_directions(value);
128  update();
129  }
130 
134  gom_attribute(help, "In 0.0 ... 1.0. The higher, the better (but the slower !!)")
135  double get_max_radius() const {
136  return impl_->get_max_radius();
137  }
138 
142  void set_max_radius(double x) {
143  impl_->set_max_radius(x);
144  update();
145  }
146 
150  gom_attribute(help, "> 1.0. The smaller, the better (but the slower !!)")
151  double get_step_mul() const {
152  return impl_->get_step_mul();
153  }
154 
158  void set_step_mul(double x) {
159  impl_->set_step_mul(x);
160  update();
161  }
162 
163  private:
165  };
166 
167 }
168 
169 #endif
Implementation of full screen effects.
GOM wrapper around AmbientOcclusionImpl.
void set_step_mul(double x)
Sets the multiplicative factor applied to each step when traversing from a pixel.
void set_max_radius(double x)
Sets the maximum radius around a pixel where ambient occlusion is computed.
FullScreenEffectImpl * implementation() override
Gets the implementation.
void set_contrast(index_t value)
Sets the contrast.
index_t get_contrast() const
Gets the contrast.
AmbientOcclusion(SceneGraph *scene_graph)
AmbientOcclusion constructor.
void set_nb_directions(index_t value)
Sets the number of directions.
void set_lightness(index_t value)
Sets the lightness.
void set_blur_width(index_t value)
Sets the size of the blurring kernel.
A Full screen effect.
Represents the list of objects loaded in Graphite.
Definition: scene_graph.h:62
Implementation of AmbientOcclusion full screen effect.
geo_index_t index_t
The type for storing and manipulating indices.
Definition: numeric.h:329
Global Graphite namespace.
Definition: common.h:76
Base classes for full screen effects.