Fixed some things

This commit is contained in:
Anuken
2018-11-13 23:24:59 -05:00
parent d824b41bbb
commit 785c2e36c6
5 changed files with 14 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -7,6 +7,7 @@ precision mediump int;
#define p2 vec3(234.0,182.0,120.0)/255.0 #define p2 vec3(234.0,182.0,120.0)/255.0
#define p3 vec3(212.0,129.0,107.0)/255.0 #define p3 vec3(212.0,129.0,107.0)/255.0
#define p4 vec3(142.0,77.0,72.0)/255.0 #define p4 vec3(142.0,77.0,72.0)/255.0
#define roundm 0.2
uniform sampler2D u_texture; uniform sampler2D u_texture;
uniform vec2 u_resolution; uniform vec2 u_resolution;
@@ -21,12 +22,11 @@ varying vec2 v_texCoord;
void main() { void main() {
ivec2 coords = ivec2((gl_FragCoord.xy - u_resolution/2.0)/u_scl); ivec2 coords = ivec2((gl_FragCoord.xy - u_resolution/2.0)/u_scl);
int roundx = 8; //int roundx = 8;
int roundy = roundx; //int roundy = roundx;
float roundm = 0.2;
coords.x = (coords.x / roundx) * roundx; //coords.x = (coords.x / roundx) * roundx;
coords.y = (coords.y / roundy) * roundy; //coords.y = (coords.y / roundy) * roundy;
float d = (abs(float(coords.x)) - abs(float(coords.y))); float d = (abs(float(coords.x)) - abs(float(coords.y)));

View File

@@ -268,8 +268,8 @@ public class Renderer extends RendererModule{
} }
private void drawFlyerShadows(){ private void drawFlyerShadows(){
Graphics.surface(effectSurface, true, false); //Graphics.surface(effectSurface, true, false);
Draw.color(0, 0, 0, 0.15f);
float trnsX = -12, trnsY = -13; float trnsX = -12, trnsY = -13;
@@ -283,8 +283,8 @@ public class Renderer extends RendererModule{
drawAndInterpolate(playerGroup, unit -> unit.isFlying() && !unit.isDead(), player -> player.drawShadow(trnsX, trnsY)); drawAndInterpolate(playerGroup, unit -> unit.isFlying() && !unit.isDead(), player -> player.drawShadow(trnsX, trnsY));
} }
Draw.color(0, 0, 0, 0.15f);
Graphics.flushSurface(); //Graphics.flushSurface();
Draw.color(); Draw.color();
} }

View File

@@ -1,13 +1,7 @@
package io.anuke.mindustry.graphics; package io.anuke.mindustry.graphics;
import com.badlogic.gdx.graphics.Color;
import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Shader; import io.anuke.ucore.graphics.Shader;
import static io.anuke.mindustry.Vars.renderer;
public enum CacheLayer{ public enum CacheLayer{
water{ water{
@Override @Override
@@ -65,12 +59,13 @@ public enum CacheLayer{
protected void beginShader(){ protected void beginShader(){
//renderer.getBlocks().endFloor(); //renderer.getBlocks().endFloor();
renderer.effectSurface.getBuffer().begin(); // renderer.effectSurface.getBuffer().begin();
Graphics.clear(Color.CLEAR); //Graphics.clear(Color.CLEAR);
//renderer.getBlocks().beginFloor(); //renderer.getBlocks().beginFloor();
} }
public void endShader(Shader shader){ public void endShader(Shader shader){
/*
renderer.blocks.floor.endDraw(); renderer.blocks.floor.endDraw();
renderer.effectSurface.getBuffer().end(); renderer.effectSurface.getBuffer().end();
@@ -82,6 +77,6 @@ public enum CacheLayer{
Core.camera.viewportWidth * Core.camera.zoom, -Core.camera.viewportHeight * Core.camera.zoom); Core.camera.viewportWidth * Core.camera.zoom, -Core.camera.viewportHeight * Core.camera.zoom);
Graphics.end(); Graphics.end();
Graphics.shader(); Graphics.shader();
renderer.blocks.floor.beginDraw(); renderer.blocks.floor.beginDraw();*/
} }
} }

View File

@@ -24,6 +24,7 @@ import java.util.Arrays;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
//TODO point shader mesh
public class FloorRenderer{ public class FloorRenderer{
private final static int chunksize = 64; private final static int chunksize = 64;