changed vert to the glsl tutorial one
This commit is contained in:
@@ -73,7 +73,7 @@ public class AudioAnalyzer {
|
||||
UMBinBegin = 200;
|
||||
UMBinEnd = 512;
|
||||
|
||||
bassThresholdCalcRange = thresholdRangeCalc(0.3f);
|
||||
bassThresholdCalcRange = thresholdRangeCalc(0.28f);
|
||||
UMThresholdCalcRange = thresholdRangeCalc(0.3f);
|
||||
|
||||
Gdx.app.debug("Read freq", String.valueOf(audioData.getFormat().getSampleRate()));
|
||||
|
@@ -56,7 +56,7 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
map.beginBuild();
|
||||
for (int index = 0; index < bassPeaks.size; index++) {
|
||||
if (bassPeaks.get(index) != 0 || UMPeaks.get(index) != 0) {
|
||||
if (bassPeaks.get(index) >= avgBass*0.9f) {
|
||||
if (bassPeaks.get(index) >= avgBass) {
|
||||
//TODO basic void circle spawning
|
||||
float warningTime = map.goBack((int) (windowPerSecond*1.5f))/windowPerSecond;
|
||||
float endRadius = (bassPeaks.get(index)/bassMax)*(Polyjet.GAME_AREA_HEIGHT/4f);
|
||||
@@ -67,7 +67,6 @@ public class RhythmMapAlgorithm implements Runnable {
|
||||
endRadius/(avgSPB*0.7f),
|
||||
warningTime
|
||||
);
|
||||
|
||||
map.resetIndex();
|
||||
}
|
||||
if (UMPeaks.get(index) >= avgUM) {
|
||||
|
@@ -31,7 +31,7 @@ public class GamePlayArea extends Stage {
|
||||
private float yTeleport = Polyjet.GAME_AREA_HEIGHT/2;
|
||||
private int score;
|
||||
|
||||
private ShaderProgram invert;
|
||||
private ShaderProgram glowShader;
|
||||
private ShaderProgram bgShader;
|
||||
|
||||
private Texture background;
|
||||
@@ -60,18 +60,16 @@ public class GamePlayArea extends Stage {
|
||||
* @param prefs
|
||||
*/
|
||||
public void loadShaders(Preferences prefs) {
|
||||
if (prefs.getBoolean("invert shader")) {
|
||||
Gdx.app.debug("Shader", "using inversion shader");
|
||||
invert = new ShaderProgram(Gdx.files.internal("shaders/invert_vert.glsl").readString(), Gdx.files.internal("shaders/invert_frag.glsl").readString());
|
||||
ShaderProgram.pedantic = false;
|
||||
if (!invert.isCompiled()) {
|
||||
System.err.println(invert.getLog());
|
||||
if (prefs.getBoolean("glow shader")) {
|
||||
Gdx.app.debug("Shader", "using glow shader");
|
||||
glowShader = new ShaderProgram(Gdx.files.internal("shaders/glow_vert.glsl").readString(), Gdx.files.internal("shaders/glow_frag.glsl").readString());
|
||||
if (!glowShader.isCompiled()) {
|
||||
System.err.println(glowShader.getLog());
|
||||
System.exit(0);
|
||||
}
|
||||
if (invert.getLog().length()!=0) {
|
||||
System.out.println(invert.getLog());
|
||||
if (glowShader.getLog().length()!=0) {
|
||||
System.out.println(glowShader.getLog());
|
||||
}
|
||||
getBatch().setShader(invert);
|
||||
|
||||
}
|
||||
|
||||
@@ -108,9 +106,11 @@ public class GamePlayArea extends Stage {
|
||||
getBatch().draw(background, 0f, 0f, Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT);
|
||||
getBatch().end();
|
||||
|
||||
|
||||
|
||||
getBatch().setShader(null);
|
||||
if (glowShader != null) {
|
||||
getBatch().setShader(glowShader);
|
||||
} else {
|
||||
getBatch().setShader(null);
|
||||
}
|
||||
super.draw();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user