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