actual version libs withiout pip
git-svn-id: svn://db.shs.com.ru/libs@2 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
#version 130
|
||||
|
||||
in vec3 src_normal, normal, et;
|
||||
in vec4 pos, col;
|
||||
in float fogCoord;
|
||||
|
||||
uniform int light_model;
|
||||
uniform sampler2D t0, t1, t2, t3;
|
||||
uniform float bump_scale, height_scale;
|
||||
uniform bool acc_fog, has_diffuse, has_bump, has_height;
|
||||
uniform vec2 dt;
|
||||
|
||||
const vec3 luma = vec3(0.299, 0.587, 0.114);
|
||||
|
||||
void main(void) {
|
||||
vec4 dc = col;
|
||||
vec2 tc = gl_TexCoord[0].xy;
|
||||
float hei = 0.;
|
||||
if (has_height) hei = dot(texture2D(t2, gl_TexCoord[0].xy).rgb, luma) * height_scale;
|
||||
if (acc_fog) dc.xyz = mix(dc.rgb, gl_Fog.color.rgb, fogCoord);
|
||||
|
||||
vec3 n;
|
||||
if (has_bump) n = normalize(normal - (texture2D(t1, gl_TexCoord[0].xy).rgb - vec3(0.5, 0.5, 1.)) * bump_scale);
|
||||
else n = normalize(normal);
|
||||
|
||||
if (has_diffuse) {
|
||||
|
||||
/*vec2 dpm = normalize(gl_FragCoord.xy * dt * 2. - vec2(1., 1.)), ntc;
|
||||
ntc = gl_FragCoord.xy * dt * 2. - vec2(1., 1.) + dpm * hei;
|
||||
dpm = gl_ModelViewProjectionMatrixInverse
|
||||
dpm = dpm * gl_ModelViewProjectionMatrixInverse;
|
||||
dpm += */
|
||||
tc += 1-et.xy * hei/10;// / et.z;
|
||||
dc *= texture2D(t0, tc);
|
||||
}
|
||||
|
||||
gl_FragData[0] = vec4(dc.rgb, pos.w);
|
||||
gl_FragData[1] = vec4(n.xyz / 2. + vec3(0.5), gl_FrontMaterial.shininess);
|
||||
gl_FragData[2] = vec4(gl_FrontMaterial.specular.rgb, hei);
|
||||
//gl_FragData[0] = vec4(et.xyz, pos.w);
|
||||
//gl_FragDepth = gl_FragCoord.z - clamp(hei / pos.z / pos.z / (abs(n.z) + 1), -0.01, 0.01);
|
||||
/*vec4 dp = pos;
|
||||
dp.x = floor(dp.w / 255.) / 255.;
|
||||
dp.w -= dp.x * 65025;
|
||||
dp.y = floor(dp.w) / 255.;
|
||||
dp.w -= dp.y * 255.;
|
||||
dp.z = fract(dp.w);*/
|
||||
//dp.x = dp.w;
|
||||
//dp.w = (gl_FrontMaterial.specular.r + gl_FrontMaterial.specular.g + gl_FrontMaterial.specular.b) / 3. / 25.5;
|
||||
//gl_FragData[2] = dp;
|
||||
//gl_FragData[3] = vec4(light_model / 255., 0, 0, 0);
|
||||
}
|
||||
Reference in New Issue
Block a user