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_PASSCLEAR_H__
12
#define __COLLADAFW_PASSCLEAR_H__
14
#include "COLLADAFWPrerequisites.h"
15
#include "COLLADAFWColor.h"
22
Specifies whether a render target surface is to be cleared, and which value to use.
23
Before drawing, render target surfaces may need to be reset to a blank canvas or default. The
24
<color_clear> declarations specify which value to use. If no clearing statement is included,
25
the target surface is unchanged as rendering begins.
27
This element contains four float values representing the red, green, blue, and alpha channels.
28
When this element exists inside a pass, it a cue to the runtime that a particular backbuffer or
29
render-target resource should be cleared. This means that all existing image data in the
30
resource should be replaced with the color provided. This element puts the resource into a fresh
31
and known state so that other operations that use this resource execute as expected.
32
The index attribute identifies the resource that you want to clear. An index of 0 identifies the
33
primary resource. The primary resource may be the backbuffer or the override provided with an
34
appropriate <*_target> element (<color_target>, <depth_target>, or <stencil_target>).
35
Current platforms have fairly restrictive rules for setting up multiple render targets (MRTs).
36
For example, MRTs can have only four color buffers, which must all be the same size and pixel
37
format, one depth buffer, and one stencil buffer active for all color buffers. The COLLADA FX
38
declaration is designed to be looser in its restrictions, so an FX runtime must validate that a
39
particular MRT declaration in a <pass> is possible before attempting to apply it, and flag it as
42
class PassColorClear : public PassOutput
46
/** The color value. */
53
: PassOutput ( PassOutput::OUTPUT_TYPE_COLOR )
54
, mColor ( 0.0f, 0.0f, 0.0f, 0.0f )
58
PassColorClear ( float red, float green, float blue, float alpha )
59
: PassOutput ( PassOutput::OUTPUT_TYPE_COLOR )
60
, mColor ( red, green, blue, alpha )
64
virtual ~PassColorClear();
66
/** The color value. */
67
const Color getColor () const { return mColor; }
69
/** The color value. */
70
void setColor ( const Color Color ) { mColor = Color; }
74
/** Disable default copy ctor. */
75
PassColorClear( const PassColorClear& pre );
77
/** Disable default assignment operator. */
78
const PassColorClear& operator= ( const PassColorClear& pre );
83
Specifies whether a render target surface is to be cleared, and which value to use.
85
Before drawing, render target surfaces may need resetting to a blank canvas or to a default.
86
These <depth_clear> declarations specify which value to use. If no clearing statement is
87
included, the target surface is unchanged as rendering begins.
89
This element contains a single float value that is used to clear a resource.
90
When this element exists inside a pass, it a cue to the runtime that a particular backbuffer or
91
render-target resource should be cleared. This means that all existing image data in the
92
resource should be replaced with the float value provided. This puts the resource into a fresh
93
and known state so that other operations with this resource execute as expected.
94
The index attribute identifies the resource that you want to clear. An index of 0 identifies
95
the primary resource. The primary resource may be the backbuffer or the override provided with
96
an appropriate <*_target> element (<color_target>, <depth_target>, or <stencil_target>)
97
Current platforms have fairly restrictive rules for setting up MRTs; for example, MRTs can have
98
only four color buffers, which must be all of the same size and pixel format, and only one depth
99
buffer and one stencil buffer active for all color buffers. The COLLADA FX declaration is
100
designed to be looser in its restrictions, so an FX runtime must validate that a particular MRT
101
declaration in a <pass> is possible before attempting to apply it, and flag it as an error if it
104
class PassDepthClear : public PassOutput
114
: PassOutput ( PassOutput::OUTPUT_TYPE_DEPTH )
119
PassDepthClear( float resource )
120
: PassOutput ( PassOutput::OUTPUT_TYPE_DEPTH )
121
, mResource ( resource )
125
virtual ~PassDepthClear();
127
const float getResource () const { return mResource; }
128
void setResource ( const float Resource ) { mResource = Resource; }
132
/** Disable default copy ctor. */
133
PassDepthClear( const PassDepthClear& pre );
135
/** Disable default assignment operator. */
136
const PassDepthClear& operator= ( const PassDepthClear& pre );
141
Specifies whether a render target surface is to be cleared, and which value to use.
143
Before drawing, render target surfaces may need resetting to a blank canvas or default. These
144
<stencil_clear> declarations specify which value to use. If no clearing statement is included,
145
the target surface will be unchanged as rendering begins.
147
This element contains an xs:byte that is the value used to clear a resource.
148
When this element exists inside a pass, it a cue to the runtime that a particular backbuffer or
149
render-target resource should be cleared. This means that all existing image data in the
150
resource should be replaced with the value provided. This puts the resource into a fresh and
151
known state so that other operations with this resource execute as expected.
152
The index attribute identifies the resource that you want to clear. An index of 0 identifies the
153
primary resource. The primary resource may be the backbuffer or the override provided with an
154
appropriate <*_target> element (<color_target>, <depth_target>, or <stencil_target>).
155
Current platforms have fairly restrictive rules for setting up MRTs; for example, only four
156
color buffers, which must be all of the same size and pixel format, and only one depth buffer
157
and one stencil buffer active for all color buffers. The COLLADA FX declaration is designed to
158
be looser in its restrictions, so an FX runtime must validate that a particular MRT declaration
159
in a <pass> is possible before attempting to apply it, and flag it as an error if it fails.
161
class PassStencilClear : public PassOutput
165
unsigned char mClearValue;
171
: PassOutput ( PassOutput::OUTPUT_TYPE_STENCIL )
176
PassStencilClear( unsigned char clearValue )
177
: PassOutput ( PassOutput::OUTPUT_TYPE_STENCIL )
178
, mClearValue ( clearValue )
182
virtual ~PassStencilClear();
184
const unsigned char getClearValue () const { return mClearValue; }
185
void setClearValue ( const unsigned char ClearValue ) { mClearValue = ClearValue; }
189
/** Disable default copy ctor. */
190
PassStencilClear( const PassStencilClear& pre );
192
/** Disable default assignment operator. */
193
const PassStencilClear& operator= ( const PassStencilClear& pre );
197
} // namespace COLLADAFW
199
#endif // __COLLADAFW_PASSCLEAR_H__