本文整理匯總了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());
}
示例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());
}
示例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;
}
示例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();
}
示例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();
}
示例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());
}
示例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);
}
}
示例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);
}
示例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());
}
示例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;
}
示例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());
}
示例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());
}
}
示例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());
}
}
示例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;
}
示例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);
}
}
}