本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}