Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL150/mrttestfp_scene.glsl @ 12096

Last change on this file since 12096 was 12091, checked in by wiesep, 6 years ago

Updated programs and adjusted Material to work with GLSL>150

File size: 486 bytes
Line 
1#version 130
2
3// Need to enable the draw buffers extension
4#extension GL_ARB_draw_buffers : enable
5
6uniform sampler2D tex0;
7
8void main()                   
9{
10        vec4 baseColour = texture(tex0, gl_TexCoord[0].xy);
11
12        gl_FragData[0] = baseColour;
13
14        gl_FragData[1] = baseColour * vec4(1, 0, 0, 1);
15
16        float abs = (baseColour.r + baseColour.g + baseColour.b) * 0.333;
17        gl_FragData[2] = vec4(abs, abs, abs, 1);
18       
19        float invabs = 1.0 - abs;
20        gl_FragData[3] = vec4(invabs, invabs, invabs, 1);
21}
22
Note: See TracBrowser for help on using the repository browser.