Skip to content

Instantly share code, notes, and snippets.

@fkaa
Created December 19, 2011 22:21
Show Gist options
  • Save fkaa/1499181 to your computer and use it in GitHub Desktop.
Save fkaa/1499181 to your computer and use it in GitHub Desktop.
A very silly mod to demonstrate full-screen blurring via a 7x7 gaussian blur. Made by UltraMoogleMan.
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import java.io.File;
import java.util.*;
import java.nio.*;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.ContextCapabilities;
import org.lwjgl.opengl.GLContext;
import org.lwjgl.util.glu.GLU;
import org.lwjgl.input.Keyboard;
public class mod_Bleary extends BaseMod
{
public String toString()
{
return "Bleary";
}
private IntBuffer framebufferID;
private boolean frameFlip = false;
private int framebufferBlurTex[];
public String Version()
{
return "1.7.3";
}
public mod_Bleary()
{
framebufferID = GLAllocation.createDirectIntBuffer(2);
framebufferID.clear();
framebufferBlurTex = new int[2];
GLAllocation.generateTextureNames(framebufferID);
for(int idx = 0; idx < 2; idx++)
{
framebufferBlurTex[idx] = framebufferID.get(idx);
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, framebufferBlurTex[idx]);
GL11.glTexParameteri(3553 /*GL_TEXTURE_2D*/, 10241 /*GL_TEXTURE_MIN_FILTER*/, 9729 /*GL_LINEAR*/);
GL11.glTexParameteri(3553 /*GL_TEXTURE_2D*/, 10240 /*GL_TEXTURE_MAG_FILTER*/, 9729 /*GL_LINEAR*/);
GL11.glTexParameteri(3553 /*GL_TEXTURE_2D*/, 10242 /*GL_TEXTURE_WRAP_S*/, 10496 /*GL_CLAMP*/);
GL11.glTexParameteri(3553 /*GL_TEXTURE_2D*/, 10243 /*GL_TEXTURE_WRAP_T*/, 10496 /*GL_CLAMP*/);
}
ModLoader.SetInGameHook(this, true, false);
}
public boolean OnTickInGame(Minecraft mc)
{
ScaledResolution scaler = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
GL11.glClear(256);
DrawBlur(mc, scaler);
return true;
}
private void DrawWobble(Minecraft mc, ScaledResolution scaler)
{
Tessellator tessellator = Tessellator.instance;
GL11.glCopyTexImage2D(3553 /*GL_TEXTURE_2D*/, 0, 6407 /*GL_RGB*/, 0, 0, mc.displayWidth, mc.displayHeight, 1); // Store our final texture
GL11.glColorMask(true, false, true, false);
float scale = scaler.scaleFactor;
float uScale = 1.0f / (float)mc.displayWidth;
float vScale = 1.0f / (float)mc.displayHeight;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f);
float spacing = 10.0f;
float xSpacing = mc.displayWidth / spacing;
float ySpacing = mc.displayHeight / spacing;
float maxOffset = mc.displayWidth * mc.displayHeight;
for(float y = 0.0f; y < mc.displayHeight; y += ySpacing)
{
for(float x = 0.0f; x < mc.displayWidth; x += xSpacing)
{
float u = x * uScale;
float v = y * vScale;
float v0Offset = (y + ySpacing) * mc.displayWidth + x;
float v1Offset = (y + ySpacing) * mc.displayWidth + x + xSpacing;
float v2Offset = y * mc.displayWidth + (x + xSpacing);
float v3Offset = y * mc.displayWidth + x;
float v0xWobble = (float)Math.sin(radiusTime * 5.0f + v0Offset) * 20.0f;
float v0yWobble = (float)Math.cos(radiusTime * 5.0f + v0Offset) * 20.0f;
float v1xWobble = (float)Math.sin(radiusTime * 5.0f + v1Offset) * 20.0f;
float v1yWobble = (float)Math.cos(radiusTime * 5.0f + v1Offset) * 20.0f;
float v2xWobble = (float)Math.sin(radiusTime * 5.0f + v2Offset) * 20.0f;
float v2yWobble = (float)Math.cos(radiusTime * 5.0f + v2Offset) * 20.0f;
float v3xWobble = (float)Math.sin(radiusTime * 5.0f + v3Offset) * 20.0f;
float v3yWobble = (float)Math.cos(radiusTime * 5.0f + v3Offset) * 20.0f;
if(x == 0.0f)
{
v0xWobble = 0.0f;
v0yWobble = 0.0f;
v3xWobble = 0.0f;
v3yWobble = 0.0f;
}
else if(x >= (mc.displayWidth - (xSpacing + 0.01f)))
{
v1xWobble = 0.0f;
v1yWobble = 0.0f;
v2xWobble = 0.0f;
v2yWobble = 0.0f;
}
if(y == 0.0f)
{
v2xWobble = 0.0f;
v2yWobble = 0.0f;
v3xWobble = 0.0f;
v3yWobble = 0.0f;
}
else if(y >= (mc.displayHeight - (ySpacing + 0.01f)))
{
v0xWobble = 0.0f;
v0yWobble = 0.0f;
v1xWobble = 0.0f;
v1yWobble = 0.0f;
}
tessellator.addVertexWithUV((x + v0xWobble ) / scale, (y + v0yWobble + ySpacing) / scale, 0, u , 1.0f - (v + vScale * ySpacing));
tessellator.addVertexWithUV((x + v1xWobble + xSpacing) / scale, (y + v1yWobble + ySpacing) / scale, 0, u + uScale * xSpacing, 1.0f - (v + vScale * ySpacing));
tessellator.addVertexWithUV((x + v2xWobble + xSpacing) / scale, (y + v2yWobble ) / scale, 0, u + uScale * xSpacing, 1.0f - v);
tessellator.addVertexWithUV((x + v3xWobble ) / scale, (y + v3yWobble ) / scale, 0, u , 1.0f - v);
}
}
tessellator.draw();
GL11.glColorMask(false, true, false, false);
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f);
for(float y = 0.0f; y < mc.displayHeight; y += ySpacing)
{
for(float x = 0.0f; x < mc.displayWidth; x += xSpacing)
{
float u = x * uScale;
float v = y * vScale;
float v0Offset = (y + ySpacing) * mc.displayWidth + x;
float v1Offset = (y + ySpacing) * mc.displayWidth + x + xSpacing;
float v2Offset = y * mc.displayWidth + (x + xSpacing);
float v3Offset = y * mc.displayWidth + x;
float v0xWobble = (float)Math.sin(-radiusTime * 5.0f - v0Offset) * 7.0f;
float v0yWobble = (float)Math.cos(-radiusTime * 5.0f - v0Offset) * 7.0f;
float v1xWobble = (float)Math.sin(-radiusTime * 5.0f - v1Offset) * 7.0f;
float v1yWobble = (float)Math.cos(-radiusTime * 5.0f - v1Offset) * 7.0f;
float v2xWobble = (float)Math.sin(-radiusTime * 5.0f - v2Offset) * 7.0f;
float v2yWobble = (float)Math.cos(-radiusTime * 5.0f - v2Offset) * 7.0f;
float v3xWobble = (float)Math.sin(-radiusTime * 5.0f - v3Offset) * 7.0f;
float v3yWobble = (float)Math.cos(-radiusTime * 5.0f - v3Offset) * 7.0f;
if(x == 0.0f)
{
v0xWobble = 0.0f;
v0yWobble = 0.0f;
v3xWobble = 0.0f;
v3yWobble = 0.0f;
}
else if(x >= (mc.displayWidth - (xSpacing + 0.01f)))
{
v1xWobble = 0.0f;
v1yWobble = 0.0f;
v2xWobble = 0.0f;
v2yWobble = 0.0f;
}
if(y == 0.0f)
{
v2xWobble = 0.0f;
v2yWobble = 0.0f;
v3xWobble = 0.0f;
v3yWobble = 0.0f;
}
else if(y >= (mc.displayHeight - (ySpacing + 0.01f)))
{
v0xWobble = 0.0f;
v0yWobble = 0.0f;
v1xWobble = 0.0f;
v1yWobble = 0.0f;
}
tessellator.addVertexWithUV((x + v0xWobble ) / scale, (y + v0yWobble + ySpacing) / scale, 0, u , 1.0f - (v + vScale * ySpacing));
tessellator.addVertexWithUV((x + v1xWobble + xSpacing) / scale, (y + v1yWobble + ySpacing) / scale, 0, u + uScale * xSpacing, 1.0f - (v + vScale * ySpacing));
tessellator.addVertexWithUV((x + v2xWobble + xSpacing) / scale, (y + v2yWobble ) / scale, 0, u + uScale * xSpacing, 1.0f - v);
tessellator.addVertexWithUV((x + v3xWobble ) / scale, (y + v3yWobble ) / scale, 0, u , 1.0f - v);
}
}
tessellator.draw();
GL11.glColorMask(true, true, true, false);
}
private float blurTap0Strength = 0.6f;
private float blurTap1Strength = 0.25f;
private float blurTap2Strength = 0.12f;
private float blurRadius = 0.0f; // Blur radius, in pixels
private float blurVelocity = 0.015f;
private int frame = 0;
private void DrawBlur(Minecraft mc, ScaledResolution scaler)
{
frame++;
float radiusTime = frame / 300.0f;
blurRadius = (MathHelper.sin(radiusTime) + 1.0f) * 1.0f;
float tapTime = frame / 199.0f;
blurTap0Strength = (MathHelper.sin(tapTime) + 1.0f) * 0.5f;
blurTap1Strength = (MathHelper.sin(tapTime) + 1.0f) * 0.4f;
blurTap2Strength = (MathHelper.sin(tapTime) + 1.0f) * 0.3f;
blurRadius += blurVelocity;
if(blurRadius >= 10.0f)
{
blurVelocity = -0.015f;
blurRadius = 10.0f;
}
else if(blurRadius <= 0.0f)
{
blurVelocity = 0.015f;
blurRadius = 0.0f;
}
Tessellator tessellator = Tessellator.instance;
GL11.glDepthMask(false); // Disable Z writing
GL11.glDisable(3008 /*GL_ALPHA_TEST*/); // Disable alpha cutoff
GL11.glEnable(3553 /*GL_TEXTURE_2D*/); // Enable texturing
GL11.glEnable(3042 /*GL_BLEND*/); // Enable blending
GL11.glBlendFunc(770, 771); // Enable standard alpha blending
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, frameFlip ? framebufferBlurTex[0] : framebufferBlurTex[1]); // Bind our workspace
GL11.glCopyTexImage2D(3553 /*GL_TEXTURE_2D*/, 0, 6407 /*GL_RGB*/, 0, 0, mc.displayWidth, mc.displayHeight, 1); // Copy the framebuffer into our workspace
// Halve our texture size in order to reduce the amount of samples needed (bilinear filtering gives us a 'free' 2x2 blur)
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f);
tessellator.addVertexWithUV( 0.0f / (scaler.scaleFactor * 2.0f), mc.displayHeight / (scaler.scaleFactor * 2.0f), 0, 0.0f, 0.0f);
tessellator.addVertexWithUV(mc.displayWidth / (scaler.scaleFactor * 2.0f), mc.displayHeight / (scaler.scaleFactor * 2.0f), 0, 1.0f, 0.0f);
tessellator.addVertexWithUV(mc.displayWidth / (scaler.scaleFactor * 2.0f), 0.0f / (scaler.scaleFactor * 2.0f), 0, 1.0f, 1.0f);
tessellator.addVertexWithUV( 0.0f / (scaler.scaleFactor * 2.0f), 0.0f / (scaler.scaleFactor * 2.0f), 0, 0.0f, 1.0f);
tessellator.draw();
GL11.glCopyTexImage2D(3553 /*GL_TEXTURE_2D*/, 0, 6407 /*GL_RGB*/, 0, 0, mc.displayWidth, mc.displayHeight, 1); // Copy the framebuffer into our target
// Blurring with a fixed-function pipeline is pretty simple, as gaussian blurring is a separable process.
// 1. Draw the half-sized texture in its original position.
// 2. Draw the half-sized texture 3 increments to the left and 3 increments to the right, with brightness ramping off on either side.
// 3. Copy the framebuffer into a texture.
// 4. You now have a horziontally-blurred texture.
// 5. Perform steps 2 and 3 once again, but with 3 increments above and below the center line. This will perform the vertical half of the blur.
// 6. Congratulations! You now have a blurred texture.
// Perform a horizontal gaussian blur
tessellator.startDrawingQuads();
// Center tap
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f);
tessellator.addVertexWithUV( 0.0f / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.0f, 0.5f);
tessellator.addVertexWithUV(mc.displayWidth / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.5f, 0.5f);
tessellator.addVertexWithUV(mc.displayWidth / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.5f, 1.0f);
tessellator.addVertexWithUV( 0.0f / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.0f, 1.0f);
// Tap +/- 1
tessellator.addVertexWithUV( (0.0f - blurRadius) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.0f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth - blurRadius) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.5f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth - blurRadius) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.5f, 1.0f);
tessellator.addVertexWithUV( (0.0f - blurRadius) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + blurRadius) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.0f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth + blurRadius) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.5f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth + blurRadius) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.5f, 1.0f);
tessellator.addVertexWithUV( (0.0f + blurRadius) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.0f, 1.0f);
// Tap +/- 2
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, blurTap1Strength);
tessellator.addVertexWithUV( (0.0f - blurRadius * 2.0f) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.0f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth - blurRadius * 2.0f) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.5f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth - blurRadius * 2.0f) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.5f, 1.0f);
tessellator.addVertexWithUV( (0.0f - blurRadius * 2.0f) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + blurRadius * 2.0f) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.0f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth + blurRadius * 2.0f) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.5f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth + blurRadius * 2.0f) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.5f, 1.0f);
tessellator.addVertexWithUV( (0.0f + blurRadius * 2.0f) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.0f, 1.0f);
// Tap +/- 3
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, blurTap2Strength);
tessellator.addVertexWithUV( (0.0f - blurRadius * 3.0f) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.0f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth - blurRadius * 3.0f) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.5f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth - blurRadius * 3.0f) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.5f, 1.0f);
tessellator.addVertexWithUV( (0.0f - blurRadius * 3.0f) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + blurRadius * 3.0f) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.0f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth + blurRadius * 3.0f) / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.5f, 0.5f);
tessellator.addVertexWithUV((mc.displayWidth + blurRadius * 3.0f) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.5f, 1.0f);
tessellator.addVertexWithUV( (0.0f + blurRadius * 3.0f) / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.0f, 1.0f);
tessellator.draw();
GL11.glCopyTexImage2D(3553 /*GL_TEXTURE_2D*/, 0, 6407 /*GL_RGB*/, 0, 0, mc.displayWidth, mc.displayHeight, 1); // Store our horizontally-blurred texture
// Perform a vertical gaussian blur
tessellator.startDrawingQuads();
// Center tap
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f);
tessellator.addVertexWithUV( 0.0f / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 0.0f, 0.0f);
tessellator.addVertexWithUV(mc.displayWidth / scaler.scaleFactor, mc.displayHeight / scaler.scaleFactor, 0, 1.0f, 0.0f);
tessellator.addVertexWithUV(mc.displayWidth / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 1.0f, 1.0f);
tessellator.addVertexWithUV( 0.0f / scaler.scaleFactor, 0.0f / scaler.scaleFactor, 0, 0.0f, 1.0f);
// Tap +/- 1
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, blurTap0Strength);
tessellator.addVertexWithUV( (0.0f - 0.0f) / scaler.scaleFactor, (mc.displayHeight - blurRadius) / scaler.scaleFactor, 0, 0.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth - 0.0f) / scaler.scaleFactor, (mc.displayHeight - blurRadius) / scaler.scaleFactor, 0, 1.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth - 0.0f) / scaler.scaleFactor, (0.0f - blurRadius) / scaler.scaleFactor, 0, 1.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f - 0.0f) / scaler.scaleFactor, (0.0f - blurRadius) / scaler.scaleFactor, 0, 0.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + 0.0f) / scaler.scaleFactor, (mc.displayHeight + blurRadius) / scaler.scaleFactor, 0, 0.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth + 0.0f) / scaler.scaleFactor, (mc.displayHeight + blurRadius) / scaler.scaleFactor, 0, 1.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth + 0.0f) / scaler.scaleFactor, (0.0f + blurRadius) / scaler.scaleFactor, 0, 1.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + 0.0f) / scaler.scaleFactor, (0.0f + blurRadius) / scaler.scaleFactor, 0, 0.0f, 1.0f);
// Tap +/- 2
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, blurTap1Strength);
tessellator.addVertexWithUV( (0.0f - 0.0f) / scaler.scaleFactor, (mc.displayHeight - blurRadius * 2.0f) / scaler.scaleFactor, 0, 0.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth - 0.0f) / scaler.scaleFactor, (mc.displayHeight - blurRadius * 2.0f) / scaler.scaleFactor, 0, 1.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth - 0.0f) / scaler.scaleFactor, (0.0f - blurRadius * 2.0f) / scaler.scaleFactor, 0, 1.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f - 0.0f) / scaler.scaleFactor, (0.0f - blurRadius * 2.0f) / scaler.scaleFactor, 0, 0.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + 0.0f) / scaler.scaleFactor, (mc.displayHeight + blurRadius * 2.0f) / scaler.scaleFactor, 0, 0.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth + 0.0f) / scaler.scaleFactor, (mc.displayHeight + blurRadius * 2.0f) / scaler.scaleFactor, 0, 1.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth + 0.0f) / scaler.scaleFactor, (0.0f + blurRadius * 2.0f) / scaler.scaleFactor, 0, 1.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + 0.0f) / scaler.scaleFactor, (0.0f + blurRadius * 2.0f) / scaler.scaleFactor, 0, 0.0f, 1.0f);
// Tap +/- 3
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, blurTap2Strength);
tessellator.addVertexWithUV( (0.0f - 0.0f) / scaler.scaleFactor, (mc.displayHeight - blurRadius * 3.0f) / scaler.scaleFactor, 0, 0.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth - 0.0f) / scaler.scaleFactor, (mc.displayHeight - blurRadius * 3.0f) / scaler.scaleFactor, 0, 1.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth - 0.0f) / scaler.scaleFactor, (0.0f - blurRadius * 3.0f) / scaler.scaleFactor, 0, 1.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f - 0.0f) / scaler.scaleFactor, (0.0f - blurRadius * 3.0f) / scaler.scaleFactor, 0, 0.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + 0.0f) / scaler.scaleFactor, (mc.displayHeight + blurRadius * 3.0f) / scaler.scaleFactor, 0, 0.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth + 0.0f) / scaler.scaleFactor, (mc.displayHeight + blurRadius * 3.0f) / scaler.scaleFactor, 0, 1.0f, 0.0f);
tessellator.addVertexWithUV((mc.displayWidth + 0.0f) / scaler.scaleFactor, (0.0f + blurRadius * 3.0f) / scaler.scaleFactor, 0, 1.0f, 1.0f);
tessellator.addVertexWithUV( (0.0f + 0.0f) / scaler.scaleFactor, (0.0f + blurRadius * 3.0f) / scaler.scaleFactor, 0, 0.0f, 1.0f);
tessellator.draw();
DrawWobble(mc, scaler);
GL11.glColorMask(true, true, true, false);
GL11.glDisable(3042 /*GL_BLEND*/); // Disable blending
GL11.glDisable(3553 /*GL_TEXTURE_2D*/); // Disable texturing
GL11.glEnable(3008 /*GL_ALPHA_TEST*/); // Re-enable alpha cutoff
GL11.glDepthMask(true); // Re-enable Z buffering
tessellator.setColorRGBA_F(1.0f, 1.0f, 1.f, 1.0f); // Clear our colour out of the Tessellator
frameFlip = !frameFlip; // Flip our internal buffers
}
static
{
}
}
@fkaa
Copy link
Author

fkaa commented Oct 12, 2020

Wow, nostalgia trip.

what mod loader was this written with?

ModLoader was the only mod loader at the time, but you probably don't want to use this. There are better ways to do a gaussian blur :-)

@lawrencfgsdfg
Copy link

what a relic from the past

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment