Changeset 8554:52a156152f7e in orange


Ignore:
Timestamp:
08/01/11 12:54:47 (3 years ago)
Author:
matejd <matejd@…>
Branch:
default
Convert:
559e3ab036734d9ff105379272e1a880ab6940e2
Message:

Lighting disabled for 2d symbols for now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owplot3d.py

    r8539 r8554  
    553553                float manhattan_distance = max(max(pos.x, pos.y), pos.z)+5.; 
    554554                float a = min(pow(min(1., view_edge.x / manhattan_distance), 5.), transparency.x); 
    555                 // Calculate the amount of lighting this triangle receives (diffuse component only). 
    556                 vec3 light_direction = normalize(vec3(1., 1., 0.5)); 
    557                 float diffuse = max(0., dot(normalize((gl_ModelViewMatrix * vec4(normal, 0.)).xyz), 
    558                                     light_direction)); 
    559                 var_color = vec4(color.rgb+diffuse*0.7, a); // Physically wrong, but looks better. 
     555                if (use_2d_symbols) { 
     556                    var_color = vec4(color.rgb, a); 
     557                } 
     558                else { 
     559                    // Calculate the amount of lighting this triangle receives (diffuse component only). 
     560                    // The calculations are physically wrong, but look better. TODO: make them look better 
     561                    vec3 light_direction = normalize(vec3(1., 1., 0.5)); 
     562                    float diffuse = max(0., 
     563                        dot(normalize((gl_ModelViewMatrix * vec4(normal, 0.)).xyz), light_direction)); 
     564                    var_color = vec4(color.rgb+diffuse*0.7, a); 
     565                } 
    560566                if (manhattan_distance > view_edge.x && hide_outside) 
    561567                    var_color.a = 0.; 
Note: See TracChangeset for help on using the changeset viewer.