armory3d / armory

3D Engine with Blender Integration
https://armory3d.org
zlib License
3.06k stars 315 forks source link

Translucency is broken #1032

Closed MiloHX closed 5 years ago

MiloHX commented 5 years ago

Tested with 2.79 and 2.8, if the scene has translucent material, it will fail to compile: image

luboslenco commented 5 years ago

Will be back soon, upgrading lots of stuff for 0.6. :slightly_smiling_face:

FuriouZz commented 5 years ago

Temporary fix in make_transluc.py

    # sh = tese if tese != None else vert
    # sh.add_out('vec4 wvpposition')
    # sh.write('wvpposition = gl_Position;')

    # Remove fragColor = ...;
    frag.main = frag.main[:frag.main.rfind('fragColor')]

    frag.write('\n')
    # frag.write('vec4 premultipliedReflect = vec4(vec3(direct * lightColor * visibility + indirect * occlusion) * opacity, opacity);')
    frag.write('vec4 premultipliedReflect = vec4((direct + indirect * occlusion) * opacity, opacity);')

wvpposition is declared twice (Declared in the make_cluster too) lightColor and visibility are no longer declared

luboslenco commented 5 years ago

Should at least compile now. Additional improvements soon.