This commit is contained in:
Anuken
2020-04-02 14:56:53 -04:00
parent a26cd46a7e
commit d0b2f63553
5 changed files with 14 additions and 13 deletions

View File

@@ -11,13 +11,13 @@ uniform vec3 u_ambientColor;
varying vec4 v_col; varying vec4 v_col;
const vec3 diffuse = vec3(0); const vec3 diffuse = vec3(0);
const float shinefalloff = 4.0;
const float shinelen = 0.2;
void main(){ void main(){
vec3 norc = u_ambientColor * (diffuse + vec3(clamp((dot(a_normal, u_lightdir) + 1.0) / 2.0, 0.0, 1.0))); vec3 norc = u_ambientColor * (diffuse + vec3(clamp((dot(a_normal, u_lightdir) + 1.0) / 2.0, 0.0, 1.0)));
float falloff = 4.0;
float shinelen = 0.2;
float shinedot = max((-dot(u_camdir, a_normal) - (1.0 - shinelen)) / shinelen, 0.0); float shinedot = max((-dot(u_camdir, a_normal) - (1.0 - shinelen)) / shinelen, 0.0);
float shinyness = (1.0 - a_color.a) * pow(shinedot, falloff); float shinyness = (1.0 - a_color.a) * pow(shinedot, shinefalloff);
vec4 baseCol = vec4(a_color.rgb, 1.0); vec4 baseCol = vec4(a_color.rgb, 1.0);
v_col = lerp(baseCol * vec4(norc, 1.0), vec4(1.0), shinyness * norc.r); v_col = lerp(baseCol * vec4(norc, 1.0), vec4(1.0), shinyness * norc.r);

View File

@@ -215,7 +215,7 @@ public class TODOPlanetGenerator extends PlanetGenerator{
FloatArray frequencies = new FloatArray(); FloatArray frequencies = new FloatArray();
for(int i = 0; i < ores.size; i++){ for(int i = 0; i < ores.size; i++){
frequencies.add(rand.random(-0.08f, 0.02f)); frequencies.add(rand.random(-0.09f, 0.01f));
} }
pass((x, y) -> { pass((x, y) -> {
@@ -225,7 +225,7 @@ public class TODOPlanetGenerator extends PlanetGenerator{
for(int i = ores.size - 1; i >= 0; i--){ for(int i = ores.size - 1; i >= 0; i--){
Block entry = ores.get(i); Block entry = ores.get(i);
float freq = frequencies.get(i); float freq = frequencies.get(i);
if(Math.abs(0.5f - noise(offsetX, offsetY + i*999, 2, 0.7, (40 + i * 2))) > 0.26f && if(Math.abs(0.5f - noise(offsetX, offsetY + i*999, 2, 0.7, (40 + i * 2))) > 0.25f &&
Math.abs(0.5f - noise(offsetX, offsetY - i*999, 1, 1, (30 + i * 4))) > 0.37f + freq){ Math.abs(0.5f - noise(offsetX, offsetY - i*999, 1, 1, (30 + i * 4))) > 0.37f + freq){
ore = entry; ore = entry;
break; break;

View File

@@ -101,7 +101,7 @@ public class Sector{
return new SectorRect(radius, center, planeTop, planeRight, angle); return new SectorRect(radius, center, planeTop, planeRight, angle);
} }
public boolean hasAttribute(SectorAttribute attribute){ public boolean is(SectorAttribute attribute){
return (data.attributes & (1 << attribute.ordinal())) != 0; return (data.attributes & (1 << attribute.ordinal())) != 0;
} }

View File

@@ -198,7 +198,7 @@ public class PlanetDialog extends FloatingDialog{
setPlane(hovered); setPlane(hovered);
Draw.color(Color.white, Pal.accent, Mathf.absin(5f, 1f)); Draw.color(Color.white, Pal.accent, Mathf.absin(5f, 1f));
TextureRegion icon = hovered.locked() ? Icon.lock.getRegion() : hovered.hasAttribute(SectorAttribute.naval) ? Liquids.water.icon(Cicon.large) : null; TextureRegion icon = hovered.locked() ? Icon.lock.getRegion() : hovered.is(SectorAttribute.naval) ? Liquids.water.icon(Cicon.large) : null;
if(icon != null){ if(icon != null){
Draw.rect(icon, 0, 0); Draw.rect(icon, 0, 0);
@@ -349,17 +349,18 @@ public class PlanetDialog extends FloatingDialog{
if(++idx % max == 0) t.row(); if(++idx % max == 0) t.row();
} }
for(int i = 0; i < Math.min(selected.data.floorCounts.length, 3); i++){ //TODO terrain isn't relevant
t.addImage(selected.data.floors[i].icon(Cicon.small)).padRight(3); //for(int i = 0; i < Math.min(selected.data.floorCounts.length, 3); i++){
if(++idx % max == 0) t.row(); // t.addImage(selected.data.floors[i].icon(Cicon.small)).padRight(3);
} // if(++idx % max == 0) t.row();
//}
}).fillX().row(); }).fillX().row();
stable.row(); stable.row();
stable.addButton("Launch", () -> { stable.addButton("Launch", () -> {
if(selected != null){ if(selected != null){
if(selected.hasAttribute(SectorAttribute.naval)){ if(selected.is(SectorAttribute.naval)){
ui.showInfo("You need a naval loadout to launch here."); ui.showInfo("You need a naval loadout to launch here.");
return; return;
} }

View File

@@ -1,3 +1,3 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=da2913187aa724da769c6a80bc709eebb5bc0888 archash=83917377f451543c8d747e8cf35a5e09b8bad2b8