Jump to content

Recommended Posts

I haven't seen a proper guide on these yet, and since i think they're neat, i thought of making a short one.

What you'll need:

  • A good text editor. Notepad++ or Visual Studio Code are good picks, but this is up to your preference, really.
  • Don't Starve Mod Tools.
  • An image editor. I recommend GIMP or Photopea.
  • The identity Color Cube.
    • This is the extracted file, so just save this as an image for later.
    • identity_colourcube.png.e01d926993207f85fdec5467f65b7782.png
  • (Optional) A sample image. Preferably without any color correction.
    • You can do this by creating a caveless world, opening the console, and take a screenshot after running this command:
    • TheWorld:PushEvent("overridecolourcube", "images\colour_cubes\identity_colourcube.tex")
  • Elbow grease and some patience :].

Making the Color Cube:

First, make sure to download the Identity CC that i provided above, save it where your project will be. Open up your image editor of choice and put in your CC image. For the sake of making this easier, i'll also use a sample image along it so you can see the changes more clearly.

So currently, this is what we got:

1.png.0dd3250efab39fe23f32b71a750ba1ea.png

Aligning it to the one of the corners of the project makes it easier to crop out the CC. I've also merged the two layers (CC Layer and Sample Layer) so i can simultaneously apply changes to both.

Alright, as an example, i'm going to make a blue vision-y effect, similar to when winter comes around and colors get colder, but intenser. We can start out by going to the top bar and selecting "Colors > Curves" (Path may vary if you're not using GIMP):

gimp-3_RfkAr9oCZm.png.8c31aac4fe61192baaf945d8671c4ab5.png

I'll bring up the Blues and turn down the Reds and Greens, as well as raising the overall brightness a bit near the bottom. What this'll do is tint everything in Blue-ish hue, and turn down the contrast of the overall image to get this effect:

2.png.042e31f0bd6446b67f9c7d00ac0c7aee.png

Spoiler

gimp-3_P80Ra5eU85.png.ff77f3d2db21191fa33bfc57d0604a05.pnggimp-3_K9OFUSFKgz.png.0617a8d4087fecfd5fdc4166f645de33.pnggimp-3_DcrPaC2qor.png.e0648f1b1202eec47eb964c0c9298e41.pnggimp-3_B7LhLek506.png.66ea5981332247bf413bfeeecbcf1200.png

It looks a bit dark, so next i'll use "Colors > Color Temperature" to shift the colors to a colder palette, and using "Colors > Hue-Saturation" to desaturate and brigthen it up a smidge:
3.png.324e78fa76d16a47a6720ee3280dc86d.png

Spoiler

gimp-3_iUevHAnJzM.png.24e840c3de3c51a2326565113abb311f.pnggimp-3_h9EZvX3Mb6.png.4414b45d9b068c585a384012dfffcd56.png

And for the last step, i'll desaturate every color except blue by a LOT:
4.png.df9d7029e5c58de00033721be483ef4b.png

Spoiler

I've also lightened up the cyans. Every color is desaturated by -75.

gimp-3_HkcWcdhwol.png.7259d568a4aa546084463a03372b892d.png

And there we go! We got our Color Cube! Doesn't it look so blue and alien? Now that we've done everything to mangle and distort this image's colors, all we need to do to export our CC Image is to crop it using "Image > Canvas Size" like so:

gimp-3_Ts6yas9HWu.png.3ef4b5f7259c5c277bfaa54cdcbf29f1.png

To get this:

5.png.5b36c9a22064e440a89a4fb226ea0554.png

Now let's get it working in-game!

Converting your Color Cube:

To get this in-game, you'll need to convert the CC Image into a valid Tex File so the game can properly load it! You can do this with the Don't Starve Mod Tools.

Go to this path:

"C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\tools\bin"

Or alternatively, go to Steam, and in your Library, search for "Don't Starve Mod Tools", Right Click it > Browse Local Files. That should put you in its directory. Now go to mod_tools\tools\bin\, you should see a lil' program called "TextureConverter.exe". Inside the folder, Shift + Right Click to open the right click menu, and you should see "Open PowerShell Window Here". Now type this command in:

.\TextureConverter.exe -i <path-to-your-cc-image.png> -o <path-to-output-cc.tex> -f rgb -t 2d -opengl

These values are placeholders, so you should replace it with the path of your CC Image file, and then the path of the output. Like so:

