~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/sdk/resources/lexers/lexer_cg.sample

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This is a block comment
 
3
 */
 
4
 
 
5
/**
 
6
  * This is a documentation comment block
 
7
  * @param xxx does this (this is the documentation keyword)
 
8
  * @authr some user (this is the documentation keyword error)
 
9
  */
 
10
 
 
11
struct input    {
 
12
                                float3 Position : POSITION;
 
13
                                float3 Normal   : NORMAL;
 
14
                                };
 
15
 
 
16
struct out_to_fp{
 
17
                                float4 Hposition        : POSITION;
 
18
                                float4 Color0           : COLOR0;
 
19
                                float4 TexCoord0        : TEXCOORD0;
 
20
                                float4 TexCoord1        : TEXCOORD1;
 
21
                                };
 
22
 
 
23
// a vertex program
 
24
out_to_fp       main(   input IN,
 
25
                                uniform float4x4 WorldViewProj,
 
26
                                uniform float4x4 TexTransform,
 
27
                                uniform float3x3 WorldIT,
 
28
                                uniform float3 LightVec )
 
29
        {
 
30
        out_to_fp OUT;
 
31
        float3 worldNormal = normalize(mul(WorldIT, IN.Normal));
 
32
        float ldotn = max(dot(LightVec, worldNormal), 0.0);
 
33
        OUT.Color0.xyz = ldotn.xxx;
 
34
        float4 tempPos;
 
35
        tempPos.xyz = IN.Position.xyz;
 
36
        tempPos.w = 1.0;
 
37
        OUT.TexCoord0 = mul(TexTransform, tempPos);
 
38
        OUT.TexCoord1 = mul(TexTransform, tempPos);
 
39
        OUT.Hposition = mul(WorldViewProj, tempPos);
 
40
        return OUT;
 
41
        }
 
 
b'\\ No newline at end of file'