тесселейтор

318
12
Всем привет. Я накладываю текстуру на текстуру через определенное кол. тиков. Мне надо сделать что бы вторая текстура была прозрачной, и через секунду уже становилась видимой. Ну надо сделать что то типа, плавной прозрачности. Вот примерно так накладывается текстура на тектсуру сейчас (без прозрачности/плавности):
if(textureManager > 0) {
     this.mc.getTextureManager().bindTexture(new ResourceLocation("xmod","textures/gui/main/bg1.png"));
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(0.0D, (double)(0 + this.height), 0.0D, 0.0D, 1.0D);
        tessellator.addVertexWithUV((double)(0 + this.width), (double)(0 + this.height), 0.0D, 1.0D, 1.0D);
        tessellator.addVertexWithUV((double)(0 + this.width), 0.0D, 0.0D, 1.0D, 0.0D);
        tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
        tessellator.draw();
     }
    
     if(textureManager > 120) {
         this.mc.getTextureManager().bindTexture(new ResourceLocation("xmod","textures/gui/main/bg2.png"));
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(0.0D, (double)(0 + this.height), 0.0D, 0.0D, 1.0D);
            tessellator.addVertexWithUV((double)(0 + this.width), (double)(0 + this.height), 0.0D, 1.0D, 1.0D);
            tessellator.addVertexWithUV((double)(0 + this.width), 0.0D, 0.0D, 1.0D, 0.0D);
            tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
            tessellator.draw();
     }
Спасибо.
 
Агравайн, помоги, у меня не выходит. Когда стояло но 2 картинки - нормально, сейчас 4 и вот криво как то работает. 
if(textureManager > 0) {
    this.mc.getTextureManager().bindTexture(new ResourceLocation("xmod","textures/gui/main/bg1.png"));
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(0.0D, (double)(0 + this.height), 0.0D, 0.0D, 1.0D);
        tessellator.addVertexWithUV((double)(0 + this.width), (double)(0 + this.height), 0.0D, 1.0D, 1.0D);
        tessellator.addVertexWithUV((double)(0 + this.width), 0.0D, 0.0D, 1.0D, 0.0D);
        tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
        tessellator.draw();
    }
    
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glColor4d(1, 1, 1, Math.min(Math.min(textureManager / 20.0, 1.0), 1.0));
    if(textureManager > 120) {
        this.mc.getTextureManager().bindTexture(new ResourceLocation("xmod","textures/gui/main/bg2.png"));
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(0.0D, (double)(0 + this.height), 0.0D, 0.0D, 1.0D);
            tessellator.addVertexWithUV((double)(0 + this.width), (double)(0 + this.height), 0.0D, 1.0D, 1.0D);
            tessellator.addVertexWithUV((double)(0 + this.width), 0.0D, 0.0D, 1.0D, 0.0D);
            tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
            tessellator.draw();
    }
    //textureManager = 0;
    
    if(textureManager > 240) {
        this.mc.getTextureManager().bindTexture(new ResourceLocation("xmod","textures/gui/main/bg3.png"));
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(0.0D, (double)(0 + this.height), 0.0D, 0.0D, 1.0D);
            tessellator.addVertexWithUV((double)(0 + this.width), (double)(0 + this.height), 0.0D, 1.0D, 1.0D);
            tessellator.addVertexWithUV((double)(0 + this.width), 0.0D, 0.0D, 1.0D, 0.0D);
            tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
            tessellator.draw();
    }
    
    if(textureManager > 360) {
        this.mc.getTextureManager().bindTexture(new ResourceLocation("xmod","textures/gui/main/bg4.png"));
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(0.0D, (double)(0 + this.height), 0.0D, 0.0D, 1.0D);
            tessellator.addVertexWithUV((double)(0 + this.width), (double)(0 + this.height), 0.0D, 1.0D, 1.0D);
            tessellator.addVertexWithUV((double)(0 + this.width), 0.0D, 0.0D, 1.0D, 0.0D);
            tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
            tessellator.draw();
            //textureManager = 0;
            GL11.glDisable(GL11.GL_BLEND);
    }
 
Назад
Сверху