Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # RobGetOut custom shade
- #
- # Vertex shader for brushes
- shade RobGetOut code brush vs {
- #version 120
- void main()
- {
- gl_FrontColor = gl_Color;
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_TexCoord[1] = gl_MultiTexCoord1;
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- }
- }
- # Fragment shader for brushes
- shade RobGetOut code brush fs {
- #version 120
- uniform sampler2D texture;
- uniform sampler2D lightmap;
- void main()
- {
- vec4 lmc = texture2D(lightmap, gl_TexCoord[1].st);
- vec4 color = texture2D(texture, gl_TexCoord[0].st)*vec4(lmc.x, lmc.y, lmc.z, 1.0);
- gl_FragColor = color + color*color*vec4(1.5, 1.5, 1.5, 1.0) + color*color*color*vec4(2.0, 2.0, 2.0, 1.0);
- }
- }
- # Vertex shader for meshes
- shade RobGetOut code mesh vs {
- #version 120
- varying vec3 normal;
- void main()
- {
- gl_FrontColor = gl_Color;
- gl_TexCoord[0] = gl_MultiTexCoord0;
- normal = gl_NormalMatrix*gl_Normal;
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- }
- }
- # Fragment shader for meshes
- shade RobGetOut code mesh fs {
- #version 120
- uniform sampler2D texture;
- varying vec3 normal;
- void main()
- {
- float lighting = dot(normalize(normal), gl_LightSource[0].position.xyz);
- vec4 color = texture2D(texture, gl_TexCoord[0].st)*(gl_LightSource[0].diffuse*lighting + gl_LightSource[0].ambient);
- gl_FragColor = color + color*color*vec4(0.5, 0.5, 0.5, 1.0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement