當前位置: 首頁>>代碼示例>>Java>>正文


Java GL13類代碼示例

本文整理匯總了Java中org.lwjgl.opengl.GL13的典型用法代碼示例。如果您正苦於以下問題:Java GL13類的具體用法?Java GL13怎麽用?Java GL13使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GL13類屬於org.lwjgl.opengl包,在下文中一共展示了GL13類的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: renderParticle

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5)
{
    float f6 = ((float)field_678_p + f) / (float)field_677_q;
    f6 *= f6;
    double d = field_675_a.posX;
    double d1 = field_675_a.posY;
    double d2 = field_675_a.posZ;
    double d3 = field_679_o.lastTickPosX + (field_679_o.posX - field_679_o.lastTickPosX) * (double)f;
    double d4 = field_679_o.lastTickPosY + (field_679_o.posY - field_679_o.lastTickPosY) * (double)f + (double)field_676_r;
    double d5 = field_679_o.lastTickPosZ + (field_679_o.posZ - field_679_o.lastTickPosZ) * (double)f;
    double d6 = d + (d3 - d) * (double)f6;
    double d7 = d1 + (d4 - d1) * (double)f6;
    double d8 = d2 + (d5 - d2) * (double)f6;
    int i = MathHelper.floor_double(d6);
    int j = MathHelper.floor_double(d7 + (double)(yOffset / 2.0F));
    int k = MathHelper.floor_double(d8);
    int l = getRenderBrightness(f);
    int i1 = l % 0x10000;
    int j1 = l / 0x10000;
    GL13.glMultiTexCoord2f(33985 /*GL_TEXTURE1_ARB*/, (float)i1 / 1.0F, (float)j1 / 1.0F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);        
    d6 -= interpPosX;
    d7 -= interpPosY;
    d8 -= interpPosZ;
    RenderManager.instance.renderEntityWithPosYaw(field_675_a, (float)d6, (float)d7, (float)d8, field_675_a.rotationYaw, f);
}
 
開發者ID:jd-lang,項目名稱:betaexpansion,代碼行數:27,代碼來源:EntityPickupFX.java

示例3: render

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
/**
    * Renders the water.
    * @param camera
    */
   public void render(final PerspectiveCamera camera, final DirectionalLight light) {
shader.bind();
shader.setUniform("m_model", transformation);
shader.setUniform("m_view", camera.getView());
shader.setUniform("m_proj", camera.getProjection());
shader.setUniform("move_factor", moveFactor);
shader.setUniform("camera_pos", camera.getPosition());
shader.setUniform("light_pos", light.getDirection().negate(null));

framebuffer.bindTexture();
dudvTexture.bind(GL13.GL_TEXTURE1);
normalTexture.bind(GL13.GL_TEXTURE2);

MESH.render();
   }
 
開發者ID:camilne,項目名稱:open-world,代碼行數:20,代碼來源:WaterRegion.java

示例4: initGL

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
/**
    * Initialize OpenGL to default settings
    */
   private void initGL() {
// Set the clear color
GL11.glClearColor(0, 0, 0, 1);

// Setup viewport
GL11.glViewport(0, 0, WINDOW.getWidth(), WINDOW.getHeight());

// Setup depth testing
GL11.glEnable(GL11.GL_DEPTH_TEST);

// Setup face culling (ccw)
GL11.glFrontFace(GL11.GL_CCW);
GL11.glCullFace(GL11.GL_BACK);
GL11.glEnable(GL11.GL_CULL_FACE);

// Setup blending
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);

// Enable MSAA
GL11.glEnable(GL13.GL_MULTISAMPLE);
   }
 
開發者ID:camilne,項目名稱:open-world,代碼行數:26,代碼來源:Application.java

示例5: 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

示例6: 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

