1 | /******************************************************************************
|
---|
2 | Copyright (c) W.J. van der Laan
|
---|
3 |
|
---|
4 | Permission is hereby granted, free of charge, to any person obtaining a copy of
|
---|
5 | this software and associated documentation files (the "Software"), to deal in
|
---|
6 | the Software without restriction, including without limitation the rights to use,
|
---|
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
---|
8 | Software, and to permit persons to whom the Software is furnished to do so, subject
|
---|
9 | to the following conditions:
|
---|
10 |
|
---|
11 | The above copyright notice and this permission notice shall be included in all copies
|
---|
12 | or substantial portions of the Software.
|
---|
13 |
|
---|
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
---|
15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
---|
16 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
---|
17 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
---|
18 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
|
---|
19 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
20 | ******************************************************************************/
|
---|
21 | /** Deferred shading framework
|
---|
22 | // W.J. :wumpus: van der Laan 2005 //
|
---|
23 |
|
---|
24 | Material shader: Single colour phong
|
---|
25 | */
|
---|
26 | struct OUTPUT
|
---|
27 | {
|
---|
28 | float4 color0 : COLOR0; // Diffuse color
|
---|
29 | float4 color1 : COLOR1; // Position
|
---|
30 | };
|
---|
31 |
|
---|
32 | float3 colour;
|
---|
33 | float specularity;
|
---|
34 |
|
---|
35 | OUTPUT main(
|
---|
36 | float4 normal: TEXCOORD0,
|
---|
37 | float4 texCoord0: TEXCOORD1,
|
---|
38 | float depth: TEXCOORD2
|
---|
39 | )
|
---|
40 | {
|
---|
41 | OUTPUT output;
|
---|
42 | output.color0.rgb = colour;
|
---|
43 | output.color0.a = specularity;
|
---|
44 | output.color1.xyz = normal;
|
---|
45 | output.color1.w = depth;
|
---|
46 | return output;
|
---|
47 | }
|
---|