当前位置: 首页>>代码示例>>Java>>正文


Java GL13.glActiveTexture方法代码示例

本文整理汇总了Java中org.lwjgl.opengl.GL13.glActiveTexture方法的典型用法代码示例。如果您正苦于以下问题:Java GL13.glActiveTexture方法的具体用法?Java GL13.glActiveTexture怎么用?Java GL13.glActiveTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.opengl.GL13的用法示例。


在下文中一共展示了GL13.glActiveTexture方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareTexturedModel

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
	RawModel rawModel = model.getRawModel();
	GL30.glBindVertexArray(rawModel.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	GL20.glEnableVertexAttribArray(2);
	
	ModelTexture texture = model.getTexture();
	
	if(texture.isHasTransparency()) {
		MasterRenderer.disableCulling();
	}
	
	shader.loadFakeLightingVariable(texture.isUseFakeLighting());
	shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
	
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
 
开发者ID:marcioz98,项目名称:MRCEngine,代码行数:20,代码来源:EntityRenderer.java

示例2: prepareTexturedModel

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private void prepareTexturedModel(final TexturedModel model) {
    GL30.glBindVertexArray(model.getRawModel().getVaoId());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);
    if (model.getTexture().isHasTransparency()) {
        MasterRenderer.disableCulling();
    }
    shader.loadFakeLightingVariable(model.getTexture().isUseFakeLighting());
    shader.loadShineVariables(
            model.getTexture().getShineDamper(),
            model.getTexture().getReflectivity()
    );
    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getTextureId());
}
 
开发者ID:Biacode,项目名称:bia-engine,代码行数:17,代码来源:EntityRenderer.java

示例3: loadCubeMap

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
public static int loadCubeMap(MyFile[] textureFiles) {
	int texID = GL11.glGenTextures();
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL13.GL_TEXTURE_CUBE_MAP, texID);
	GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
	for (int i = 0; i < textureFiles.length; i++) {
		TextureData data = decodeTextureFile(textureFiles[i]);
		GL11.glTexImage2D(GL13.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL11.GL_RGBA, data.getWidth(),
				data.getHeight(), 0, GL12.GL_BGRA, GL11.GL_UNSIGNED_BYTE, data.getBuffer());
	}
	GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
	GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
	GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
	GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);
	GL11.glBindTexture(GL13.GL_TEXTURE_CUBE_MAP, 0);
	return texID;
}
 
开发者ID:TheThinMatrix,项目名称:OcclusionQueries,代码行数:18,代码来源:TextureUtils.java

示例4: createTexture

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
/**
 * Creates an OpenGL texture based on a given Image
 * @param id OpenGL reference id to create texture in
 * @param image 
 */
private void createTexture(int id, Image image) {
	// Set as texture 0
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	
	bind();
	
	// Set pixel storage mode
	GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
	
	// Setup texture
	GL11.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	GL11.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	
	GL11.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width, image.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.buffer);
	GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D);
	
	unbind();
}
 
开发者ID:tacocat,项目名称:lambda,代码行数:24,代码来源:Texture.java

示例5: render

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
public void render(List<GuiTexture> guis){
	shader.start();
	GL30.glBindVertexArray(quad.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	for(GuiTexture gui: guis){
		GL13.glActiveTexture(GL13.GL_TEXTURE0);
		GL11.glBindTexture(GL11.GL_TEXTURE_2D, gui.getTexture());
		Matrix4f matrix = Maths.createTransformationMatrix(gui.getPosition(), gui.getScale());
		shader.loadTransformation(matrix);
		GL11.glDrawArrays(GL11.GL_TRIANGLE_STRIP, 0, quad.getVertexCount());
	}
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_BLEND);
	GL20.glDisableVertexAttribArray(0);
	GL30.glBindVertexArray(0);
	shader.stop();
}
 
开发者ID:MrManiacc,项目名称:3d-Engine,代码行数:21,代码来源:GuiRenderer.java

