Little trouble

Hello all,



I have just updated from CVS, my app compiled after i make the ParticleManager refactoring, but my app don’t run anymore . :’( I have this error :



org.lwjgl.opengl.OpenGLException: Invalid value (1281)

at org.lwjgl.opengl.Util.checkGLError(Util.java:56)

at org.lwjgl.opengl.Display.update(Display.java:515)

at com.jme.renderer.lwjgl.LWJGLRenderer.displayBackBuffer(LWJGLRenderer.java:508)

at com.jme.app.BaseGame.start(BaseGame.java:74)

at magikopera.MagikOpera.main(MagikOpera.java:186)



it seems to be in displaybackbuffer method.



The jme test are always running so i think i make something wrong which was tolerated with my old version of jme.

Any idea of the problem ?



Thanks for help,



Adenthar.

There was a bit of a change in ParticleManager (from irrisor’s recommendations), where ParticleManager no longer needs a camera passed in as it retrieves it from the renderer that is drawing it.



So, perhaps you have found a bug. First of all, try running any of the jmetest applications that make use of particles (they all ran for me).



If they DO run for you, how are you adding the particles to the scene, rendering, etc.



If they DON’T run for you, we may have a problem with the new changes.

all the test are running,



i don’t think it’s because of particle manager since :

  1. the problem is at the start of the app i have not attached particle manager yet
  2. i check out every two or three weeks so the problem may be elsewhere…



    bye,



    Adenthar.

One more information, the error comes at the first update…



bye,



Adenthar.

Try commenting out all the drawing calls, update calls, etc. And add them back one at a time until it breaks. Then let me know what call broke it.

I’ve had a similar problem before when using vertex/fragment shaders that don’t compile - it tries to activate shader -1, which makes it fail in the displayBackBuffer call. Maybe check for odd messages in your output?

ok mojo, i have followed your instruction and i think i’ve got a clue :



when i replace in my code :



font.setTexture(

TextureManager.loadTexture(

Debug.class.getClassLoader().getResource(

MgkoConstant.FONTLOCATION + “defaultfont.png”),

Texture.MM_LINEAR,

Texture.FM_LINEAR,

-1,

true));



by this :



font.setTexture(

TextureManager.loadTexture(

Debug.class.getClassLoader().getResource(

MgkoConstant.FONTLOCATION + “defaultfont.png”),

Texture.MM_LINEAR,

Texture.FM_LINEAR,

Image.RGBA8888,

true));



it can go further before having the error message, since i have this line in other places in my code i will make all the replacement to see if it’s the cause of my problem…



bye,



Adenthar.

So i found was the problem !

with the new cvs version, it seems that for me the guessformat feature is broken.



when i used :

TextureManager.loadTexture(

Debug.class.getClassLoader().getResource(

MgkoConstant.FONTLOCATION + “defaultfont.png”),

Texture.MM_LINEAR,

Texture.FM_LINEAR,

Image.GUESS_FORMAT,

true));



i 've got this error :



org.lwjgl.opengl.OpenGLException: Invalid value (1281)

at org.lwjgl.opengl.Util.checkGLError(Util.java:56)

at org.lwjgl.opengl.Display.update(Display.java:515)

at com.jme.renderer.lwjgl.LWJGLRenderer.displayBackBuffer(LWJGLRenderer.java:508)

at com.jme.app.BaseGame.start(BaseGame.java:74)

at magikopera.MagikOpera.main(MagikOpera.java:186)



if i use



TextureManager.loadTexture(

Debug.class.getClassLoader().getResource(

MgkoConstant.FONTLOCATION + “defaultfont.png”),

Texture.MM_LINEAR,

Texture.FM_LINEAR,

Image.RGBA8888,

true));



everything is ok…

i have try lot’s of ‘Image.Contant’ and it seems that the two GUESSFORMAT and GUESSFORMAR_NOS3TC does not work anymore on my computer.



Here’s my plateform :

Linux Mandrake 10.1

Java 1.4.2

GeForce 6800 GT



bye,



Adenthar.

Hey, here’s your problem. The TextureManager method you are using is:


public static com.jme.image.Texture loadTexture(URL file, int minFilter,
            int magFilter, float anisoLevel, boolean flipped)



So where you are specifying imagetype, the method is asking for anisoLevel. Guess format is -1 which is an invalid aniso, RGBA8888 is 3, which IS valid.

That method used to have a bug where it ignored the passed in aniso level. Mojo fixed that several days ago, which is why the problem suddenly cropped up for ya.

Try calling instead:

TextureManager.loadTexture(
Debug.class.getClassLoader().getResource(
MgkoConstant.FONTLOCATION + "defaultfont.png"),
Texture.MM_LINEAR,
Texture.FM_LINEAR,
Image.GUESS_FORMAT,
1.0f,
true));



Hope that helps.

Renanse, you’re a star ! :smiley:



I’ve used the method in my code and it works great !



by the way what is anisolevel and if i put 2.0 instead of 1.0 what does it mean ?



thanks again,



Adenthar.

it’s a type of multi sampling / filtering… it’s fairly expensive though. Try out TestAnisotropic to get an idea of the effect. The max valid value vary by card, 1.0f is “off”, then you have 2.0, 3.0 -> max



Max is retrievable via textureState.getMaxAnisotropic();



As for what it means, rather than give a poor discussion on it, I’d suggest googling Anisotropic filtering.

Ah ok,



I knew anisotropic filtering in games but i didn’t knew that it was during texture loading that it was defined in jme… ://



Thanks a lot Renanse ! :slight_smile: ( especially for your patience :wink: )



bye,



Adenthar.

Happy to help. :slight_smile: