Login  Register

Re: Mapping two (different types of) Textures on the same geometry

Posted by Demoscene Passivist on Feb 17, 2012; 5:36pm
URL: https://forum.jogamp.org/SOLVED-Mapping-two-different-types-of-Textures-on-the-same-geometry-tp3731946p3754405.html

>How can I bind a texture of Texture type?

U can do stg like this:

	inGL.glActiveTexture(GL_TEXTURE0);
	mTexture_Diffuse.enable();
	mTexture_Diffuse.bind();
	mTexture_Diffuse.setTexParameterf(GL_TEXTURE_MIN_FILTER,GL_LINEAR);
	mTexture_Diffuse.setTexParameterf(GL_TEXTURE_MAG_FILTER,GL_LINEAR);
	mTexture_Diffuse.setTexParameterf(GL_TEXTURE_WRAP_S,GL_REPEAT);
	mTexture_Diffuse.setTexParameterf(GL_TEXTURE_WRAP_T,GL_REPEAT);
	
        inGL.glActiveTexture(GL_TEXTURE1);
	mTexture_Specular.enable();
	mTexture_Specular.bind();
	mTexture_Specular.setTexParameterf(GL_TEXTURE_MIN_FILTER,GL_LINEAR);
	mTexture_Specular.setTexParameterf(GL_TEXTURE_MAG_FILTER,GL_LINEAR);
	mTexture_Specular.setTexParameterf(GL_TEXTURE_WRAP_S,GL_REPEAT);
	mTexture_Specular.setTexParameterf(GL_TEXTURE_WRAP_T,GL_REPEAT);

... to bind multiple textures to mutliple texture units like julien suggested ...