示例6: prepareTexturedModel

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
	RawModel rawModel = model.getRawModel();
	GL30.glBindVertexArray(rawModel.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	GL20.glEnableVertexAttribArray(2);
	ModelTexture texture = model.getTexture();
	shader.loadNumberOfRows(texture.getNumberOfRows());
	if(texture.isHasTransparency()){
		MasterRenderer.disableCulling();
	}
	shader.loadFakeLightingVariable(texture.isUseFakeLighting());
	shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
 
开发者ID:MrManiacc,项目名称:3d-Engine,代码行数:17,代码来源:EntityRenderer.java

示例7: render

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
/**
 * Render this post processing effect
 * @param viewMatrix The view matrix
 */
@Override
public void render(Matrix4f viewMatrix) {
	if (!renderedThisFrame) {
		renderedThisFrame = true;
		for (PostFXOutput input : inputs) {
			input.render(viewMatrix);
		}
		for (int i = 0; i < inputs.length; i++) {
			GL13.glActiveTexture(GL13.GL_TEXTURE0 + i);
			GL11.glBindTexture(GL11.GL_TEXTURE_2D, inputs[i].getTextureID());
		}
		shader.bind();
		shader.updateViewMatrix(viewMatrix);
		updateUniforms(shader);
		buffer.bind();
		Quad.get().lazyRender(0);
	}
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:23,代码来源:PostFX.java

示例8: prepareRender

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private void prepareRender(Camera camera, Light sun){
	shader.start();
	shader.loadViewMatrix(camera);
	moveFactor += WAVE_SPEED * DisplayManager.getFrameTimeSeconds();
	moveFactor %= 1;
	shader.loadMoveFactor(moveFactor);
	shader.loadLight(sun);
	GL30.glBindVertexArray(quad.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, fbos.getReflectionTexture());
	GL13.glActiveTexture(GL13.GL_TEXTURE1);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, fbos.getRefractionTexture());
	GL13.glActiveTexture(GL13.GL_TEXTURE2);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, dudvTexture);
	GL13.glActiveTexture(GL13.GL_TEXTURE3);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, normalMap);
	GL13.glActiveTexture(GL13.GL_TEXTURE4);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, fbos.getRefractionDepthTexture());
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
}
 
开发者ID:MrManiacc,项目名称:3d-Engine,代码行数:23,代码来源:WaterRenderer.java

示例9: prepareTexturedModel

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
	RawModel rawModel = model.getRawModel();
	GL30.glBindVertexArray(rawModel.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	GL20.glEnableVertexAttribArray(2);
	GL20.glEnableVertexAttribArray(3);
	ModelTexture texture = model.getTexture();
	shader.loadNumberOfRows(texture.getNumberOfRows());
	if (texture.isHasTransparency()) {
		MasterRenderer.disableCulling();
	}
	shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
	GL13.glActiveTexture(GL13.GL_TEXTURE1);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getNormalMap());
}
 
开发者ID:MrManiacc,项目名称:3d-Engine,代码行数:19,代码来源:NormalMappingRenderer.java

示例10: setup

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
/**
 * Setup.
 *
 * @param u the u
 * @return the shader args
 */
public static ShaderArgs setup(FightUnit u) {
	Unit unit = u.getUnit();
	ShaderArgs args = new ShaderArgs();
	if(unit.getTheClass().name.equals("Lord")) return args;
	String c = unit.functionalClassName();
	
	Texture t = palettes.get(c);
	if(t == null) return args;
	if(lookup.get(c) == null) return args;
	int offset = lookup.get(c).indexOf(unit.name);
	if(offset < 0) return args;
	args.programName = "paletteSwap";
	args.args = new float[] {t.getTextureWidth(), t.getTextureHeight(), offset, t.getImageWidth()};
	GL13.glActiveTexture(GL13.GL_TEXTURE8);
	t.bind();
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	return args;
}
 
