git-svn-id: svn://db.shs.com.ru/libs@701 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-12-13 23:15:59 +00:00
parent cac73a63f1
commit 2136b4d30b
22 changed files with 653 additions and 671 deletions

View File

@@ -42,7 +42,8 @@ void main(void) {
dn *= dn_sl / (length(dn) + 1E-6);
normal = normalize(geom_normal + dn);
vec4 specular = qgl_materialTexture(QGL_MAP_SPECULAR, tc, vec4(0)) * qgl_material[qgl_MaterialIndex].color_specular;
float metalness = dot(qgl_materialTexture(QGL_MAP_METALNESS, tc, vec4(0)).rgb, luma);
metalness = clamp(metalness, 0, 1);
float roughness = dot(qgl_materialTexture(QGL_MAP_ROUGHNESS, tc, vec4(0)).rgb, luma);
roughness = clamp(roughness, 0.0001, 0.9999);
@@ -60,8 +61,8 @@ void main(void) {
qgl_FragData[0] = vec4(diffuse .rgba);
qgl_FragData[1] = vec4(normal .xyz, z);
qgl_FragData[2] = vec4(specular.rgb, reflectivity);
qgl_FragData[3] = vec4(emission.rgb, roughness/*bn.x*/);
qgl_FragData[2] = vec4(metalness, roughness, reflectivity, 0);
qgl_FragData[3] = vec4(emission.rgb, 0/*bn.x*/);
//qgl_FragData[4] = vec4(speed.xy, bn.yz);
//ivec2 itc = ivec2(gl_FragCoord.xy);