Combining diffuse textures in material


Here is my issue: I have a number of grayscale textures that I would like to be able to apply a combination of color gradients to. If I were to render these out to individual image files, it would result in a very large number of files that would undoubtedly take up a lot of storage space in my final package. However, the per-pixel operation to do this is fairly simple (color multiply - multiply each color channel from the two source colors together).

While it would not be terribly complicated to implement a code solution that generates the intended textures from source files (which then are cached and applied to object materials, naturally), is there a way to do this that’s already built into the engine? Would it be possible for me to extend the lighting material definition file to perform this operation? The lighting material definition seems to already support a multiply-based operation with its flat color modifiers, but I can understand if combining textures in this way may be a more complex operation than the material engine was intended to perform.

Finally, although this is a bit of a separate question, but am I right in assuming that there’s currently no handling of indexed image textures?

JME doesn’t do this out of the box… but as you hint at, it would be fairly easy for you to add it to Lighting.j3md. Just fork it and add your own code.

…it does require learning a little bit about shader programming but I can tell you from experience that it’s a skill with lots of rewards. (Plenty of frustration but lots of rewards, too.)

yes, like comment above, its something that could be easly done in shader.(you just need multiple color by grayscale). If you dont want fork Lightning or PBR shader, there are also Shader Nodes where you could simply use ShaderNodes too.

Anyway thats how for example all character tatoos/hair colors/skin color/etc,etc is made. All with shader.

1 Like