Spatial Sky Renderer fixed
Changed Tooltips for Spatial Cells Updated forge + mcp
This commit is contained in:
@@ -21,9 +21,11 @@ package appeng.client.render;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.renderer.Quaternion;
|
||||
import net.minecraftforge.client.SkyRenderHandler;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -36,7 +38,7 @@ import net.minecraftforge.client.IRenderHandler;
|
||||
|
||||
|
||||
//TODO https://github.com/MinecraftForge/MinecraftForge/pull/6537
|
||||
public class SpatialSkyRender implements IRenderHandler
|
||||
public class SpatialSkyRender implements SkyRenderHandler
|
||||
{
|
||||
|
||||
private static final SpatialSkyRender INSTANCE = new SpatialSkyRender();
|
||||
@@ -55,14 +57,17 @@ public class SpatialSkyRender implements IRenderHandler
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render( final int ticks, final float partialTicks, final ClientWorld world, final Minecraft mc )
|
||||
{
|
||||
//FIXME, Do not use this until the above PR is merged.
|
||||
if (true) {
|
||||
return;
|
||||
}
|
||||
private static final Quaternion[] SKYBOX_SIDE_ROTATIONS = {
|
||||
Quaternion.ONE,
|
||||
new Quaternion( 90.0F, 0.0F, 0.0F, true ),
|
||||
new Quaternion( -90.0F, 0.0F, 0.0F, true ),
|
||||
new Quaternion( 180.0F, 0.0F, 0.0F, true ),
|
||||
new Quaternion( 0.0F, 0.0F, 90.0F, true ),
|
||||
new Quaternion( 0.0F, 0.0F, -90.0F, true ),
|
||||
};
|
||||
|
||||
@Override
|
||||
public void render(int ticks, float partialTicks, MatrixStack matrixStack, ClientWorld world, Minecraft mc) {
|
||||
final long now = System.currentTimeMillis();
|
||||
if( now - this.cycle > 2000 )
|
||||
{
|
||||
@@ -76,46 +81,22 @@ public class SpatialSkyRender implements IRenderHandler
|
||||
fade /= 1000;
|
||||
fade = 0.15f * ( 1.0f - Math.abs( ( fade - 1.0f ) * ( fade - 1.0f ) ) );
|
||||
|
||||
GlStateManager.disableFog();
|
||||
GlStateManager.disableAlphaTest();
|
||||
RenderSystem.disableFog();
|
||||
RenderSystem.disableAlphaTest();
|
||||
RenderSystem.disableBlend();
|
||||
GlStateManager.depthMask( false );
|
||||
RenderSystem.depthMask( false );
|
||||
RenderSystem.color4f( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
final Tessellator tessellator = Tessellator.getInstance();
|
||||
final BufferBuilder VertexBuffer = tessellator.getBuffer();
|
||||
|
||||
// This renders a skybox around the player at a far, fixed distance from them.
|
||||
// The skybox is pitch black and untextured
|
||||
for( int i = 0; i < 6; ++i )
|
||||
for (Quaternion rotation : SKYBOX_SIDE_ROTATIONS)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
matrixStack.push();
|
||||
matrixStack.rotate(rotation);
|
||||
|
||||
if( i == 1 )
|
||||
{
|
||||
GlStateManager.rotatef( 90.0F, 1.0F, 0.0F, 0.0F );
|
||||
}
|
||||
|
||||
if( i == 2 )
|
||||
{
|
||||
GlStateManager.rotatef( -90.0F, 1.0F, 0.0F, 0.0F );
|
||||
}
|
||||
|
||||
if( i == 3 )
|
||||
{
|
||||
GlStateManager.rotatef( 180.0F, 1.0F, 0.0F, 0.0F );
|
||||
}
|
||||
|
||||
if( i == 4 )
|
||||
{
|
||||
GlStateManager.rotatef( 90.0F, 0.0F, 0.0F, 1.0F );
|
||||
}
|
||||
|
||||
if( i == 5 )
|
||||
{
|
||||
GlStateManager.rotatef( -90.0F, 0.0F, 0.0F, 1.0F );
|
||||
}
|
||||
|
||||
GlStateManager.disableTexture();
|
||||
RenderSystem.disableTexture();
|
||||
VertexBuffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION );
|
||||
VertexBuffer.pos( -100.0D, -100.0D, -100.0D ).endVertex();
|
||||
VertexBuffer.pos( -100.0D, -100.0D, 100.0D ).endVertex();
|
||||
@@ -123,19 +104,19 @@ public class SpatialSkyRender implements IRenderHandler
|
||||
VertexBuffer.pos( 100.0D, -100.0D, -100.0D ).endVertex();
|
||||
tessellator.draw();
|
||||
RenderSystem.enableTexture();
|
||||
GlStateManager.popMatrix();
|
||||
matrixStack.pop();
|
||||
}
|
||||
|
||||
GlStateManager.depthMask( true );
|
||||
RenderSystem.depthMask( true );
|
||||
|
||||
if( fade > 0.0f )
|
||||
{
|
||||
GlStateManager.disableFog();
|
||||
GlStateManager.disableAlphaTest();
|
||||
RenderSystem.disableFog();
|
||||
RenderSystem.disableAlphaTest();
|
||||
RenderSystem.enableBlend();
|
||||
GlStateManager.disableTexture();
|
||||
GlStateManager.depthMask( false );
|
||||
GlStateManager.blendFuncSeparate( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0 );
|
||||
RenderSystem.disableTexture();
|
||||
RenderSystem.depthMask( false );
|
||||
RenderSystem.blendFuncSeparate( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0 );
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
@@ -143,11 +124,11 @@ public class SpatialSkyRender implements IRenderHandler
|
||||
GL11.glCallList( this.dspList );
|
||||
}
|
||||
|
||||
GlStateManager.depthMask( true );
|
||||
RenderSystem.depthMask( true );
|
||||
RenderSystem.enableBlend();
|
||||
GlStateManager.enableAlphaTest();
|
||||
RenderSystem.enableAlphaTest();
|
||||
RenderSystem.enableTexture();
|
||||
GlStateManager.enableFog();
|
||||
RenderSystem.enableFog();
|
||||
|
||||
RenderSystem.color4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
@@ -155,8 +136,8 @@ public class SpatialSkyRender implements IRenderHandler
|
||||
private void renderTwinkles()
|
||||
{
|
||||
final Tessellator tessellator = Tessellator.getInstance();
|
||||
final BufferBuilder VertexBuffer = tessellator.getBuffer();
|
||||
VertexBuffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION );
|
||||
final BufferBuilder vb = tessellator.getBuffer();
|
||||
vb.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION );
|
||||
|
||||
for( int i = 0; i < 50; ++i )
|
||||
{
|
||||
@@ -196,7 +177,7 @@ public class SpatialSkyRender implements IRenderHandler
|
||||
final double d23 = d17 * d12 - d20 * d13;
|
||||
final double d24 = d23 * d9 - d21 * d10;
|
||||
final double d25 = d21 * d9 + d23 * d10;
|
||||
VertexBuffer.pos( x + d24, y + d22, z + d25 ).endVertex();
|
||||
vb.pos( x + d24, y + d22, z + d25 ).endVertex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user