source: GTP/trunk/App/Demos/Illum/IBRBillboardCloudTrees/Shark3D/demo_v5x0x7_t164x31u_enterpr_kwin32/src/res/levelutil/shader/prog/ogl_glsl/bloom_smooth_ogl_glsl_vs1x0.s3d_shadercode @ 2330

Revision 2330, 1.6 KB checked in by igarcia, 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    // Use fractional basis value to reduce banding:
33    vec2 offsScale = tex0RcpSize.xy * pow(2.1, iter) * 0.5;
34
35    vec4 dirVec;
36    float fiter = mod(iter, 4.0);
37    if(fiter < 2.0)
38    {
39        if(fiter < 1.0)
40            dirVec = vec4(1.0, 0.0, 0.0, 1.0); // Vectors (1, 0) and (0, 1)
41        else
42            dirVec = vec4(1.0, 1.0,-1.0, 1.0); // Vectors (1, 1) and (-1, 1)
43    }
44    else
45    {
46        if(fiter < 3.0)
47            dirVec = vec4(2.0, 1.0, -1.0, 2.0); // Vectors (2, 1) and (-1, 2)
48        else
49            dirVec = vec4(1.0, 2.0, -2.0, 1.0); // Vectors (1, 2) and (-2, 1)
50    }
51
52    baseVec = dirVec * offsScale.xyxy;
53}
54
55///////////////////////////////////////////////////////////////////////////////
Note: See TracBrowser for help on using the repository browser.