本文整理匯總了Java中net.minecraft.client.renderer.texture.TextureUtil類的典型用法代碼示例。如果您正苦於以下問題:Java TextureUtil類的具體用法?Java TextureUtil怎麽用?Java TextureUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TextureUtil類屬於net.minecraft.client.renderer.texture包,在下文中一共展示了TextureUtil類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: renderQuads
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
private static void renderQuads(BufferBuilder renderer, List<BakedQuad> quads, int color, ItemStack stack) {
boolean flag = color == -1 && !stack.isEmpty();
int i = 0;
for (int j = quads.size(); i < j; ++i) {
BakedQuad bakedquad = (BakedQuad) quads.get(i);
int k = color;
if (flag && bakedquad.hasTintIndex()) {
k = Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable) {
k = TextureUtil.anaglyphColor(k);
}
k = k | -16777216;
}
net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k);
}
}
示例3: renderQuads
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public static void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, ItemStack stack) {
boolean flag = (color == -1) && (!stack.isEmpty());
int i = 0;
for (int j = quads.size(); i < j; i++) {
BakedQuad bakedquad = quads.get(i);
int k = color;
if ((flag) && (bakedquad.hasTintIndex())) {
ItemColors itemColors = Minecraft.getMinecraft().getItemColors();
k = itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable) {
k = TextureUtil.anaglyphColor(k);
}
k |= 0xFF000000;
}
LightUtil.renderQuadColor(renderer, bakedquad, k);
}
}
示例4: renderQuads
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
private void renderQuads(WorldRenderer renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
boolean flag = color == -1 && stack != null;
int i = 0;
for (int j = quads.size(); i < j; ++i)
{
BakedQuad bakedquad = (BakedQuad)quads.get(i);
int k = color;
if (flag && bakedquad.hasTintIndex())
{
k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable)
{
k = TextureUtil.anaglyphColor(k);
}
k = k | -16777216;
}
this.renderQuad(renderer, bakedquad, k);
}
}
示例5: renderModelBrightness
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public void renderModelBrightness(IBakedModel p_178266_1_, IBlockState p_178266_2_, float p_178266_3_, boolean p_178266_4_)
{
Block block = p_178266_2_.getBlock();
block.setBlockBoundsForItemRender();
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
int i = block.getRenderColor(block.getStateForEntityRender(p_178266_2_));
if (EntityRenderer.anaglyphEnable)
{
i = TextureUtil.anaglyphColor(i);
}
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
if (!p_178266_4_)
{
GlStateManager.color(p_178266_3_, p_178266_3_, p_178266_3_, 1.0F);
}
this.renderModelBrightnessColor(p_178266_1_, p_178266_3_, f, f1, f2);
}
示例6: checkTextureUploaded
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
private void checkTextureUploaded()
{
if (!this.textureUploaded)
{
if (this.bufferedImage != null)
{
if (this.textureLocation != null)
{
this.deleteGlTexture();
}
TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage);
this.textureUploaded = true;
}
}
}
示例7: drawString
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public void drawString(final String text, double x, double y,
final Color color, final boolean shadow)
{
x *= 2;
y = y * 2 - 2;
glPushMatrix();
// glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_NICEST);
glScaled(0.25D, 0.25D, 0.25D);
// glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
TextureUtil.bindTexture(texID);
glColor(shadow ? new Color(0.05F, 0.05F, 0.05F, color.getAlpha() / 255F)
: color);
final int size = text.length();
for(int indexInString = 0; indexInString < size; indexInString++)
{
final char character = text.charAt(indexInString);
if(character < chars.length && character >= 0)
{
drawChar(character, (float)x, (float)y);
x += chars[character].width - charOffset;
}
}
glPopMatrix();
}
示例8: initDynamicTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public static void initDynamicTexture(int texID, int width, int height, DynamicTexture tex)
{
MultiTexID multitexid = tex.getMultiTexID();
int[] aint = tex.getTextureData();
int i = width * height;
Arrays.fill(aint, i, i * 2, -8421377);
Arrays.fill((int[])aint, i * 2, i * 3, (int)0);
TextureUtil.allocateTexture(multitexid.base, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
TextureUtil.allocateTexture(multitexid.norm, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
TextureUtil.allocateTexture(multitexid.spec, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
GlStateManager.bindTexture(multitexid.base);
}
示例9: allocateTextureMap
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public static void allocateTextureMap(int texID, int mipmapLevels, int width, int height, Stitcher stitcher, TextureMap tex)
{
SMCLog.info("allocateTextureMap " + mipmapLevels + " " + width + " " + height + " ");
updatingTextureMap = tex;
tex.atlasWidth = width;
tex.atlasHeight = height;
MultiTexID multitexid = getMultiTexID(tex);
updatingTex = multitexid;
TextureUtil.allocateTextureImpl(multitexid.base, mipmapLevels, width, height);
if (Shaders.configNormalMap)
{
TextureUtil.allocateTextureImpl(multitexid.norm, mipmapLevels, width, height);
}
if (Shaders.configSpecularMap)
{
TextureUtil.allocateTextureImpl(multitexid.spec, mipmapLevels, width, height);
}
GlStateManager.bindTexture(texID);
}
示例10: 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);
}
示例11: drawString
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public void drawString(final String text, double x, double y, final Color color, final boolean shadow) {
x *= 2;
y = y * 2 - 2;
glPushMatrix();
// glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_NICEST);
glScaled(0.25D, 0.25D, 0.25D);
// glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
TextureUtil.bindTexture(texID);
glColor(shadow ? new Color(0.05F, 0.05F, 0.05F, color.getAlpha() / 255F) : color);
final int size = text.length();
for (int indexInString = 0; indexInString < size; indexInString++) {
final char character = text.charAt(indexInString);
if (character < chars.length && character >= 0) {
drawChar(character, (float) x, (float) y);
x += chars[character].width - charOffset;
}
}
glPopMatrix();
}
示例12: loadTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public void loadTexture(IResourceManager resourceManager) throws IOException
{
this.deleteGlTexture();
InputStream inputstream = Shaders.getShaderPackResourceStream(this.texturePath);
if (inputstream == null)
{
throw new FileNotFoundException("Shader texture not found: " + this.texturePath);
}
else
{
try
{
BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream);
TextureMetadataSection texturemetadatasection = this.loadTextureMetadataSection();
TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, texturemetadatasection.getTextureBlur(), texturemetadatasection.getTextureClamp());
}
finally
{
IOUtils.closeQuietly(inputstream);
}
}
}
示例13: drawString
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public void drawString(final String text, double x, double y,
final Color color, final boolean shadow)
{
x *= 2;
y = y * 2 - 2;
glPushMatrix();
glScaled(0.25D, 0.25D, 0.25D);
TextureUtil.bindTexture(texID);
glColor(shadow ? new Color(0.05F, 0.05F, 0.05F, color.getAlpha() / 255F)
: color);
final int size = text.length();
for(int indexInString = 0; indexInString < size; indexInString++)
{
final char character = text.charAt(indexInString);
if(character < chars.length && character >= 0)
{
drawChar(character, (float)x, (float)y);
x += chars[character].width - charOffset;
}
}
glPopMatrix();
}
示例14: renderModelBrightness
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
public void renderModelBrightness(IBakedModel model, IBlockState state, float brightness, boolean p_178266_4_)
{
Block block = state.getBlock();
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
int i = this.blockColors.colorMultiplier(state, (IBlockAccess)null, (BlockPos)null, 0);
if (EntityRenderer.anaglyphEnable)
{
i = TextureUtil.anaglyphColor(i);
}
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
if (!p_178266_4_)
{
GlStateManager.color(brightness, brightness, brightness, 1.0F);
}
this.renderModelBrightnessColor(state, model, brightness, f, f1, f2);
}
示例15: renderQuads
import net.minecraft.client.renderer.texture.TextureUtil; //導入依賴的package包/類
private void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, @Nullable ItemStack stack)
{
boolean flag = color == -1 && stack != null;
int i = 0;
for (int j = quads.size(); i < j; ++i)
{
BakedQuad bakedquad = (BakedQuad)quads.get(i);
int k = color;
if (flag && bakedquad.hasTintIndex())
{
k = this.itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable)
{
k = TextureUtil.anaglyphColor(k);
}
k = k | -16777216;
}
net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k);
}
}