示例7: bindTextures

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
/**
 * Binds each texture to a the terrain shaders.
 * @param terrain - Terrain containing the textures to blend.
 */
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.getRedTexture().getTextureID());

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

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

    GL13.glActiveTexture(GL13.GL_TEXTURE4);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getBlendMap().getTextureID());

}
 
開發者ID:Essentria,項目名稱:Elgin-Plant-Game,代碼行數:24,代碼來源:TerrainRenderer.java

示例8: setLightmapTextureCoords

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
/**
 * Sets the current coordinates of the given lightmap texture
 */
public static void setLightmapTextureCoords(int target, float p_77475_1_, float p_77475_2_)
{
    if (arbMultitexture)
    {
        ARBMultitexture.glMultiTexCoord2fARB(target, p_77475_1_, p_77475_2_);
    }
    else
    {
        GL13.glMultiTexCoord2f(target, p_77475_1_, p_77475_2_);
    }

    if (target == lightmapTexUnit)
    {
        lastBrightnessX = p_77475_1_;
        lastBrightnessY = p_77475_2_;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:21,代碼來源:OpenGlHelper.java

示例9: checkBoundTexture

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
public static void checkBoundTexture()
{
    if (Config.isMinecraftThread())
    {
        int i = GL11.glGetInteger(GL13.GL_ACTIVE_TEXTURE);
        int j = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
        int k = getActiveTextureUnit();
        int l = getBoundTexture();

        if (l > 0)
        {
            if (i != k || j != l)
            {
                Config.dbg("checkTexture: act: " + k + ", glAct: " + i + ", tex: " + l + ", glTex: " + j);
            }
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:19,代碼來源:GlStateManager.java

示例10: setLightmapTextureCoords

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
/**
 * Sets the current coordinates of the given lightmap texture
 */
public static void setLightmapTextureCoords(int target, float p_77475_1_, float t)
{
    if (arbMultitexture)
    {
        ARBMultitexture.glMultiTexCoord2fARB(target, p_77475_1_, t);
    }
    else
    {
        GL13.glMultiTexCoord2f(target, p_77475_1_, t);
    }

    if (target == lightmapTexUnit)
    {
        lastBrightnessX = p_77475_1_;
        lastBrightnessY = t;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:21,代碼來源:OpenGlHelper.java

示例11: createDisplay

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
public static void createDisplay() {
	try {
		Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
		ContextAttribs attribs = new ContextAttribs(3, 2).withProfileCore(true).withForwardCompatible(true);
		Display.create(new PixelFormat().withDepthBits(24).withSamples(4), attribs);
		Display.setTitle(TITLE);
		Display.setInitialBackground(1, 1, 1);
		GL11.glEnable(GL13.GL_MULTISAMPLE);
	} catch (LWJGLException e) {
		e.printStackTrace();
		System.err.println("Couldn't create display!");
		System.exit(-1);
	}
	GL11.glViewport(0, 0, WIDTH, HEIGHT);
	lastFrameTime = getCurrentTime();
}
 
開發者ID:TheThinMatrix,項目名稱:OpenGL-Animation,代碼行數:17,代碼來源:DisplayManager.java

示例12: 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

示例13: 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

示例14: 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

示例15: createDisplay

import org.lwjgl.opengl.GL13; //導入依賴的package包/類
public static void createDisplay() {
    ContextAttribs attribs = new ContextAttribs(3, 3)
            .withForwardCompatible(true)
            .withProfileCore(true);
    try {
        Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
        Display.create(new PixelFormat(), attribs);
        Display.setTitle("Our First Display!");
        GL11.glEnable(GL13.GL_MULTISAMPLE);
    } catch (LWJGLException e) {
        e.printStackTrace();
    }

    GL11.glViewport(0, 0, WIDTH, HEIGHT);
    lastFrameTime = getCurrentTime();
}
 
開發者ID:MrManiacc,項目名稱:3d-Engine,代碼行數:17,代碼來源:DisplayManager.java


注:本文中的org.lwjgl.opengl.GL13類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。