Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

How to properly generate mipmap?

$
0
0

@cuinjune wrote:

Hi, I'm trying to toggle applying mipmap texture so I can see the difference.
But I don't see any difference when I call ofTexture::generateMipmap();

Is there any way that I can toggle between enabling/disabling mipmap in realtime so I can compare?

Here's my test code below.

ofImage img;
ofMesh mesh;
ofCamera cam;

//--------------------------------------------------------------
void ofApp::setup(){

    ofEnableDepthTest();
    ofDisableArbTex();

    img.load("earth.jpg");
    mesh = ofMesh::sphere(300,100);
    cam.setVFlip(true);
    cam.setPosition(100, ofGetHeight()/4, 0);
    cam.lookAt(ofVec3f(ofGetWidth()/2, ofGetHeight()/2, 0));

}

//--------------------------------------------------------------
void ofApp::draw(){

    cam.begin();
    img.bind();
    ofTranslate(ofGetWidth()/2, ofGetHeight()/2, 0);
    mesh.draw();
    img.unbind();
    cam.end();
}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){

    img.getTexture().generateMipmap(); // this has no effect.
}

And Here's a link to the test image
[http://paulbourke.net/geometry/transformationprojection/earth.jpg]

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles