Shader Techniques


i see Lighting.j3md have many Techniques, and i guess all of this techniques are executing?(or not? i saw there is material.setTechnique or something like this)

but when i try to make my additional technique, then first of them override next one.

then how glow Technique works in Lighting.j3md when it is last…

i noticed also that “Technique” or “Technique NAME” make a difference.

i just want someone(maybe @nehon ) to explain me how it work :slight_smile:


First read the material specs, Technique are explained there

@oxplay2 said:
i guess all of this techniques are executing

Nope, only the selected technique is used and executed.
The default technique (the no name one) is automatically selected when no technique is specified in the renderer.

Selecting a technique is an internal operation usually, for example the Glow technique is forced to render the whole scene with only glowing objects (RenderManager.setForcedTEchnique("Glow");
You should not have to change them unless you are making very advanced features like your own shadowRenderer or Filter.

Tell me what do you want to achieve exactly, maybe your not looking the right way.
1 Like

thanks nehon

first of all i want to make Character.j3md where i could use:

  • JME Lighting technique + character related shaders, like “war paints”(here i could use glowMap too) / “skin tanning”(changing ambient color/diffuse color is not what i need) / etc…

    and i hoped, that with techniques i could made it clear, without changing Lighting.frag or including it into my fragment shader.

    so i understand, if i want make it, i need for example to: “RenderManager.setForcedTEchnique(“SkinTanning”);”.

    it should not be slow to make tanning, because it only change color. i know that other operations should be optimized into one shader.

    if i understand correctly, thanks.


Techniques are not meant for that I’m afraid.

What you are talking about was once referred by the ancients as the almighty “Shader injection”, but many says that this was just a legend, and no one has ever confirmed its very existence.

What remains of it today are some old geezers babbling stories about it to kids around the camp fire, telling them what tremendous power it could have unleashed upon the world…

But sadly…those are just fairy tales…

I’m afraid you’ll have to make your own material and implement your own frag shader.

Lucky you @wezrule made a very nice shader video tutorial series :wink:


ohh a great beautiful story :smiley:

thanks for info!

i need to make a good glsllib, where everything will be clean :slight_smile:


i am more active on this “forum” last time, so i seen every interesting topic for me :roll: