Hi, I’ve been loading some 3D models without any textures for a school project. I’m trying to use setColor() to set the rgb values for the models. However whenever I use it the Colors don’t come out different, for example, 0,130,255,1 is the same as 0,255,15,1. Is there a fix for this or is this just how it is?
setColor() takes in values between
To add to that, in order to convert from values in the range 0…255 to the required range of 0…1, just take your value in the former range and divide it by 255.
Ah ok, thank you so much.
Will do, thank you.
This only works if you are not using gamma-correction. If you are using an sRGB-correct pipeline, the conversion can be done using the
from panda3d.core import decode_sRGB_uchar as dc np.set_color(dc(127), dc(127), dc(63), 1.0)
This should not be done for the alpha channel.