2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADAFramework.
6
Licensed under the MIT Open Source License,
7
for details please see LICENSE file or the website
8
http://www.opensource.org/licenses/mit-license.php
11
#ifndef __COLLADAFW_SHADERCONSTANTFX_H__
12
#define __COLLADAFW_SHADERCONSTANTFX_H__
14
#include "COLLADAFWPrerequisites.h"
15
#include "COLLADAFWColorOrTexture.h"
16
#include "COLLADAFWFloatOrParam.h"
23
Produces a constantly shaded surface that is independent of lighting.
25
Used inside a <profile_COMMON> effect, declares a fixed-function pipeline that produces a
26
constantly shaded surface that is independent of lighting.
27
The reflected color is calculated as:
28
color = <emission> + <ambient> * al
30
� al � A constant amount of ambient light contribution coming from the scene. In the COMMON
31
profile, this is the sum of all the <light><technique_common><ambient><color> values in
34
class ShaderConstantFX : public ShaderElement
38
/** Declares the amount of light emitted from the surface of this object. */
39
ColorOrTexture mEmission;
41
/** Declares the color of a perfect mirror reflection. */
42
ColorOrTexture mReflective;
44
/** Declares the amount of perfect mirror reflection to be added to the reflected light
45
as a value between 0.0 and 1.0. */
46
FloatOrParam mReflectivity;
48
/** Declares the color of perfectly refracted light. */
49
ColorOrTexture mTransparent;
51
/** Declares the amount of perfectly refracted light added to the reflected color as a
52
scalar value between 0.0 and 1.0. */
53
FloatOrParam mTransparency;
55
/** Declares the index of refraction for perfectly refracted light as a single scalar index. */
56
FloatOrParam mIndexOfRefraction;
61
ShaderConstantFX() {};
64
virtual ~ShaderConstantFX() {};
66
/** Declares the amount of light emitted from the surface of this object. */
67
const ColorOrTexture getEmission () const { return mEmission; }
69
/** Declares the amount of light emitted from the surface of this object. */
70
void setEmission ( const ColorOrTexture Emission ) { mEmission = Emission; }
72
/** Declares the color of a perfect mirror reflection. */
73
const ColorOrTexture getReflective () const { return mReflective; }
75
/** Declares the color of a perfect mirror reflection. */
76
void setReflective ( const ColorOrTexture Reflective ) { mReflective = Reflective; }
78
/** Declares the amount of perfect mirror reflection to be added to the reflected light
79
as a value between 0.0 and 1.0. */
80
const FloatOrParam getReflectivity () const { return mReflectivity; }
82
/** Declares the amount of perfect mirror reflection to be added to the reflected light
83
as a value between 0.0 and 1.0. */
84
void setReflectivity ( const FloatOrParam Reflectivity ) { mReflectivity = Reflectivity; }
86
/** Declares the color of perfectly refracted light. */
87
const ColorOrTexture getTransparent () const { return mTransparent; }
89
/** Declares the color of perfectly refracted light. */
90
void setTransparent ( const ColorOrTexture Transparent ) { mTransparent = Transparent; }
92
/** Declares the amount of perfectly refracted light added to the reflected color as a
93
scalar value between 0.0 and 1.0. */
94
const FloatOrParam getTransparency () const { return mTransparency; }
96
/** Declares the amount of perfectly refracted light added to the reflected color as a
97
scalar value between 0.0 and 1.0. */
98
void setTransparency ( const FloatOrParam Transparency ) { mTransparency = Transparency; }
100
/** Declares the index of refraction for perfectly refracted light as a single scalar index. */
101
const FloatOrParam getIndexOfRefraction () const { return mIndexOfRefraction; }
103
/** Declares the index of refraction for perfectly refracted light as a single scalar index. */
104
void setIndexOfRefraction ( const FloatOrParam IndexOfRefraction ) { mIndexOfRefraction = IndexOfRefraction; }
108
/** Disable default copy ctor. */
109
ShaderConstantFX( const ShaderConstantFX& pre );
111
/** Disable default assignment operator. */
112
const ShaderConstantFX& operator= ( const ShaderConstantFX& pre );
116
} // namespace COLLADAFW
118
#endif // __COLLADAFW_SHADERCONSTANTFX_H__