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

« back to all changes in this revision

Viewing changes to COLLADAFramework/include/COLLADAFWTechnique.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 COLLADAStreamWriter.
 
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
 
 
12
#ifndef __COLLADAFRAMEWORK_TECHNIQUE_H__
 
13
#define __COLLADAFRAMEWORK_TECHNIQUE_H__
 
14
 
 
15
#include "COLLADAFWPrerequisites.h"
 
16
#include "COLLADAFWAnnotate.h"
 
17
#include "COLLADAFWInclude.h"
 
18
#include "COLLADAFWCode.h"
 
19
#include "COLLADAFWNewParam.h"
 
20
#include "COLLADAFWSetParam.h"
 
21
#include "COLLADAFWImage.h"
 
22
#include "COLLADAFWShaderElement.h"
 
23
#include "COLLADAFWPass.h"
 
24
 
 
25
 
 
26
namespace COLLADAFW
 
27
{
 
28
 
 
29
    /** 
 
30
    Holds a description of the textures, samplers, shaders, parameters, and passes necessary 
 
31
    for rendering this effect using one method.
 
32
    For <technique> in elements other than <profile_*>, see "<technique> (core)."
 
33
 
 
34
    Techniques hold all the necessary elements required to render an effect. Each effect can 
 
35
    contain many techniques, each of which describes a different method for rendering that effect. 
 
36
    There are three different scenarios for which techniques are commonly used:
 
37
    � One technique might describe a high-LOD version while a second technique describes a low-LOD
 
38
    version of the same effect.
 
39
    � Describe an effect in different ways and use validation tools in the FX Runtime to find the 
 
40
    most efficient version of an effect for an unknown device that uses a standard API.
 
41
    � Describe an effect under different game states, for example, a daytime and a nighttime 
 
42
    technique, a normal technique, and a "magic-is-enabled" technique.
 
43
 
 
44
    Child elements vary by profile. See the parent element main entries for details. The following 
 
45
    list summarizes valid child elements. The child elements must appear in the following order if 
 
46
    present, with the following exceptions: <code> and <include>; <newparam>, <setparam>, and 
 
47
    <image> are choices, can appear in any order in that position; <blinn>, <constant>, <lambert>, 
 
48
    <phong> are choices, can appear in any order in that position:
 
49
    */
 
50
    class Technique
 
51
    {
 
52
 
 
53
    private:
 
54
 
 
55
        /** A text string containing the unique identifier of the element. This value must be 
 
56
        unique within the instance document. Optional. */
 
57
        String mId;
 
58
 
 
59
        /** A text string value containing the subidentifier of this element. This value must be
 
60
        unique within the scope of the parent element. Required. */
 
61
        String mSid;
 
62
 
 
63
        /** Adds a strongly typed annotation remark to the parent object.  No or multiple occurances. */
 
64
        Array<Annotate> mAnnotateArray;
 
65
 
 
66
        /** Imports source code or precompiled binary shaders into the FX Runtime by referencing 
 
67
        an external resource.  No or multiple occurances. */
 
68
        Array<Include> mIncludeArray;
 
69
 
 
70
        /** Provides an inline block of source code.  No or multiple occurances. */
 
71
        Array<Code> mCodeArray;
 
72
 
 
73
        /** Creates a new, named <param> (FX) object in the FX Runtime, and assigns it a type, 
 
74
        an initial value, and additional attributes at declaration time.  No or multiple occurances. */
 
75
        Array<NewParam> mNewParamArray;
 
76
 
 
77
        /** Assigns a new value to a previously defined parameter.  No or multiple occurances. */
 
78
        Array<SetParam> mSetParamArray;
 
79
 
 
80
        /** Declares the storage for the graphical representation of an object. No or multiple occurances. */
 
81
        Array<Image> mImageArray;
 
82
 
 
83
        /** blinn, constant, lambert, phong */
 
84
        //ShaderElement* mShaderElement;
 
85
 
 
86
        /** Provides a static declaration of all the render states, shaders, and settings for one 
 
87
        rendering pipeline. One or more occurances. */
 
88
        Array<Pass> mPassArray;
 
89
 
 
90
        /** Provides arbitrary additional information about or related to its parent element. 
 
91
        No or multiple occurances. */
 
92
//        Array<Extra> mExtraArray;
 
93
 
 
94
    public:
 
95
 
 
96
        /** Constructor that sets the stream the asset should be written to*/
 
97
        Technique () {}
 
98
 
 
99
        /** Destructor. */
 
100
        virtual ~Technique () {};
 
101
 
 
102
        /** A text string containing the unique identifier of the element. This value must be 
 
103
        unique within the instance document. Optional. */
 
104
        const String getId () const { return mId; }
 
105
 
 
106
        /** A text string containing the unique identifier of the element. This value must be 
 
107
        unique within the instance document. Optional. */
 
108
        void setId ( const String Id ) { mId = Id; }
 
109
 
 
110
        /** A text string value containing the subidentifier of this element. This value must be
 
111
        unique within the scope of the parent element. Required. */
 
112
        const String getSid () const { return mSid; }
 
113
 
 
114
        /** A text string value containing the subidentifier of this element. This value must be
 
115
        unique within the scope of the parent element. Required. */
 
116
        void setSid ( const String Sid ) { mSid = Sid; }
 
117
 
 
118
    };
 
119
 
 
120
} //namespace COLLADAFW
 
121
 
 
122
 
 
123
#endif //__COLLADAFRAMEWORK_TECHNIQUE_H__
 
124