More shader stuff. Shader has world position through vertex shader and blockpos.
Dissolve from firstpos to secondpos with some randomness. Blue pulse with diagonal highlights.
This commit is contained in:
@@ -250,7 +250,7 @@ public class RenderHelper implements IWorldEventListener {
|
||||
|
||||
if (sideHit != null) {
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
float percentile = ClientProxy.ticksInGame / 100f % 1f;
|
||||
float percentile = ClientProxy.ticksInGame / 50f % 1f;
|
||||
//TODO test
|
||||
percentile = 1f;
|
||||
|
||||
@@ -438,7 +438,7 @@ public class RenderHelper implements IWorldEventListener {
|
||||
|
||||
//image
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE/*new ResourceLocation(EffortlessBuilding.MODID, "textures/shader_color.png")*/).getGlTextureId());
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).getGlTextureId());
|
||||
ARBShaderObjects.glUniform1iARB(imageUniform, 0);
|
||||
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + secondaryTextureUnit);
|
||||
|
||||
@@ -41,9 +41,6 @@ public final class ShaderHelper {
|
||||
private static final String VERT_EXTENSION = ".vert";
|
||||
private static final String FRAG_EXTENSION = ".frag";
|
||||
|
||||
// public static final FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16);
|
||||
// public static final FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16);
|
||||
|
||||
public static int rawColor;
|
||||
public static int dissolve;
|
||||
|
||||
@@ -52,7 +49,7 @@ public final class ShaderHelper {
|
||||
return;
|
||||
|
||||
rawColor = createProgram("/assets/effortlessbuilding/shaders/raw_color", FRAG);
|
||||
dissolve = createProgram("/assets/effortlessbuilding/shaders/dissolve", FRAG);
|
||||
dissolve = createProgram("/assets/effortlessbuilding/shaders/dissolve", VERT + FRAG);
|
||||
}
|
||||
|
||||
public static void useShader(int shader, Consumer<Integer> callback) {
|
||||
@@ -65,17 +62,6 @@ public final class ShaderHelper {
|
||||
int time = ARBShaderObjects.glGetUniformLocationARB(shader, "time");
|
||||
ARBShaderObjects.glUniform1iARB(time, ClientProxy.ticksInGame);
|
||||
|
||||
// GlStateManager.getFloat(GL11.GL_PROJECTION_MATRIX, projection);
|
||||
// GlStateManager.getFloat(GL11.GL_MODELVIEW_MATRIX, modelview);
|
||||
|
||||
// int inverse_view_proj = ARBShaderObjects.glGetUniformLocationARB(shader, "inverse_view_proj");
|
||||
int screen_width = ARBShaderObjects.glGetUniformLocationARB(shader, "screen_width");
|
||||
int screen_height = ARBShaderObjects.glGetUniformLocationARB(shader, "screen_height");
|
||||
|
||||
// ARBShaderObjects.glUniformMatrix4ARB(inverse_view_proj, true, modelview);
|
||||
ARBShaderObjects.glUniform1fARB(screen_width, Minecraft.getMinecraft().displayWidth);
|
||||
ARBShaderObjects.glUniform1fARB(screen_height, Minecraft.getMinecraft().displayHeight);
|
||||
|
||||
if(callback != null)
|
||||
callback.accept(shader);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user