2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADAStreamWriter.
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
12
#ifndef __COLLADAFRAMEWORK_TECHNIQUE_H__
13
#define __COLLADAFRAMEWORK_TECHNIQUE_H__
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"
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)."
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.
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:
55
/** A text string containing the unique identifier of the element. This value must be
56
unique within the instance document. Optional. */
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. */
63
/** Adds a strongly typed annotation remark to the parent object. No or multiple occurances. */
64
Array<Annotate> mAnnotateArray;
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;
70
/** Provides an inline block of source code. No or multiple occurances. */
71
Array<Code> mCodeArray;
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;
77
/** Assigns a new value to a previously defined parameter. No or multiple occurances. */
78
Array<SetParam> mSetParamArray;
80
/** Declares the storage for the graphical representation of an object. No or multiple occurances. */
81
Array<Image> mImageArray;
83
/** blinn, constant, lambert, phong */
84
//ShaderElement* mShaderElement;
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;
90
/** Provides arbitrary additional information about or related to its parent element.
91
No or multiple occurances. */
92
// Array<Extra> mExtraArray;
96
/** Constructor that sets the stream the asset should be written to*/
100
virtual ~Technique () {};
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; }
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; }
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; }
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; }
120
} //namespace COLLADAFW
123
#endif //__COLLADAFRAMEWORK_TECHNIQUE_H__