~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to COLLADAFramework/include/COLLADAFWShaderConstantFX.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
Import upstream version 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2008-2009 NetAllied Systems GmbH
 
3
 
 
4
    This file is part of COLLADAFramework.
 
5
 
 
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
 
9
*/
 
10
 
 
11
#ifndef __COLLADAFW_SHADERCONSTANTFX_H__
 
12
#define __COLLADAFW_SHADERCONSTANTFX_H__
 
13
 
 
14
#include "COLLADAFWPrerequisites.h"
 
15
#include "COLLADAFWColorOrTexture.h"
 
16
#include "COLLADAFWFloatOrParam.h"
 
17
 
 
18
 
 
19
namespace COLLADAFW
 
20
{
 
21
 
 
22
    /** 
 
23
    Produces a constantly shaded surface that is independent of lighting.
 
24
 
 
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
 
29
    where:
 
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
 
32
    the <visual_scene>.
 
33
    */
 
34
    class ShaderConstantFX : public ShaderElement
 
35
        {
 
36
        private:
 
37
        
 
38
        /** Declares the amount of light emitted from the surface of this object. */
 
39
        ColorOrTexture mEmission;
 
40
 
 
41
        /** Declares the color of a perfect mirror reflection. */
 
42
        ColorOrTexture mReflective;
 
43
 
 
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;
 
47
 
 
48
        /** Declares the color of perfectly refracted light. */
 
49
        ColorOrTexture mTransparent;
 
50
 
 
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;
 
54
 
 
55
        /** Declares the index of refraction for perfectly refracted light as a single scalar index. */
 
56
        FloatOrParam mIndexOfRefraction;
 
57
 
 
58
        public:
 
59
 
 
60
        /** Constructor. */
 
61
        ShaderConstantFX() {};
 
62
 
 
63
        /** Destructor. */
 
64
        virtual ~ShaderConstantFX() {};
 
65
 
 
66
        /** Declares the amount of light emitted from the surface of this object. */
 
67
        const ColorOrTexture getEmission () const { return mEmission; }
 
68
 
 
69
        /** Declares the amount of light emitted from the surface of this object. */
 
70
        void setEmission ( const ColorOrTexture Emission ) { mEmission = Emission; }
 
71
 
 
72
        /** Declares the color of a perfect mirror reflection. */
 
73
        const ColorOrTexture getReflective () const { return mReflective; }
 
74
 
 
75
        /** Declares the color of a perfect mirror reflection. */
 
76
        void setReflective ( const ColorOrTexture Reflective ) { mReflective = Reflective; }
 
77
 
 
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; }
 
81
 
 
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; }
 
85
 
 
86
        /** Declares the color of perfectly refracted light. */
 
87
        const ColorOrTexture getTransparent () const { return mTransparent; }
 
88
 
 
89
        /** Declares the color of perfectly refracted light. */
 
90
        void setTransparent ( const ColorOrTexture Transparent ) { mTransparent = Transparent; }
 
91
 
 
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; }
 
95
 
 
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; }
 
99
 
 
100
        /** Declares the index of refraction for perfectly refracted light as a single scalar index. */
 
101
        const FloatOrParam getIndexOfRefraction () const { return mIndexOfRefraction; }
 
102
 
 
103
        /** Declares the index of refraction for perfectly refracted light as a single scalar index. */
 
104
        void setIndexOfRefraction ( const FloatOrParam IndexOfRefraction ) { mIndexOfRefraction = IndexOfRefraction; }
 
105
 
 
106
        private:
 
107
 
 
108
        /** Disable default copy ctor. */
 
109
                ShaderConstantFX( const ShaderConstantFX& pre );
 
110
 
 
111
        /** Disable default assignment operator. */
 
112
                const ShaderConstantFX& operator= ( const ShaderConstantFX& pre );
 
113
 
 
114
        };
 
115
 
 
116
} // namespace COLLADAFW
 
117
 
 
118
#endif // __COLLADAFW_SHADERCONSTANTFX_H__