git-svn-id: svn://db.shs.com.ru/libs@69 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -20,30 +20,23 @@ void main(void) {
|
||||
vec4 dc = qgl_FragColor;
|
||||
vec2 tc = qgl_FragTexture.xy;
|
||||
float hei = dot(texture(qgl_Material.map_relief.map, tc).rgb, luma) * qgl_Material.map_relief.amount + qgl_Material.map_relief.offset;
|
||||
//if (acc_fog) dc.xyz = mix(dc.rgb, gl_Fog.color.rgb, fogCoord);
|
||||
|
||||
vec3 n, dn, bn;
|
||||
dn = (texture(qgl_Material.map_normal.map, tc).rgb - vec3(0.5, 0.5, 1.)) * qgl_Material.map_normal.amount + qgl_Material.map_normal.offset;
|
||||
//float tx = dn.x;
|
||||
dn.y = -dn.y;
|
||||
//dn.y = tx;
|
||||
dn = TBN * dn;
|
||||
//dn = dn * mat3(qgl_ModelViewMatrix)*10;//*(mat3(qgl_NormalMatrix));
|
||||
n = normalize(qgl_NormalMatrix * (normal + dn));//normalize(qgl_NormalMatrix * (normal - dn));
|
||||
bn = normalize(qgl_NormalMatrix * binormal);//normalize(qgl_NormalMatrix * (normal - dn));
|
||||
n = normalize(qgl_NormalMatrix * (normal + dn));
|
||||
bn = normalize(qgl_NormalMatrix * binormal);
|
||||
//n = dn;
|
||||
|
||||
/*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 *= texture(qgl_Material.map_diffuse.map, tc) * qgl_Material.map_diffuse.amount + qgl_Material.map_diffuse.offset;
|
||||
|
||||
vec4 spec = texture(qgl_Material.map_specular.map, tc) * qgl_Material.map_specular.amount + qgl_Material.map_specular.offset;
|
||||
spec *= qgl_Material.color_specular;
|
||||
vec4 specularity = texture(qgl_Material.map_specularity.map, tc) * qgl_Material.map_specularity.amount + qgl_Material.map_specularity.offset;
|
||||
float specularity = dot(texture(qgl_Material.map_specularity.map, tc).rgb, luma) * qgl_Material.map_specularity.amount + qgl_Material.map_specularity.offset;
|
||||
specularity = clamp(specularity, 0.05, 0.99);
|
||||
float reflectivity = qgl_Material.reflectivity;//dot(texture(qgl_Material.map_specularity.map, tc).rgb, luma) * qgl_Material.map_specularity.amount + qgl_Material.map_specularity.offset;
|
||||
reflectivity = clamp(reflectivity, 0., 1.);
|
||||
vec4 self = texture(qgl_Material.map_self_illumination.map, tc) * qgl_Material.map_self_illumination.amount + qgl_Material.map_self_illumination.offset;
|
||||
self *= qgl_Material.color_self_illumination;
|
||||
|
||||
@@ -52,7 +45,7 @@ void main(void) {
|
||||
|
||||
//gl_FragDepth = logz;
|
||||
qgl_FragData[0] = vec4(dc.rgb, pos.w);
|
||||
qgl_FragData[1] = vec4(n.xyz / 2. + vec3(0.5), specularity);
|
||||
qgl_FragData[1] = vec4(n.xyz, specularity + round(reflectivity * 100));
|
||||
qgl_FragData[2] = vec4(spec.rgb, hei);
|
||||
qgl_FragData[3] = vec4(self.rgb, bn.x);
|
||||
qgl_FragData[4] = vec4(speed.xy, bn.yz);
|
||||
|
||||
Reference in New Issue
Block a user