Fix area lamp intensity

This commit is contained in:
Lubos Lenco 2017-06-25 23:16:49 +02:00
parent dc7a4d40ae
commit 07ea79b376
6 changed files with 17 additions and 11 deletions

View file

@ -23,9 +23,9 @@ void main() {
col /= 4.0;
float brightness = dot(col.rgb, vec3(0.2126, 0.7152, 0.0722));
// if (brightness > bloomThreshold) {
// fragColor.rgb = vec3(col.rgb);
// return;
// }
if (brightness > bloomThreshold) {
fragColor.rgb = vec3(col.rgb / 2);
return;
}
fragColor.rgb = vec3(0.0);
}

View file

@ -21,7 +21,7 @@ out vec4 fragColor;
const float weight[20] = float[] (0.06649, 0.065575, 0.062905, 0.058694, 0.053269, 0.047023, 0.040375, 0.033719, 0.027391, 0.021642, 0.016633, 0.012433, 0.00904, 0.006393, 0.004398, 0.002943, 0.001915, 0.001212, 0.000746, 0.000447);
void main() {
vec2 step = dir / 400.0 * bloomRadius; //screenSize.xy;
vec2 step = dir / 100.0 * bloomRadius; //screenSize.xy;
fragColor.rgb = texture(tex, texCoord).rgb * weight[0];
@ -83,5 +83,5 @@ void main() {
fragColor.rgb += texture(tex, texCoord + step * 19.5).rgb * weight[19];
fragColor.rgb += texture(tex, texCoord - step * 19.5).rgb * weight[19];
fragColor.rgb *= bloomStrength;
fragColor.rgb *= bloomStrength / 4;
}

View file

@ -287,7 +287,13 @@ void main() {
float ltcspec = ltcEvaluate(n, v, dotNV, p, invM, lampArea0, lampArea1, lampArea2, lampArea3);
ltcspec *= texture(sltcMag, tuv).a;
float ltcdiff = ltcEvaluate(n, v, dotNV, p, mat3(1.0), lampArea0, lampArea1, lampArea2, lampArea3);
fragColor.rgb = albedo * ltcdiff + ltcspec;
#ifdef _Cycles
float facdif = min((1.0 - metrough.x) * 3.0, 1.0);
float facspec = min(metrough.x * 3.0, 1.0);
fragColor.rgb = albedo * ltcdiff * facdif + ltcspec * facspec;
#else
fragColor.rgb = albedo * ltcdiff + ltcspec;
#endif
}
else {
#endif

View file

@ -2127,7 +2127,7 @@ class ArmoryExporter:
if o['type'] == 'point' or o['type'] == 'spot':
o['strength'] *= 0.026
elif o['type'] == 'area':
o['strength'] *= 0.026
o['strength'] *= 0.26
elif o['type'] == 'sun':
o['strength'] *= 0.325
# TODO: Lamp texture test..

View file

@ -155,8 +155,8 @@ def make_deferred(cam):
if not cam.rp_translucency:
relink('Set Target Accum', 'Bloom')
# if not cam.rp_bloom:
relink('Bloom', 'SSS')
if not cam.rp_bloom:
relink('Bloom', 'SSS')
if not cam.rp_sss_state == 'On':
relink('SSS', 'SSR')

View file

@ -146,7 +146,7 @@ def set_preset(self, context, preset):
cam.rp_ssr = True
cam.rp_dfrs = False
cam.rp_dfao = False
cam.rp_bloom = True
cam.rp_bloom = False
cam.rp_motionblur = 'None'
wrd.lighting_model = 'Cycles'
wrd.generate_pcss_state = 'On'