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


Java TextureUtil.uploadTextureMipmap方法代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.texture.TextureUtil.uploadTextureMipmap方法的典型用法代碼示例。如果您正苦於以下問題:Java TextureUtil.uploadTextureMipmap方法的具體用法?Java TextureUtil.uploadTextureMipmap怎麽用?Java TextureUtil.uploadTextureMipmap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.renderer.texture.TextureUtil的用法示例。


在下文中一共展示了TextureUtil.uploadTextureMipmap方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: uploadTexSub

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
public static void uploadTexSub(int[][] data, int width, int height, int xoffset, int yoffset, boolean linear, boolean clamp)
{
    TextureUtil.uploadTextureMipmap(data, width, height, xoffset, yoffset, linear, clamp);

    if (Shaders.configNormalMap || Shaders.configSpecularMap)
    {
        if (Shaders.configNormalMap)
        {
            GlStateManager.bindTexture(updatingTex.norm);
            uploadTexSub1(data, width, height, xoffset, yoffset, 1);
        }

        if (Shaders.configSpecularMap)
        {
            GlStateManager.bindTexture(updatingTex.spec);
            uploadTexSub1(data, width, height, xoffset, yoffset, 2);
        }

        GlStateManager.bindTexture(updatingTex.base);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:22,代碼來源:ShadersTex.java

示例2: uploadTexSubForLoadAtlas

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
public static void uploadTexSubForLoadAtlas(int[][] data, int width, int height, int xoffset, int yoffset, boolean linear, boolean clamp)
{
    TextureUtil.uploadTextureMipmap(data, width, height, xoffset, yoffset, linear, clamp);
    boolean flag = false;

    if (Shaders.configNormalMap)
    {
        int[][] aint = readImageAndMipmaps(iconName + "_n", width, height, data.length, flag, -8421377);
        GlStateManager.bindTexture(updatingTex.norm);
        TextureUtil.uploadTextureMipmap(aint, width, height, xoffset, yoffset, linear, clamp);
    }

    if (Shaders.configSpecularMap)
    {
        int[][] aint1 = readImageAndMipmaps(iconName + "_s", width, height, data.length, flag, 0);
        GlStateManager.bindTexture(updatingTex.spec);
        TextureUtil.uploadTextureMipmap(aint1, width, height, xoffset, yoffset, linear, clamp);
    }

    GlStateManager.bindTexture(updatingTex.base);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:22,代碼來源:ShadersTex.java

示例3: loadDirect

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public @Nonnull DynamicImageTexture loadDirect() {
	final int[][] mipdata = this.mipdata;
	if (mipdata!=null&&mipdata.length>=1) {
		final int id = getId();
		if (this.miplevel>=1) {
			TextureUtil.allocateTextureImpl(id, this.miplevel, this.width, this.height, Client.mc.gameSettings.anisotropicFiltering);
			TextureUtil.uploadTextureMipmap(mipdata, this.width, this.height, 0, 0, false, false);
		} else {
			TextureUtil.allocateTexture(id, this.width, this.height);
			TextureUtil.uploadTexture(id, mipdata[0], this.width, this.height);
		}
		this.mipdata = null;
	}
	return this;
}
 
開發者ID:Team-Fruit,項目名稱:SignPicture,代碼行數:17,代碼來源:DynamicImageTexture.java

示例4: updateAnimation

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void updateAnimation()
{
    if (textureFX != null)
    {
        textureFX.update();
        if (textureFX.changed())
        {
            int[][] mipmaps = new int[mipmapLevels + 1][];
            mipmaps[0] = textureFX.imageData;
            mipmaps = prepareAnisotropicFiltering(mipmaps);
            mipmaps = TextureUtil.generateMipmapData(mipmapLevels, width, mipmaps);
            TextureUtil.uploadTextureMipmap(mipmaps, width, height, originX, originY, false, false);
        }
    }
}
 
開發者ID:Darkona,項目名稱:AdventureBackpack2,代碼行數:17,代碼來源:TextureSpecial.java

示例5: updateAnimationInterpolated

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
private void updateAnimationInterpolated() throws IllegalArgumentException, IllegalAccessException {
	AnimationMetadataSection animationMetadata = (AnimationMetadataSection) fanimationMetadata.get(this);

	double d0 = 1.0D - tickCounter / (double) animationMetadata.getFrameTimeSingle(frameCounter);
	int i = animationMetadata.getFrameIndex(frameCounter);
	int j = animationMetadata.getFrameCount() == 0 ? framesTextureData.size() : animationMetadata.getFrameCount();
	int k = animationMetadata.getFrameIndex((frameCounter + 1) % j);

	if (i != k && k >= 0 && k < framesTextureData.size()) {
		int[][] aint = (int[][]) framesTextureData.get(i);
		int[][] aint1 = (int[][]) framesTextureData.get(k);

		if (interpolatedFrameData == null || interpolatedFrameData.length != aint.length)
			interpolatedFrameData = new int[aint.length][];

		for (int l = 0; l < aint.length; l++) {
			if (interpolatedFrameData[l] == null)
				interpolatedFrameData[l] = new int[aint[l].length];

			if (l < aint1.length && aint1[l].length == aint[l].length)
				for (int i1 = 0; i1 < aint[l].length; ++i1) {
					int j1 = aint[l][i1];
					int k1 = aint1[l][i1];
					int l1 = (int) (((j1 & 16711680) >> 16) * d0 + ((k1 & 16711680) >> 16) * (1.0D - d0));
					int i2 = (int) (((j1 & 65280) >> 8) * d0 + ((k1 & 65280) >> 8) * (1.0D - d0));
					int j2 = (int) ((j1 & 255) * d0 + (k1 & 255) * (1.0D - d0));
					interpolatedFrameData[l][i1] = j1 & -16777216 | l1 << 16 | i2 << 8 | j2;
				}
		}

		TextureUtil.uploadTextureMipmap(interpolatedFrameData, width, height, originX, originY, false, false);
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:34,代碼來源:PrismarineIcon.java

示例6: updateAnimation

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void updateAnimation() {
	
	EntityPlayerSP p = Minecraft.getMinecraft().thePlayer;
	if (p != null)
	{
		if ((p.inventory.armorInventory[3] != null && p.inventory.armorInventory[3].getItem() == UCItems.glasses3D) || p.capabilities.isCreativeMode)
			this.frameCounter = 0;
		else
			this.frameCounter = 1;
	}
	TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:15,代碼來源:UCInvisibiliaStitch.java

示例7: updateAnimation

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void updateAnimation() {
	
	World world = Minecraft.getMinecraft().theWorld;
	if (world != null) {
		long time = world.getWorldTime() % 24000L;
		this.frameCounter = (int)(time / 1500);
	}
	TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:12,代碼來源:UCDyePlantStitch.java

示例8: updateAnimation

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void updateAnimation() {
    if (textureFX != null) {
        textureFX.update();
        if (textureFX.changed())
            TextureUtil.uploadTextureMipmap(new int[][]{textureFX.imageData}, width, height, originX, originY, false, false);
    }
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:9,代碼來源:TextureSpecial.java

示例9: updateAnimation

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void updateAnimation() {
    if (textureFX != null) {
        textureFX.update();
        if (textureFX.changed()) {
            int[][] mipmaps = new int[mipmapLevels + 1][];
            mipmaps[0] = textureFX.imageData;
            mipmaps = TextureUtil.generateMipmapData(mipmapLevels, width, mipmaps);
            framesTextureData.set(0, mipmaps);
            TextureUtil.uploadTextureMipmap(mipmaps, width, height, originX, originY, false, false);
        }
    }
}
 
開發者ID:TheCBProject,項目名稱:CodeChickenLib,代碼行數:14,代碼來源:TextureSpecial.java

示例10: upload

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
private void upload(IStencilPattern pattern) {
	queuedForUpload = false;

	clearFramesTextureData();
	int[][] mipmaps = new int[this.mipmapLevels + 1][];
	mipmaps[0] = bitmap.apply(pattern);
	mipmaps = TextureUtil.generateMipmapData(this.mipmapLevels, this.width, mipmaps);
	framesTextureData.add(mipmaps);

	TextureUtil.uploadTextureMipmap(mipmaps, this.width, this.height, this.originX, this.originY, false, false);
}
 
開發者ID:OpenMods,項目名稱:OpenBlocks,代碼行數:12,代碼來源:StencilTextureManager.java

示例11: upload

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void upload() {
	if (requiresUpload) {
		requiresUpload = false;
		TextureUtil.uploadTextureMipmap(this.framesTextureData.get(0), this.width, this.height, this.originX, this.originY, false, false);
	}
}
 
開發者ID:OpenMods,項目名稱:OpenBlocks,代碼行數:8,代碼來源:CanvasTextureManager.java

示例12: updateAnimation

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void updateAnimation() {
    if (textureFX != null) {
        textureFX.update();
        if (textureFX.changed()) {
            int[][] mipmaps = new int[mipmapLevels + 1][];
            mipmaps[0] = textureFX.imageData;
            mipmaps = prepareAnisotropicFiltering(mipmaps);
            mipmaps = TextureUtil.generateMipmapData(mipmapLevels, width, mipmaps);
            TextureUtil.uploadTextureMipmap(mipmaps, width, height, originX, originY, false, false);
        }
    }
}
 
開發者ID:Dynious,項目名稱:RefinedRelocation,代碼行數:14,代碼來源:TextureSpecial.java

示例13: updateAnimation

import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
public void updateAnimation()
{
    if (!this.framesTextureData.isEmpty())
    {
        Minecraft minecraft = Minecraft.getMinecraft();
        
        int i = frameCounter;
        if (minecraft.theWorld != null && minecraft.thePlayer != null)
        {
        	if (!minecraft.theWorld.provider.isSurfaceWorld())
            {
        		netherAnim++;
        		if(netherAnim > 8) {
        			netherAnim = 0;
                 i += (Math.random()*3)-1;
                 if(i < 0)
                 	i += 8;
                 if(i > 7)
                 	i -= 8;
        		}
            }
        	else {
        		i = minecraft.theWorld.getMoonPhase();
        	}
         //System.out.println("Moon: " + minecraft.theWorld.getMoonPhase());
        }
        if (i != this.frameCounter)
        {
         //System.out.println("Moon: " + i + "," + minecraft.theWorld.getCurrentMoonPhaseFactor());
            this.frameCounter = i;
            TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
            //TextureUtil.uploadTextureSub((int[])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
        }
    }
}
 
開發者ID:Draco18s,項目名稱:Artifacts,代碼行數:36,代碼來源:TextureCalendar.java


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