I kind of know how to change a models shading with a color ramp but most of the time I'm in a situation where I have to use a gradient that isn't in a gradient format like png or jpg. i have no way to recreate the gradient with the color ramp. is there a way to make a image texture get recognized as a gradient/color ramp in blender? no idea if image links work.

i have a model from a game that uses gradients, something i want to do is to bake a texture with the gradient colors so i can use it in other games just in case they don't use gradients(this one game only supports gradients) image of model in blender,gradient,ingame This is what the texture looks like. grayscale basecolor This is what gradient i want to use, i can only have access to a png format, not something i can even use in photoshop. gradient, use for your testing/experimentation

  • $\begingroup$ Can you describe your node setup? Do you use the gradient directly for color input or do you use it to change the colors of a texture? For example: Image Texture (diffuse color) => Colorramp => Principled BSDF and you want to replace the Colorramp with a PNG? $\endgroup$ – Blunder Feb 13 at 12:11

Sure. If you have an image describing some gradient, you can use a texture lookup in the exact same way you'd use a colorramp:

enter image description here

This technique is actually pretty common with some old game techniques.

  • $\begingroup$ i want to make a model have toon shading but instead of a color ramp i want to use a png of a gradient, image textures don't work like color ramps work. $\endgroup$ – whynotll83 Feb 13 at 0:02
  • $\begingroup$ Not exactly, no, but mostly, they do. If you provide more info about what your particular situation and problem is-- particularly if you link a file-- people could probably help you figure out what the problem is. $\endgroup$ – Nathan Feb 13 at 0:21
  • $\begingroup$ lets just say i have a color gradient that i downloaded online, its only in a png format and blender doesn't let me import custom colorramps. is there a solution? $\endgroup$ – whynotll83 Mar 15 at 17:01
  • $\begingroup$ @whynotll83 If you're having trouble, I'd need more information to help you out. A file showing what you're trying, and desired output, and probably any kind of documentation on what you're trying to achieve. All of that would be best added to the original question. $\endgroup$ – Nathan Mar 15 at 22:28
  • $\begingroup$ i don't know how to explain it. heres a imgur i made imgur.com/a/yQnD7BA , this is a pdf on what the game makers did to achieve this effect, no idea how much it helps but its something. steamcdn-a.akamaihd.net/apps/valve/2010/… $\endgroup$ – whynotll83 Mar 19 at 8:08

You can use an image texture the same way you'd use a color ramp - using the brightness/ value of the black and white texture drive the x-position of the color gradient. The uv coordinates are always within the range of [0..1] so even if your gradient is 256 pixels wide this will work. Black and white texture color graded

As you can see from this badly unwrapped dude you'll have to make sure that the individual gradients fit the brightness range of the respective texture elements, otherwise you'll get problems with cliping.

This is pretty much the same answer as above, just with the texture instead of coordinates


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.