Project

General

Profile

« Previous | Next » 

Revision 341c803d

Added by Leszek Koltunski almost 8 years ago

Progress with Vertex3D

View differences:

src/main/res/raw/main_fragment_shader.glsl
36 36
const vec3 LUMI = vec3( 0.2125, 0.7154, 0.0721 );                                        
37 37
 
38 38
//////////////////////////////////////////////////////////////////////////////////////////////
39
// macroblocks
39
// MACROBLOCK EFFECT
40 40

  
41 41
void macroblock(float degree, int effect, inout vec2 tex)
42 42
  {
......
46 46
  }
47 47

  
48 48
//////////////////////////////////////////////////////////////////////////////////////////////
49
// change the RGB values
49
// CHROMA EFFECT
50 50

  
51 51
void chroma(float degree, int effect, inout vec4 color)
52 52
  {
......
54 54
  }
55 55

  
56 56
//////////////////////////////////////////////////////////////////////////////////////////////
57
// change the transparency level
57
// ALPHA EFFECT (change transparency level)
58 58

  
59 59
void alpha(float degree, int effect, inout vec4 color)
60 60
  {
......
62 62
  }
63 63

  
64 64
//////////////////////////////////////////////////////////////////////////////////////////////
65
// change the brightness level
65
// BRIGHTNESS EFFECT
66 66

  
67 67
void brightness(float degree, int effect, inout vec4 color)
68 68
  {
......
70 70
  }
71 71
  
72 72
//////////////////////////////////////////////////////////////////////////////////////////////
73
// change the contrast level
73
// CONTRAST EFFECT
74 74

  
75 75
void contrast(float degree, int effect, inout vec4 color)
76 76
  {
......
78 78
  }
79 79

  
80 80
//////////////////////////////////////////////////////////////////////////////////////////////
81
// change the saturation level
81
// SATURATION EFFECT
82 82

  
83 83
void saturation(float degree, int effect, inout vec4 color)
84 84
  {
......
102 102
    {
103 103
    diff = (v_Position.xy - fUniforms[2*i+1].xy)/fUniforms[2*i+1].zw;
104 104
    pointDegree = max(0.0,1.0-dot(diff,diff));
105
  
106
    //switch(fType[i])  // future version of GLSL
107
    //  {
108
    //  case MACROBLOCK        : macroblock(sign(pointDegree),2*i,tex); break;
109
    //  case CHROMA            : chroma    (sign(pointDegree),2*i,col); break;
110
    //  case SMOOTH_CHROMA     : chroma    (     pointDegree ,2*i,col); break;
111
    //  case ALPHA             : alpha     (sign(pointDegree),2*i,col); break;
112
    //  case SMOOTH_ALPHA      : alpha     (     pointDegree ,2*i,col); break;
113
    //  case BRIGHTNESS        : brightness(sign(pointDegree),2*i,col); break;
114
    //  case SMOOTH_BRIGHTNESS : brightness(     pointDegree ,2*i,col); break;
115
    //  case CONTRAST          : contrast  (sign(pointDegree),2*i,col); break;
116
    //  case SMOOTH_CONTRAST   : contrast  (     pointDegree ,2*i,col); break;
117
    //  case SATURATION        : saturation(sign(pointDegree),2*i,col); break;
118
    //  case SMOOTH_SATURATION : saturation(     pointDegree ,2*i,col); break;
119
    //  }
120
    
105

  
121 106
         if( fType[i]==MACROBLOCK        ) macroblock(sign(pointDegree),2*i,tex);
122 107
    else if( fType[i]==CHROMA            ) chroma    (sign(pointDegree),2*i,col);
123 108
    else if( fType[i]==SMOOTH_CHROMA     ) chroma    (     pointDegree ,2*i,col);
......
133 118
#endif
134 119
 
135 120
  gl_FragColor = (col * 0.5 * (v_Normal.z+1.0) * texture2D(u_Texture, tex));
136
  }
121
  }

Also available in: Unified diff