diff options
Diffstat (limited to 'Master/texmf-dist/asymptote/shaders')
-rwxr-xr-x | Master/texmf-dist/asymptote/shaders/fragment.glsl | 20 | ||||
-rwxr-xr-x | Master/texmf-dist/asymptote/shaders/vertex.glsl | 2 |
2 files changed, 9 insertions, 13 deletions
diff --git a/Master/texmf-dist/asymptote/shaders/fragment.glsl b/Master/texmf-dist/asymptote/shaders/fragment.glsl index cdcc0b49e83..057acbc744f 100755 --- a/Master/texmf-dist/asymptote/shaders/fragment.glsl +++ b/Master/texmf-dist/asymptote/shaders/fragment.glsl @@ -135,29 +135,25 @@ void main() Material m; #ifdef TRANSPARENT m=Materials[abs(materialIndex)-1]; - if(materialIndex >= 0) { + emissive=m.emissive; + if(materialIndex >= 0) diffuse=m.diffuse; - emissive=m.emissive; - } else { + else { diffuse=Color; -#if Nlights > 0 - emissive=vec4(0.0); -#else - emissive=Color; +#if Nlights == 0 + emissive += Color; #endif } #else m=Materials[int(materialIndex)]; + emissive=m.emissive; #ifdef COLOR diffuse=Color; -#if Nlights > 0 - emissive=vec4(0.0); -#else - emissive=Color; +#if Nlights == 0 + emissive += Color; #endif #else diffuse=m.diffuse; - emissive=m.emissive; #endif #endif diff --git a/Master/texmf-dist/asymptote/shaders/vertex.glsl b/Master/texmf-dist/asymptote/shaders/vertex.glsl index 9a54d3211ca..4b2a54b9897 100755 --- a/Master/texmf-dist/asymptote/shaders/vertex.glsl +++ b/Master/texmf-dist/asymptote/shaders/vertex.glsl @@ -34,7 +34,7 @@ void main() #ifndef ORTHOGRAPHIC ViewPosition=(viewMat*v).xyz; #endif - Normal=normal*normMat; + Normal=normalize(normal*normMat); #endif #ifdef COLOR |