~nightshade-dev/nightshade/trunk

« back to all changes in this revision

Viewing changes to src/nebula.cpp

  • Committer: Trystan Larey-Williams
  • Date: 2011-06-01 23:25:13 UTC
  • mfrom: (128.15.20 trunk)
  • Revision ID: tlareywi@trystan.digitaliseducation-20110601232513-xpimcjm6immeonp0
local merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
s_font* Nebula::nebula_font = NULL;
38
38
float Nebula::circleScale = 1.f;
39
39
float Nebula::hints_brightness = 0;
 
40
float Nebula::nebula_brightness = 1;
40
41
Vec3f Nebula::label_color = Vec3f(0.4,0.3,0.5);
41
42
Vec3f Nebula::circle_color = Vec3f(0.8,0.8,0.1);
42
43
bool Nebula::flagBright = false;
405
406
// daylight hackery
406
407
        float ad_lum=eye->adapt_luminance(luminance);
407
408
 
408
 
        // TODO this should be revisited to be less ad hoc
409
 
        // 3 is a fudge factor since only about 1/3 of a texture is not black background
410
 
        float cmag = 3 * ad_lum / tex_avg_luminance * tex_luminance_adjust;
411
 
        glColor4f(cmag,cmag,cmag,1.0);
412
 
 
413
 
        //      if(flagBright && sky_brightness < 0.011 && get_on_screen_siznebule(prj, nav)>12.)
 
409
        Vec3f color(1,1,1);
414
410
        if (flagBright && sky_brightness < 0.011 && (get_on_screen_size(prj, nav) > prj->getViewportHeight()/64.))      {
415
411
                //        cout << "Bright nebula drawn for" << getEnglishName() << endl;
416
 
                glColor4f(1.0,1.0,1.0,1.0);
 
412
                color = color * nebula_brightness;
 
413
        } else {
 
414
 
 
415
                // TODO this should be revisited to be less ad hoc
 
416
                // 3 is a fudge factor since only about 1/3 of a texture is not black background
 
417
                float cmag = 3 * ad_lum / tex_avg_luminance * tex_luminance_adjust;
 
418
                color = color * cmag * nebula_brightness;
417
419
        }
418
 
        // ... DIGITALIS - put something better in svn
 
420
 
 
421
        glColor4f(color[0], color[1], color[2], 1);
419
422
 
420
423
        glBindTexture(GL_TEXTURE_2D, neb_tex->getID());
421
424