Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • calemx: death's-server has officially been released, come check us out  - [link]
      September 13, 2019, 04:14:21 AM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 12, 2019, 12:26:40 PM
    • cbrophy: would my account from 2013 work?
      September 12, 2019, 05:04:43 AM
    • ragnoroker: RuneGuild has officially been released, come check us out - [link]
      September 11, 2019, 11:26:35 AM
    • ragnoroker: RuneGuild has officially been released, come check us out - [link]
      September 11, 2019, 11:26:31 AM
    • ragnoroker: RuneGuild is due to be released tomorrow! First few players will recieve some goodies. Sign up on our website [link] Join our discord for updates [link]
      September 07, 2019, 07:43:28 PM
    • ragnoroker: RuneGuild is due to be released tomorrow! First few players will recieve some goodies. Sign up on our website [link] Join our discord for updates [link]
      September 07, 2019, 07:42:59 PM
    • ChrisMeadows: Yo, what's the forum's discord?
      September 04, 2019, 08:33:06 PM
    • newerarsps: i cannot register to rsps list anyone can help?
      September 01, 2019, 11:24:00 PM
    • PavSwag: Date Registered: July 03, 2012, 03:54:45 PM Think im just as good vet as u man, + I have over 80B in rs3 think im good on anyones 100k ass lookin bank b oi
      August 27, 2019, 10:48:09 AM
    • PavSwag: autoscape is the most legit server i have  ever played. infernal dragons and twisted bows
      August 27, 2019, 10:41:20 AM
    • PavSwag: Join autoscape,0rg fun events daily for infernal mystery boxes only server with Infernal Twisted Bow
      August 26, 2019, 12:09:40 AM
    • Sblasko9: Date Registered: May 04, 2007
      August 25, 2019, 12:24:35 PM
    • ganch: but you're not falsely accusing us of having a rat in our cache
      August 24, 2019, 01:21:05 AM
    • bumfluff120: my acc was made in 2006, btw
      August 24, 2019, 01:06:55 AM
    • ganch: also @hodford, your account was made in 2013 btw. I am an owner of autoscape, I'd like to see your virustotal scan of our cache
      August 23, 2019, 10:18:15 PM
    • ganch: @hodford if autoscape cache has a keylogger in the cache, then how come you posted an ad for them?
      August 23, 2019, 10:12:05 PM
    • ragnoroker: New Server! - Join today, double exp this weekend :) - [link]
      August 22, 2019, 11:44:10 AM
    • ragnoroker: New Server! - Join today, double exp this weekend :) - [link]
      August 22, 2019, 11:44:02 AM
    • gogata: holy crap time to make a rsps again 10 years later since i made this acc LOL
      August 21, 2019, 03:23:51 PM

    Author Topic: 317 Client RGB/HSL  (Read 3185 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    317 Client RGB/HSL
    « on: March 26, 2016, 06:21:26 AM »
    The older clients use a 16 bit color. The most significant 6 bits are used for hue, the least significant 7 bits are used for lightness or luminosity, and the other 3 bits are used for saturation. As you can see there isn't much room for variation in terms of saturation, which I find could be fairly limiting. But they did have support to where they could have effective lighting, but even if you're interpolating colors between vertices you only have 7 bits of variance which isn't much. I think it's easy to see why 32 bit color is superior.

    You either had: Very grey, Very intense?, or normal.

    https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion

    Here's more information on the subject.

    Code: Java
    1.  
    2.   publicstaticvoid initColorTable(double d){
    3.     d +=Math.random()* 0.029999999999999999D - 0.014999999999999999D;
    4.     int j =0;
    5.     // 6 bits of hue
    6.     // 3 bits of saturation
    7.     // 7 bits of lightness
    8.     // hhhhhhssslllllll
    9.     for(int i =0; i <512; i++){
    10.       double hue =(double)(i >>3)/ 64D + 0.0078125D;
    11.       double saturation =(double)(i &7)/ 8D + 0.0625D;
    12.       for(int lightness =0; lightness <128; lightness++){
    13.         double l =(double) lightness / 128D;
    14.         // Achromatic, no saturation.
    15.         double r = l;
    16.         double g = l;
    17.         double b = l;
    18.         if(saturation != 0.0D){
    19.           double p;
    20.           if(l < 0.5D){
    21.             p = l *(1.0D + saturation);
    22.           }else{
    23.             p =(l + saturation)- l * saturation;
    24.           }
    25.           double q = 2D * l - p;
    26.  
    27.           double redHue = hue + 0.33333333333333331D;
    28.           if(redHue > 1.0D){
    29.             redHue--;
    30.           }
    31.  
    32.           double greenHue = hue;
    33.  
    34.           double blueHue = hue - 0.33333333333333331D;
    35.           if(blueHue < 0.0D){
    36.             blueHue++;
    37.           }
    38.  
    39.           if(6D * redHue < 1.0D){
    40.             r = q +(p - q)* 6D * redHue;
    41.           }elseif(2D * redHue < 1.0D){
    42.             r = p;
    43.           }elseif(3D * redHue < 2D){
    44.             r = q +(p - q)*(0.66666666666666663D - redHue)* 6D;
    45.           }else{
    46.             r = q;
    47.           }
    48.  
    49.           if(6D * greenHue < 1.0D)
    50.             g = q +(p - q)* 6D * greenHue;
    51.           elseif(2D * greenHue < 1.0D)
    52.             g = p;
    53.           elseif(3D * greenHue < 2D)
    54.             g = q +(p - q)*(0.66666666666666663D - greenHue)* 6D;
    55.           else
    56.             g = q;
    57.  
    58.           if(6D * blueHue < 1.0D)
    59.             b = q +(p - q)* 6D * blueHue;
    60.           elseif(2D * blueHue < 1.0D)
    61.             b = p;
    62.           elseif(3D * blueHue < 2D)
    63.             b = q +(p - q)*(0.66666666666666663D - blueHue)* 6D;
    64.           else
    65.             b = q;
    66.         }
    67.         int ri =(int)(r * 256D);
    68.         int gi =(int)(g * 256D);
    69.         int bi =(int)(b * 256D);
    70.         int rgb =(ri <<16)+(gi <<8)+ bi;
    71.         rgb = intensify(rgb, d);
    72.         if(rgb ==0){
    73.           rgb =1;
    74.         }
    75.         colorTable[j++]= rgb;
    76.       }
    77.     }
    78. }
    79.  
    80.  


    Code: Java
    1.   privatestaticint repackHSL(int hsl, int lightIntensity, int mode){
    2.     if((mode &2)==2){
    3.       if(lightIntensity <0){
    4.         lightIntensity =0;
    5.       }elseif(lightIntensity >127){
    6.         lightIntensity =127;
    7.       }
    8.       lightIntensity =127- lightIntensity;
    9.       return lightIntensity;
    10.     }
    11.     lightIntensity = lightIntensity *(hsl & 0x7f)>>7;
    12.     if(lightIntensity <2){
    13.       lightIntensity =2;
    14.     }elseif(lightIntensity >126){
    15.       lightIntensity =126;
    16.     }
    17.     return(hsl & 0xff80)+ lightIntensity;
    18.   }
    19.  
    « Last Edit: March 26, 2016, 06:33:33 AM by sini »
    Runescape Gambling

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal