John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 1 | #version 130
|
| 2 |
|
| 3 | uniform sampler1D texSampler1D;
|
| 4 | uniform sampler2D texSampler2D;
|
| 5 | uniform sampler3D texSampler3D;
|
| 6 | uniform samplerCube texSamplerCube;
|
| 7 | uniform sampler1DShadow shadowSampler1D;
|
| 8 | uniform sampler2DShadow shadowSampler2D;
|
| 9 |
|
| 10 | uniform float blend;
|
| 11 | uniform vec2 scale;
|
| 12 | uniform vec4 u;
|
| 13 |
|
| 14 | varying vec2 t;
|
| 15 | varying vec2 coords2D;
|
| 16 |
|
| 17 | void main()
|
| 18 | {
|
| 19 | float blendscale = 1.789;
|
| 20 | float bias = 2.0;
|
| 21 | float lod = 3.0;
|
| 22 | float proj = 2.0;
|
| 23 | float coords1D = 1.789;
|
| 24 | vec3 coords3D = vec3(1.789, 2.718, 3.453);
|
| 25 | vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0);
|
| 26 | vec4 color = vec4(0.0, 0.0, 0.0, 0.0);
|
| 27 |
|
| 28 | color += texture1D (texSampler1D, coords1D);
|
| 29 | color += texture1D (texSampler1D, coords1D, bias);
|
| 30 | color += texture1DProj(texSampler1D, coords2D);
|
| 31 | color += texture1DProj(texSampler1D, coords4D);
|
| 32 | color += texture1DProj(texSampler1D, coords2D, bias);
|
| 33 | color += texture1DProj(texSampler1D, coords4D, bias);
|
| 34 |
|
| 35 | color += texture2D (texSampler2D, coords2D);
|
| 36 | color += texture2D (texSampler2D, coords2D, bias);
|
| 37 | color += texture2DProj (texSampler2D, coords3D);
|
| 38 | color += texture2DProj (texSampler2D, coords4D, bias);
|
| 39 |
|
| 40 | color += texture3D (texSampler3D, coords3D);
|
| 41 | color += texture3D (texSampler3D, coords3D, bias);
|
| 42 | color += texture3DProj (texSampler3D, coords4D);
|
| 43 | color += texture3DProj (texSampler3D, coords4D, bias);
|
| 44 |
|
| 45 | color += textureCube (texSamplerCube, coords3D);
|
| 46 | color += textureCube (texSamplerCube, coords3D, bias);
|
| 47 |
|
| 48 | color += shadow1D (shadowSampler1D, coords3D);
|
| 49 | color += shadow1D (shadowSampler1D, coords3D, bias);
|
| 50 | color += shadow2D (shadowSampler2D, coords3D);
|
| 51 | color += shadow2D (shadowSampler2D, coords3D, bias);
|
| 52 | color += shadow1DProj (shadowSampler1D, coords4D);
|
| 53 | color += shadow1DProj (shadowSampler1D, coords4D, bias);
|
| 54 | color += shadow2DProj (shadowSampler2D, coords4D);
|
| 55 | color += shadow2DProj (shadowSampler2D, coords4D, bias);
|
| 56 |
|
| 57 | ivec2 iCoords2D = ivec2(0, 5);
|
| 58 | int iLod = 1;
|
| 59 |
|
| 60 | color += texelFetch(texSampler2D, iCoords2D, iLod);
|
| 61 |
|
| 62 | vec2 gradX = dFdx(coords2D);
|
| 63 | vec2 gradY = dFdy(coords2D);
|
| 64 | const ivec2 offset = ivec2(3, -7);
|
| 65 |
|
| 66 | color += textureGrad(texSampler2D, coords2D, gradX, gradY);
|
| 67 | color += textureProjGrad(texSampler2D, vec3(coords2D, proj), gradX, gradY);
|
| 68 | color += textureGradOffset(texSampler2D, coords2D, gradX, gradY, offset);
|
| 69 | color += textureProjGradOffset(texSampler2D, coords3D, gradX, gradY, offset);
|
| 70 | color += textureGrad(shadowSampler2D, vec3(coords2D, lod), gradX, gradY);
|
| 71 |
|
| 72 | gl_FragColor = mix(color, u, blend * blendscale);
|
| 73 | } |