source: GTP/trunk/App/Demos/Illum/Shark3D/version164x12u/IllumDemo/bin/res/levelutil/shader/prog/ogl_glsl/bloom_smooth_ogl_glsl_vs1x0.s3d_shadercode_run @ 2196

Revision 2196, 1.5 KB checked in by szirmay, 17 years ago (diff)
Line 
1///////////////////////////////////////////////////////////////////////////////
2//
3//      ##  ######
4//       ######  ###
5//  ## ###############        Shark 3D Engine (www.shark3d.com)
6//   ########## # # #
7//    ########                Copyright (c) 1996-2006 Spinor GmbH.
8//   ######### # # #          All rights reserved.
9//  ##   ##########
10//      ##
11//
12///////////////////////////////////////////////////////////////////////////////
13
14uniform vec4 passInfo;
15uniform vec4 tex0RcpSize;
16
17varying vec4 baseVec;
18
19void main(void)
20{
21    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
22
23    vec4 posView = gl_ModelViewMatrix * gl_Vertex;
24    gl_FogFragCoord = posView.z / posView.w;
25
26    gl_FrontColor = gl_Color;
27    gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;
28
29    // Scaling offset
30    float iter = passInfo.x;
31
32    vec2 offsScale = tex0RcpSize.xy * pow(2.0, iter) * 0.5;
33
34    vec4 dirVec;
35    float fiter = mod(iter, 4.0);
36    if(fiter < 2.0)
37    {
38        if(fiter < 1.0)
39            dirVec = vec4(1.0, 0.0, 0.0, 1.0); // Vectors (1, 0) and (0, 1)
40        else
41            dirVec = vec4(1.0, 1.0,-1.0, 1.0); // Vectors (1, 1) and (-1, 1)
42    }
43    else
44    {
45        if(fiter < 3.0)
46            dirVec = vec4(2.0, 1.0, -1.0, 2.0); // Vectors (2, 1) and (-1, 2)
47        else
48            dirVec = vec4(1.0, 2.0, -2.0, 1.0); // Vectors (1, 2) and (-2, 1)
49    }
50
51    baseVec = dirVec * offsScale.xyxy;
52}
53
54///////////////////////////////////////////////////////////////////////////////
Note: See TracBrowser for help on using the repository browser.