Handle ldr envmaps

This commit is contained in:
Lubos Lenco 2017-01-08 11:25:30 +01:00
parent 3288c4d804
commit 559567de37
2 changed files with 3 additions and 5 deletions

View file

@ -194,6 +194,9 @@ void main() {
#ifdef _EnvTex
vec3 n = normalize(normal);
vec3 R = texture(envmap, envMapEquirect(n)).rgb * envmapStrength;
#ifdef _EnvLDR
R = pow(R, vec3(2.2));
#endif
#endif
#endif
@ -214,9 +217,6 @@ void main() {
float gamma_val = acos(cos_gamma);
vec3 R = Z * hosekWilkie(cos_theta, gamma_val, cos_gamma) * envmapStrength;
// #ifndef _LDR
// R = pow(R, vec3(2.2));
// #endif
#endif
#ifdef _EnvClouds

View file

@ -148,8 +148,6 @@ def parse_color(world, node, context, envmap_strength_const):
log.warn(world.name + ' - unable to open ' + image.filepath)
return
envmap_strength_const['float'] *= 2.0 # Match to cycles
tex = {}
context['bind_textures'].append(tex)
tex['name'] = 'envmap'