fix skull cull
This commit is contained in:
parent
4ec8affe85
commit
e2f2417695
17 changed files with 42 additions and 38 deletions
|
@ -469,7 +469,7 @@ public class Game implements IThreadListener {
|
|||
this.soundManager = new SoundManager(this);
|
||||
Colorizer.reload();
|
||||
GlState.enableTexture2D();
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
GlState.clearDepth(1.0D);
|
||||
GlState.enableDepth();
|
||||
GlState.depthFunc(515);
|
||||
|
|
|
@ -10,11 +10,8 @@ import game.Game;
|
|||
import game.gui.element.Dropdown;
|
||||
import game.gui.element.Dropdown.Handle;
|
||||
import game.gui.element.Element;
|
||||
import game.renderer.DefaultVertexFormats;
|
||||
import game.renderer.Drawing;
|
||||
import game.renderer.GlState;
|
||||
import game.renderer.RenderBuffer;
|
||||
import game.renderer.Tessellator;
|
||||
import game.vars.CVar;
|
||||
import game.vars.ColorVar;
|
||||
import game.window.Bind;
|
||||
|
@ -297,7 +294,7 @@ public abstract class Gui {
|
|||
// GlState.enableBlend();
|
||||
// GlState.disableAlpha();
|
||||
// GlState.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
// GlState.shadeModel(7425);
|
||||
// GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
// RenderBuffer worldrenderer = Tessellator.getBuffer();
|
||||
// worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
// worldrenderer.pos((double)right, (double)top, 0.0).color(f1, f2, f3, f).endVertex();
|
||||
|
@ -305,7 +302,7 @@ public abstract class Gui {
|
|||
// worldrenderer.pos((double)left, (double)bottom, 0.0).color(f5, f6, f7, f4).endVertex();
|
||||
// worldrenderer.pos((double)right, (double)bottom, 0.0).color(f5, f6, f7, f4).endVertex();
|
||||
// Tessellator.draw();
|
||||
// GlState.shadeModel(7424);
|
||||
// GlState.shadeModel(GL11.GL_FLAT);
|
||||
// GlState.disableBlend();
|
||||
// GlState.enableAlpha();
|
||||
// GlState.enableTexture2D();
|
||||
|
|
|
@ -19,7 +19,6 @@ import game.item.CheatTab;
|
|||
import game.item.ItemStack;
|
||||
import game.packet.CPacketCheat;
|
||||
import game.renderer.Drawing;
|
||||
import game.renderer.Drawing.Vec2i;
|
||||
import game.renderer.GlState;
|
||||
import game.renderer.ItemRenderer;
|
||||
import game.renderer.entity.RenderItem;
|
||||
|
|
|
@ -5,9 +5,7 @@ import org.lwjgl.opengl.GL11;
|
|||
import game.Game;
|
||||
import game.audio.PositionedSound;
|
||||
import game.audio.Volume;
|
||||
import game.gui.Font;
|
||||
import game.gui.Gui;
|
||||
import game.gui.element.Dropdown.Handle;
|
||||
import game.init.SoundEvent;
|
||||
import game.renderer.Drawing;
|
||||
import game.renderer.Drawing.Vec2i;
|
||||
|
|
|
@ -2,6 +2,8 @@ package game.gui.element;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import game.gui.Gui;
|
||||
|
@ -185,7 +187,7 @@ public abstract class GuiList<T extends ListEntry> extends Gui
|
|||
GlState.enableBlend();
|
||||
GlState.tryBlendFuncSeparate(770, 771, 0, 1);
|
||||
GlState.disableAlpha();
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
GlState.disableTexture2D();
|
||||
|
||||
int i1 = 4;
|
||||
|
@ -236,7 +238,7 @@ public abstract class GuiList<T extends ListEntry> extends Gui
|
|||
}
|
||||
|
||||
GlState.enableTexture2D();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.enableAlpha();
|
||||
GlState.disableBlend();
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package game.gui.element;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import game.gui.Font;
|
||||
import game.gui.element.Dropdown.Handle;
|
||||
import game.renderer.Drawing;
|
||||
import game.renderer.Drawing.Offset;
|
||||
import game.renderer.Drawing.Vec2i;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package game.renderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import game.Game;
|
||||
import game.color.TextColor;
|
||||
import game.gui.Font;
|
||||
|
@ -45,7 +47,7 @@ public abstract class Drawing {
|
|||
GlState.enableBlend();
|
||||
GlState.disableAlpha();
|
||||
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
GlState.color(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
Font.bindTexture();
|
||||
RenderBuffer rb = Tessellator.getBuffer();
|
||||
|
@ -90,7 +92,7 @@ public abstract class Drawing {
|
|||
x += u;
|
||||
}
|
||||
Tessellator.draw();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.disableBlend();
|
||||
GlState.enableAlpha();
|
||||
GlState.enableTexture2D();
|
||||
|
@ -304,7 +306,7 @@ public abstract class Drawing {
|
|||
GlState.enableBlend();
|
||||
GlState.disableAlpha();
|
||||
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
GlState.color(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
Font.bindTexture();
|
||||
RenderBuffer rb = Tessellator.getBuffer();
|
||||
|
@ -372,7 +374,7 @@ public abstract class Drawing {
|
|||
x += glyph.u + 3 - glyph.s;
|
||||
}
|
||||
Tessellator.draw();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.disableBlend();
|
||||
GlState.enableAlpha();
|
||||
GlState.enableTexture2D();
|
||||
|
@ -415,7 +417,7 @@ public abstract class Drawing {
|
|||
GlState.enableBlend();
|
||||
GlState.disableAlpha();
|
||||
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
RenderBuffer buf = Tessellator.getBuffer();
|
||||
buf.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
buf.pos((double)(x + w), (double)y, 0.0).color(ctop).endVertex();
|
||||
|
@ -423,7 +425,7 @@ public abstract class Drawing {
|
|||
buf.pos((double)x, (double)(y + h), 0.0).color(cbottom).endVertex();
|
||||
buf.pos((double)(x + w), (double)(y + h), 0.0).color(cbottom).endVertex();
|
||||
Tessellator.draw();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.disableBlend();
|
||||
GlState.enableAlpha();
|
||||
GlState.enableTexture2D();
|
||||
|
@ -435,7 +437,7 @@ public abstract class Drawing {
|
|||
GlState.enableBlend();
|
||||
GlState.disableAlpha();
|
||||
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
RenderBuffer buf = Tessellator.getBuffer();
|
||||
buf.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
buf.pos((double)(x + w), (double)y, 0.0).color(topright).endVertex();
|
||||
|
@ -443,7 +445,7 @@ public abstract class Drawing {
|
|||
buf.pos((double)x, (double)(y + h), 0.0).color(btmleft).endVertex();
|
||||
buf.pos((double)(x + w), (double)(y + h), 0.0).color(btmright).endVertex();
|
||||
Tessellator.draw();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.disableBlend();
|
||||
GlState.enableAlpha();
|
||||
GlState.enableTexture2D();
|
||||
|
@ -456,7 +458,7 @@ public abstract class Drawing {
|
|||
GlState.disableAlpha();
|
||||
GlState.disableTexture2D();
|
||||
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
GlState.color(color);
|
||||
rb.begin(7, DefaultVertexFormats.POSITION);
|
||||
rb.pos((double)x, (double)(y + h), 0.0D).endVertex();
|
||||
|
@ -464,7 +466,7 @@ public abstract class Drawing {
|
|||
rb.pos((double)(x + w), (double)y, 0.0D).endVertex();
|
||||
rb.pos((double)x, (double)y, 0.0D).endVertex();
|
||||
Tessellator.draw();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.enableTexture2D();
|
||||
GlState.disableBlend();
|
||||
GlState.enableAlpha();
|
||||
|
|
|
@ -979,7 +979,7 @@ public class EntityRenderer {
|
|||
}
|
||||
|
||||
this.setupFog(0, partialTicks);
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
if (entity.posY + (double)entity.getEyeHeight() < (double)this.gm.theWorld.dimension.getCloudHeight())
|
||||
{
|
||||
|
@ -999,7 +999,7 @@ public class EntityRenderer {
|
|||
// this.gm.getTextureManager().getTexture(TextureMap.locationBlocksTexture).unsetMipmap();
|
||||
renderglobal.renderBlockLayer(BlockLayer.CUTOUT, (double)partialTicks, entity);
|
||||
// this.gm.getTextureManager().getTexture(TextureMap.locationBlocksTexture).restoreLastMipmap();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.alphaFunc(516, 0.1F);
|
||||
|
||||
// if (!this.debugView)
|
||||
|
@ -1065,9 +1065,9 @@ public class EntityRenderer {
|
|||
GlState.enableBlend();
|
||||
GlState.depthMask(false);
|
||||
this.gm.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
renderglobal.renderBlockLayer(BlockLayer.TRANSLUCENT, (double)partialTicks, entity);
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.depthMask(true);
|
||||
GlState.enableCull();
|
||||
GlState.disableBlend();
|
||||
|
|
|
@ -217,6 +217,11 @@ public class GlState
|
|||
cullState.cullFace.setDisabled();
|
||||
}
|
||||
|
||||
public static boolean isCullEbabled()
|
||||
{
|
||||
return cullState.cullFace.currentState;
|
||||
}
|
||||
|
||||
public static void cullFace(int mode)
|
||||
{
|
||||
if (mode != cullState.mode)
|
||||
|
|
|
@ -84,7 +84,7 @@ public class ItemRenderer
|
|||
GL11.glLightfv(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, setColorBuffer(f1, f1, f1, 1.0F));
|
||||
GL11.glLightfv(GL11.GL_LIGHT1, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
||||
GL11.glLightfv(GL11.GL_LIGHT1, GL11.GL_SPECULAR, setColorBuffer(f2, f2, f2, 1.0F));
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GL11.glLightModelfv(GL11.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(f, f, f, 1.0F));
|
||||
}
|
||||
|
||||
|
|
|
@ -1179,7 +1179,7 @@ public class RenderGlobal
|
|||
if (afloat != null)
|
||||
{
|
||||
GlState.disableTexture2D();
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(ExtMath.sin(this.theWorld.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
@ -1212,7 +1212,7 @@ public class RenderGlobal
|
|||
|
||||
Tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
GlState.enableTexture2D();
|
||||
|
|
|
@ -7,7 +7,6 @@ import game.block.Block;
|
|||
import game.entity.Entity;
|
||||
import game.renderer.DefaultVertexFormats;
|
||||
import game.renderer.Drawing;
|
||||
import game.renderer.Drawing.Vec2i;
|
||||
import game.renderer.Frustum;
|
||||
import game.renderer.GlState;
|
||||
import game.renderer.RenderBuffer;
|
||||
|
|
|
@ -537,7 +537,7 @@ public abstract class RendererLivingEntity<T extends EntityLiving> extends Rende
|
|||
ItemRenderer.disableStandardItemLighting();
|
||||
GlState.disableCull();
|
||||
this.bindTexture(crystalBeamTextures);
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
float f7 = 0.0F - ((float)entity.ticksExisted + p_180574_8_) * 0.01F;
|
||||
float f8 = ExtMath.sqrtf(f2 * f2 + f3 * f3 + f4 * f4) / 32.0F - ((float)entity.ticksExisted + p_180574_8_) * 0.01F;
|
||||
worldrenderer.begin(5, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
|
@ -554,7 +554,7 @@ public abstract class RendererLivingEntity<T extends EntityLiving> extends Rende
|
|||
|
||||
Tessellator.draw();
|
||||
GlState.enableCull();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
ItemRenderer.enableStandardItemLighting();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public class LayerEntityBreak implements LayerRenderer<EntityDragon>
|
|||
|
||||
Random random = new Random(432L);
|
||||
GlState.disableTexture2D();
|
||||
GlState.shadeModel(7425);
|
||||
GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
GlState.enableBlend();
|
||||
GlState.blendFunc(770, 1);
|
||||
GlState.disableAlpha();
|
||||
|
@ -61,7 +61,7 @@ public class LayerEntityBreak implements LayerRenderer<EntityDragon>
|
|||
GlState.depthMask(true);
|
||||
GlState.disableCull();
|
||||
GlState.disableBlend();
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlState.enableTexture2D();
|
||||
GlState.enableAlpha();
|
||||
|
|
|
@ -47,8 +47,10 @@ public class TileEntityItemStackRenderer
|
|||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
|
||||
GL11.glScalef(2.0F, 2.0F, 2.0F);
|
||||
boolean flag = GlState.isCullEbabled();
|
||||
GlState.disableCull();
|
||||
TileEntitySkullRenderer.instance.renderSkull(0.0F, 0.0F, 0.0F, Facing.UP, 0.0F, -1);
|
||||
if(flag)
|
||||
GlState.enableCull();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package game.renderer.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import game.Game;
|
||||
import game.block.Block;
|
||||
import game.block.BlockPistonBase;
|
||||
|
@ -40,11 +42,11 @@ public class TileEntityPistonRenderer extends TileEntitySpecialRenderer<TileEnti
|
|||
|
||||
// if (Game.getGame().isAmbientOcclusionEnabled())
|
||||
// {
|
||||
// GlState.shadeModel(7425);
|
||||
// GlState.shadeModel(GL11.GL_SMOOTH);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
GlState.shadeModel(7424);
|
||||
GlState.shadeModel(GL11.GL_FLAT);
|
||||
// }
|
||||
|
||||
worldrenderer.begin(7, DefaultVertexFormats.BLOCK);
|
||||
|
|
|
@ -6,7 +6,6 @@ import game.block.Block;
|
|||
import game.gui.Font;
|
||||
import game.init.Blocks;
|
||||
import game.renderer.Drawing;
|
||||
import game.renderer.Drawing.Vec2i;
|
||||
import game.renderer.GlState;
|
||||
import game.renderer.model.ModelSign;
|
||||
import game.tileentity.TileEntitySign;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue