generated from Anuken/MindustryJavaModTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa421dd
commit 5b790a1
Showing
6 changed files
with
80 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#define HIGHP | ||
|
||
uniform sampler2D u_texture; | ||
|
||
uniform vec2 u_campos; | ||
uniform vec2 u_resolution; | ||
uniform float u_time; | ||
|
||
varying vec2 v_texCoords; | ||
|
||
void main() { | ||
vec2 c = v_texCoords.xy; | ||
|
||
float sTime = u_time / 60.0; | ||
float amount = sin(sTime * 2.1); | ||
amount += sin(sTime * 3.5); | ||
amount += cos(sTime * 4.67); | ||
amount += sin(sTime * 1.2); | ||
amount *= 2.0; | ||
amount /= u_resolution.x; | ||
|
||
vec3 col = vec3( | ||
texture2D(u_texture, vec2(c.x + amount, c.y)).r, | ||
texture2D(u_texture, c).g, | ||
texture2D(u_texture, vec2(c.x - amount, c.y)).b | ||
); | ||
|
||
gl_FragColor = vec4(col, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package drunkustry.graphics; | ||
|
||
import arc.*; | ||
import arc.graphics.*; | ||
import arc.graphics.g2d.*; | ||
import arc.graphics.gl.*; | ||
import mindustry.game.EventType.*; | ||
import mindustry.graphics.*; | ||
|
||
import static arc.Core.*; | ||
|
||
public class DrunkRendering{ | ||
public static FrameBuffer colorBuffer; | ||
public static FrameBuffer aberrationBuffer; | ||
private static FrameBuffer distortionBuffer; | ||
|
||
public static void init(){ | ||
colorBuffer = new FrameBuffer(); | ||
aberrationBuffer = new FrameBuffer(); | ||
distortionBuffer = new FrameBuffer(); | ||
|
||
Events.run(Trigger.draw, () -> { | ||
colorBuffer.resize(graphics.getWidth(), graphics.getHeight()); | ||
aberrationBuffer.resize(graphics.getWidth(), graphics.getHeight()); | ||
distortionBuffer.resize(graphics.getWidth(), graphics.getHeight()); | ||
|
||
Draw.draw(Layer.background - 0.02f, () -> { | ||
distortionBuffer.begin(Color.clear); | ||
}); | ||
Draw.draw(Layer.background - 0.01f, () -> { | ||
aberrationBuffer.begin(Color.clear); | ||
}); | ||
|
||
Draw.draw(Layer.endPixeled + 1, () -> { | ||
aberrationBuffer.end(); | ||
aberrationBuffer.blit(DrunkShaders.chromaticAberration); | ||
|
||
colorBuffer.begin(Color.clear); | ||
Draw.rect(); | ||
colorBuffer.end(); | ||
colorBuffer.blit(DrunkShaders.colorHallucination); | ||
|
||
distortionBuffer.end(); | ||
distortionBuffer.blit(DrunkShaders.distortion); | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.