Texture border color

I posted on the bug tracker (https://jme.dev.java.net/issues/show_bug.cgi?id=245) a feature enhancement that allow jme users to change the texture border color.

i had to search the web in order to find out what texture border color is :slight_smile:

very nice targ. thanks

Ok, You’re right sfera…  ://

For peoples who doesn’t know what is texture border color, I advice them to try the openGL nate robbins tutorial on texturing (http://www.xmission.com/~nate/tutors.html).

You could see that the border color is used when you set a linear filtering, a clamp wrapping and when your texture coordinates don’t belong to [0, 1].

Nate Robbin tutorials are very old, and in his program you can’t set the texture wrapping mode to GL_CLAMP_TO_BORDER.

In jme you could do that by writting the following lines :


At this time, your texture will be bordered by the texture border color. (see my test code in the tracker for a full example)
Notice that the border color continue outside the range of the texture map.

For more information about the texture border color see : the section Using a Texture's Borders in : http://fly.cc.fer.hr/~unreal/theredbook/chapter09.html

The main problem with the texture border color is that it default value is black with an alpha channel to 0 ( ColorRGBA(0, 0, 0, 0) ).

When you use an alpha state to make a part of a mesh transparent, the border color could interfere.

If we could modify the texture color border, we could attenuate this interference.