Modding Help materialHueShift

Discussion in 'Starbound Modding' started by Camtire, Jan 15, 2014.

  1. Mackinz

    Mackinz The Waste of Time

    Very cool!

    Now, what happens when you place them and mine them?
     
    Wiranum and Your Buddy Bill like this.
  2. MrMagical

    MrMagical Subatomic Cosmonaut

    My guess is that when the material is placed into the world, the hue shift loses some precision to save memory space.
    It seems like it is squeezed into one of 256 possible values.

    The closest I've gotten to replicating this "rounding" effect in lua script is:
    Code:
    math.floor( n / (360/255) ) * (360/255)
    Where n is the non-rounded hue shift. But the code produces results that are just slightly off.
    n = 90 gives:
    88.941176470588 (value from the script, this is incorrect)
    88.9411773681640625 (the most exact form of the game's true value, what we actually want)

    As you can see, the error is very small, but is big enough to cause the lua script's version not to stack with the game's version.
    Perhaps it can be tweaked to get different results. Maybe the order of things matters. It just needs to get a little closer to the true value.
     
    Mackinz and Your Buddy Bill like this.
  3. Your Buddy Bill

    Your Buddy Bill Existential Complex

    holy shit you guys have made progress
    I'm listening intently.
     
  4. The | Suit

    The | Suit Agent S. Forum Moderator

    So basically it is 2 rgb values pointing from starting color [top left ] to ending color [ bottom right ] ?
     
  5. Camtire

    Camtire Phantasmal Quasar

    Thank you all for your help on my project. I have not been very well, and IRL stuff has also slowed me down quite a bit, but I haven't forgotten nor have I stopped all together. CFFaccount, you've done a great job with all your testing. Believe it or not, I made a similar dirt line using values from 0 to 360 (-180 to 180) and was in the process of mining them all and checking the hue values for Starbound's rounded numbers.

    As for your metal tree (or anything else that is completely grey), the reason it won't change colour is because you are only shifting the hue of the colour. Grey has no colour saturation, and there must be at least a minor amount of colour for the shift to work. For an example, if you place in a mod this cobblestone I modified to be dirty brown, you'll see why cobblestone doesn't stack. They have different hue shift values, but it wasn't visible because of the lack of colour saturation in the original texture. One of the mods I intend on posting as soon as I can adds a small amount of colour to grey items for more obvious variations.

    If you have paint shop, paint.net, or nearly any other art program, you can see hue shift and saturation in action. (PSP: Colors -> Adjust -> Hue/Saturation/Lightness) (Paint.net: Adjustments -> Hue/Saturation). Put any photo in there and slide around the hue, and the whole photo will change colours. Remove the saturation completely, the photo becomes black & white and hue shifts have no effect on it.

    cobblestone.png ----> CobblestoneIG1.png
     
    Mackinz likes this.
  6. CFFaccount

    CFFaccount Void-Bound Voyager

    I figured something like that was happening to the metal trees, but I wanted to show I did try and test it.

    Let me know if you need any info on the trees or flowers I made. I'll do what I can.
     
  7. Your Buddy Bill

    Your Buddy Bill Existential Complex


    Starbound has always had issues with making wraparound work properly. World wrapping used to cut off dungeons, and it still does on the smallest planet types. Also you can't skyrail across the world wrap boundary.
     
  8. CFFaccount

    CFFaccount Void-Bound Voyager

    How interesting!! I wonder if that particular problem has some relation to the dirt color (that's having problems) being the default or 0/360 value, since that would be the end/beginning of the color wheel.
     
  9. Your Buddy Bill

    Your Buddy Bill Existential Complex

    I found a planet in which the 0 hueshift dirt was located next to some green or purple dirt (i forget which) and some other odd sand color, and got the same blue edge. I'm guessing it's related to a 0 hueshift. Not certain though.
     

Share This Page