openscenegraph
ReflectionMapGenerator
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13#ifndef OSGUTIL_REFLECTIONMAPGENERATOR_
14#define OSGUTIL_REFLECTIONMAPGENERATOR_
15
17
18namespace osgUtil
19{
20
25 public:
26 inline ReflectionMapGenerator(int texture_size = 64);
28
29 protected:
32
33 inline virtual osg::Vec4 compute_color(const osg::Vec3 &R) const;
34 };
35
36 // INLINE METHODS
37
39 : CubeMapGenerator(texture_size)
40 {
41 }
42
44 : CubeMapGenerator(copy, copyop)
45 {
46 }
47
49 {
50 return vector_to_color(R / R.length());
51 }
52
53}
54
55#endif
Definition CubeMapGenerator:35
static osg::Vec4 vector_to_color(const osg::Vec3 &vec)
Definition CubeMapGenerator:110
Definition ReflectionMapGenerator:24
virtual osg::Vec4 compute_color(const osg::Vec3 &R) const
Definition ReflectionMapGenerator:48
ReflectionMapGenerator(int texture_size=64)
Definition ReflectionMapGenerator:38
virtual ~ReflectionMapGenerator()
Definition ReflectionMapGenerator:30
ReflectionMapGenerator & operator=(const ReflectionMapGenerator &)
Definition ReflectionMapGenerator:31
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition Vec3f:29
value_type length() const
Definition Vec3f:176
Definition Vec4f:28
Shader generator framework.
Definition NodeVisitor:25