fabin Posted April 15, 2025 Share Posted April 15, 2025 (edited) 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. (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: 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): 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: Spoiler 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: Spoiler And for the last step, i'll desaturate every color except blue by a LOT: Spoiler I've also lightened up the cyans. Every color is desaturated by -75. 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: To get this: 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! 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 April 18, 2025 by fabin Added the code for the batch file. 1 1 Link to comment https://forums.kleientertainment.com/forums/topic/165348-guide-making-a-custom-colour-cube/ Share on other sites More sharing options...
_zwb Posted May 14, 2025 Share Posted May 14, 2025 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? Link to comment https://forums.kleientertainment.com/forums/topic/165348-guide-making-a-custom-colour-cube/#findComment-1815957 Share on other sites More sharing options...
fabin Posted May 20, 2025 Author Share Posted May 20, 2025 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? Link to comment https://forums.kleientertainment.com/forums/topic/165348-guide-making-a-custom-colour-cube/#findComment-1816498 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now