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

This commit is contained in:
2019-12-06 13:47:45 +00:00
parent c5bbf5ef8f
commit 6c409d0e12
14 changed files with 167 additions and 125 deletions

View File

@@ -9,11 +9,10 @@ void main(void) {
uniform sampler2D tex_0, tex_1, tex_2, tex_3, tex_4;
const vec3 luma = vec3(0.299, 0.587, 0.114);
void main(void) {
ivec2 tc = ivec2(gl_FragCoord.xy);
vec4 v0 = texelFetch(tex_0, tc, 0);
vec4 v1 = texelFetch(tex_1, tc, 0);
qgl_FragColor = v0 + v1;
vec3 res = v0.rgb + v1.rgb;
qgl_FragColor.rgb = res;
}

View File

@@ -81,7 +81,7 @@ void calcLight(in int index, in vec3 n, in vec3 v) {
float ndlc = (1. - NdotLs) / NdotLs;
float der = NdotLs * (shm_diff + ndlc);
diff = 2. / (1. + sqrt(1. + (1. - shm_diff) * ndlc));
li += spot * diff * qgl_light_parameter[index].color.rgb;// * light_diffuse(0, ldir, n);
li += spot * diff * qgl_light_parameter[index].color.rgb;
ndlc = (1. - NdotHs) / NdotHs;
der = NdotHs * (shm_spec + ndlc);

View File

@@ -8,6 +8,7 @@ void main(void) {
// frag //
uniform sampler2D tex_0, tex_sum;
uniform float exposure;
const vec3 luma = vec3(0.299, 0.587, 0.114);
@@ -17,7 +18,7 @@ void main(void) {
vec4 sum = texelFetch(tex_sum, ivec2(0,0), 0);
vec3 res = src.rgb;
float l = dot(res, luma);
float g = 2.2/dot(sum.rgb, luma);
float g = exposure / dot(sum.rgb, luma);
res /= l;
//res = log(res + vec3(2.)) - log(vec3(2.));
//res = pow(res,vec3(1/2.2));