.\TextureConverter.exe -i "C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\tools\bin\cool_vision.png" -o "C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\tools\bin\cool_vision_cc.tex" -f rgb -t 2d -p opengl

Running this should plop a Color Cube Tex File where you specified. Now all that's needed is to put it in a mod!

I've made a little batch file to make this process easier if you want to download it. To use it, just drag and drop your image file on top, and it should hopefully work! ConvertToCC.bat

Spoiler

Or you can also paste this code into a .txt file, and convert it into .bat by changing its extension.

@echo off
SET "texdir=C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\tools\bin"
"%texdir%\TextureConverter.exe" -i "%~1" -o "%~dpn1_cc.tex" -f rgb -t 2d -p opengl
echo Output saved to: "%~dpn1_cc.tex"
pause

Using it in-game:

This part i'm less confident in, as i've not dabbled with server-side mods yet, but from the looks of it it doesn't seem complicated. But here i'll stick with it being a client-side mod just for testing. I'm not sure this will work with a world with caves, so turn them off when creating a test world for this.

First, let's load in our Color Cube. I've named it here "cool_vision_cc.tex", but y'know, you can name it anything else.

-- Load in our color cube
Assets = {
    Asset("IMAGE",  "images/colour_cubes/cool_vision_cc.tex"),
}

Then, we're going to create a table to assign our CC to.

-- So we don't have to type GLOBAL.resolvefilepath every time we want to call it
local resolvefilepath = GLOBAL.resolvefilepath

-- Assign our Color Cubes
local COOL_VISION_CC = {
    day = resolvefilepath("images/colour_cubes/cool_vision_cc.tex"),
    dusk = resolvefilepath("images/colour_cubes/cool_vision_cc.tex"),
    night = resolvefilepath("images/colour_cubes/cool_vision_cc.tex"),

    full_moon = resolvefilepath("images/colour_cubes/cool_vision_cc.tex"),
}

And for ease of testing, we're going to use SetCustomCCTable() from playervision.lua to override the current active Color Cube. I've set up a simple handler, that when you press down both CTRL + V, it switches between the CC being active or not.

AddPlayerPostInit(function(inst)
    local ThePlayer = GLOBAL.ThePlayer
    local TheFocalPoint = GLOBAL.TheFocalPoint
    local vision_on = false -- To track if the effect is active or not

    local is_down, down = nil, down -- Tracks whether the key combo is currently held
    GLOBAL.TheInput:AddKeyHandler(function(key, down) -- Add an input handler so we can track keys pressed
        if GLOBAL.TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and key == GLOBAL.KEY_V then -- CTRL + V pressed
            if not is_down and down then -- Only trigger once on initial press
                is_down = true -- Currently being pressed
                if not vision_on then
                    vision_on = true
                    inst.components.playervision:SetCustomCCTable(COOL_VISION_CC)
                    TheFocalPoint.SoundEmitter:PlaySound("dontstarve_DLC001/common/moggles_on")
                    print("GLEEBY VISION ACTIVE!")
                elseif vision_on then 
                    vision_on = false 
                    inst.components.playervision:SetCustomCCTable(nil)
                    TheFocalPoint.SoundEmitter:PlaySound("dontstarve_DLC001/common/moggles_off")
                    print("GLEEBY VISION DISABLED!")
                end
            elseif is_down and not down then 
                is_down = false -- No longer being pressed
            end
        end -- End of if statement
    end) -- End of KeyHandler
end) -- End of PlayerPostInit

If everything goes right, you should end up with this!

322330_20250415015439_1.png.a3f064669484ce8d89d80e446ec6658a.png

A very washed out, blue and alien tint to everything. Hopefully this guide will help out some peeps that needed a starting point to start messing around with Color Cubes. I'll leave this simple mod as a download here, have fun! :]

color_cube.zip

 

Edited by fabin
Added the code for the batch file.
  • Like 1
  • Thanks 1
On 5/14/2025 at 4:51 AM, _zwb said:

how does the identity colour cube maps to the actual colour cube we see in game?

Guessing by the method you used, is it some kind of matrix transformation from the colour in identity cube to the colour cube?

honestly i have no clue. it probably is what you just said, as they just seem to be color look-up tables that are uncompressed into a strip that's 1024x32, or in other words, a 32x32x32 3D LUT. it probably uses the identity colour cube as a base, and blends between them slowly when switching by blending the colors until it overrides it?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...