开发者ID:eliatlarge,项目名称:FEMultiPlayer-V2,代码行数:25,代码来源:PaletteSwapper.java

示例11: bindTextures

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private void bindTextures(Terrain terrain) {
    TerrainTexturePack texturePack = terrain.getTexturePack();

    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getBackgroundTexture().getTextureID());

    GL13.glActiveTexture(GL13.GL_TEXTURE1);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getrTexture().getTextureID());

    GL13.glActiveTexture(GL13.GL_TEXTURE2);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getgTexture().getTextureID());

    GL13.glActiveTexture(GL13.GL_TEXTURE3);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getbTexture().getTextureID());

    GL13.glActiveTexture(GL13.GL_TEXTURE4);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, terrain.getBlendMap().getTextureID());
}
 
开发者ID:marcelvanworkum,项目名称:3D-game-engine,代码行数:19,代码来源:TerrainRenderer.java

示例12: prepareTexturedModel

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
	RawModel rawModel = model.getRawModel();
	GL30.glBindVertexArray(rawModel.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	GL20.glEnableVertexAttribArray(2);
	GL20.glEnableVertexAttribArray(3);
	ModelTexture texture = model.getTexture();
	shader.loadNumberOfRows(texture.getNumberOfRows());
	if (texture.isHasTransparency()) {
		MasterRenderer.disableCulling();
	}
	shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
	GL13.glActiveTexture(GL13.GL_TEXTURE1);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getNormalMap());
	shader.loadUseSpecularMap(texture.hasSpecularMap());
	if(texture.hasSpecularMap()){
		GL13.glActiveTexture(GL13.GL_TEXTURE2);
		GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture.getSpecularMap());
	}
}
 
开发者ID:Radseq,项目名称:Mystic-Bastion,代码行数:24,代码来源:NormalMappingRenderer.java

示例13: prepareTexturedModel

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
	RawModel rawModel = model.getRawModel();
	GL30.glBindVertexArray(rawModel.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	GL20.glEnableVertexAttribArray(2);
	ModelTexture texture = model.getTexture();
	shader.loadNumberOfRows(texture.getNumberOfRows());
	if (texture.isHasTransparency()) {
		MasterRenderer.disableCulling();
	}
	shader.loadFakeLightingVariable(texture.isUseFakeLighting());
	shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
	shader.loadUseSpecularMap(texture.hasSpecularMap());
	if(texture.hasSpecularMap()){
		GL13.glActiveTexture(GL13.GL_TEXTURE1);
		GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture.getSpecularMap());
	}
}
 
开发者ID:Radseq,项目名称:Mystic-Bastion,代码行数:22,代码来源:EntityRenderer.java

示例14: loadCubeMap

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
public int loadCubeMap(String[] textureFiles) {
	int texID = GL11.glGenTextures();
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL13.GL_TEXTURE_CUBE_MAP, texID);

	for (int i = 0; i < textureFiles.length; i++) {
		TextureData data = decodeTextureFile(MainGameLoop.fileManager.getTextureFile(textureFiles[i]));
		GL11.glTexImage2D(GL13.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL11.GL_RGBA, data.getWidth(),
				data.getHeight(), 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, data.getBuffer());
	}

	GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
	GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
	GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
	GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);
	textures.add(texID);
	return texID;
}
 
开发者ID:Radseq,项目名称:Mystic-Bastion,代码行数:19,代码来源:Loader.java

示例15: func_147993_b

import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
public void func_147993_b()
{
    GL20.glUseProgram(0);
    field_147999_d = -1;
    staticShaderManager = null;
    field_148000_e = true;

    for (int var1 = 0; var1 < this.field_148010_h.size(); ++var1)
    {
        if (this.field_147997_f.get(this.field_147998_g.get(var1)) != null)
        {
            GL13.glActiveTexture(GL13.GL_TEXTURE0 + var1);
            GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:17,代码来源:ShaderManager.java


注:本文中的org.lwjgl.opengl.GL13.glActiveTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。