Mipmapping, setTextureMinMagFilter, better image drawing in 3d, not working

Hey there,

I am having a bit of a problem getting the mipmapping feature working.
I am trying like following and getting no error, but it seems not to work! Image quality seems not to change.

This are all commands i tried in combination:

image.setUseTexture(true);
image.loadImage("test.png");    image.getTextureReference().setTextureMinMagFilter(GL_LINEAR_MIPMAP_LINEAR,GL_LINEAR_MIPMAP_LINEAR );
image.getTextureReference().bind();
image.update();
image.draw(0,0,5000);

I think you might not be using the filter parameters correctly

see these two links:


http://www.felixgers.de/teaching/jogl/textureFiltering.html

Try changing this line:

image.getTextureReference().setTextureMinMagFilter(GL_LINEAR_MIPMAP_LINEAR,GL_LINEAR_MIPMAP_LINEAR );

to this:

image.getTextureReference().setTextureMinMagFilter(GL_LINEAR,GL_LINEAR_MIPMAP_LINEAR );

Hey,

Thanks for the reply.
I had that before and tested it again. Sure if min is the first and mag the second filter my code is wrong.
But with the changes it doesnt change anything. It again shows standard behaviour Do I have to update the image texture somehow or refresh it after aplying the filter? Maybe I am missing something there…

I changed th code a bit:

looks now like:

//setup
ofLoadImage( mTex1,"test.png" );
mTex1.setTextureMinMagFilter(GL_LINEAR_MIPMAP_LINEAR,GL_LINEAR);

//draw
mTex1.draw(600,0,5000);

makes no difference. any ideas?

In the docs I found this sentence under setTextureMinMagFilter: warning: May be overridden.
Maybe this happens. What can i do?

Hi there!

You should have a look at ofxFboMipMap.

Hi,

good hint. Got it working. Positioning of images is done with translation instead of setting a position vector directly with a method. Am i right or is there another way to position fboTextures?
I am having a strange Y offset. when drawing. The image seems to sit a bit to much in the negative y direction.

//update
    myFBO.begin();
    		ofClear(0, 0, 0, 0);
    		ofSetColor(255);
    		mTex1.draw(0,0);
    		//ofScale(10, 10);
    		ofSetColor(0);
    		//ofDrawBitmapString("frame: " + ofToString(ofGetFrameNum()), 20,20);
    	myFBO.end();
 //draw
    myFBO.draw(0,0, mTex1.getWidth(), mTex1.getHeight());

I am now trying to use the fbo addon inside an object. but i am only getting a white rect instead of my image.
Is that a known issue? I am setting everything like in the example which comes with the addon but in every object.

or mabe someone can tell me what it means when the drawn buffer is white. i tried to color it but had no sucess. no texture or different stuff can be drawn there…