How to apply multiple ramp textures to toon examples

only one ramp seems to be supported “internally” by materials, is this true or am I missing something

I used TestTransparentCartoonEdge to try a few things that didn’t work…one ramp seems to override the other regardless

1 Like

Ok was able to work a second ramp into by modifying lightblow shaders but sadly it doesn’t look like I had hoped, so I am contemplating a different approach… think I can build some parts of my blender toon shader with glsl…i am definitely not strong with shaders though and took the approach of researching how each component of my toon effects could be built in glsl

Have already found a lambert implementation and a an implementation of photoshop blend mode maths
Photoshop math with GLSL shaders | Projects, Software, Programming, GLSL - Romz Blog
Colour ramp in linearlight mode blended with lambert diffuse is a key component of my toon materials in blender so I am hoping it will look the same or close in jme if I am successful

Could use some advice though,firstly I want to know if am doing anything that would already exist in jme 3 that can be extended or modified or should i build a new shader

1 Like

What are you trying to achieve with the second color ramp?

The way the color ramp is used in TestTransparentCartoonEdge is to produce sharp changes in shading instead of smooth ones.

Do you have a reference picture of what effect you are trying to create?

1 Like

Basically trying to reproduce the shading parameters that I used to create that above as much as possible but image ramps won’t work at least not by itself

1 Like

Thank you for the image.
From the image I can see that the characters have soft shading but with hard shadows.

Can you not accomplish this by using a single color ramp?

Here is the TestTransparentCartoonEdge with custom colorramp (32x1). The colorramp is scaled and shown in upper right corner.

Next I can also see the rim light. Rim light depends on the view direction(eg. dot(viewDir, vertexNormal)), which is different to shading which depends on lightDir and vertex normal.

Thus, as far as I know, you need to create your own material to create the rim light effect.

1 Like

odd…used a hardlight ramp and didn’t get that result…hmm maybe eclipse did something wonky with the asset…hold on let me see

1 Like

Ok i worked up a ramp that kinda looks like what I want, I’m just not getting the high contrasty look or the ramps to affect the areas i want just yet on the character I tested on. …

1 Like

Ok have decided to go the shader route with this…not great with shaders but blender has a function and addon that exports material components to glsl code blocks…so I am going to try and emulate the toon effect as it looks in blender.

One question though, I know it would be best to export the pencil strokes to a texture since they are made with procedural textures but are there any gotchas to consider when using coded color blends and ramps to combine with texture maps

1 Like

If you are talking about using multiple textures in blender’s material and the blending operations on them, then there might be problems with export. Since you will then most probably need a custom shader for such material. If that is what you are talking about.

It would be good to familiarize yourself with glsl and with shaders in jme.
Good luck with the shader, and feel free to ask for further help along the way. :chimpanzee_smile:

1 Like

Yeah the exported code are glsl “definitions” for each operation blender used to define the material, like a dictionary, the actual working shader for jme is work i’ll have to do…i just want to know if there might be issues combining rgba operations with textures…performance wise

1 Like

You can do plenty of computations inside the shader, even ray tracing. Surely you can come into performance problem then. Thou for your case, I don’t think so. Do not worry about performance now, first write a working shader and then optimise if necessary.

2 Likes

Sweet will get to work then

2 Likes