Skip to content
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "v0.1.19[1.7.10]"
version = "v0.1.19.3[1.7.10]"
group= "stellarium" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Stellar Sky"

Expand Down
Binary file added libs/SciAPI v0.5.2.jar
Binary file not shown.
17 changes: 9 additions & 8 deletions src/main/java/stellarium/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,33 @@ public void setupConfig(Configuration config, String category) {
config.setCategoryLanguageKey(category, "config.category.client");
config.setCategoryRequiresMcRestart(category, false);

mag_Limit=config.get(category, "Mag_Limit", 5.0);
mag_Limit=config.get(category, "Mag_Limit", 6.5);
mag_Limit.comment="Limit of magnitude can be seen on naked eye.\n" +
"If you want to increase FPS, you can set this property a bit little (e.g. 0.3)\n" +
"If you want to increase FPS, you can set this property a bit lower (e.g. 0.3)\n" +
"and FPS will be exponentially improved";
mag_Limit.setRequiresMcRestart(false);
mag_Limit.setLanguageKey("config.property.client.maglimit");

turb=config.get(category, "Twinkling(Turbulance)", 0.7);
turb=config.get(category, "Twinkling(Turbulance)", 4.0);
turb.comment="Degree of the twinkling effect of star.\n"
+ "It determines the turbulance of atmosphere, which actually cause the twinkling effect";
+ "It determines the turbulance of atmosphere, which actually cause the twinkling effect. "
+ "The greater the value, the more the stars will twinkle. Default is 4.0. To disable set to 0.0";
turb.setRequiresMcRestart(false);
turb.setLanguageKey("config.property.client.turbulance");

moon_Frac=config.get(category, "Moon_Fragments_Number", 16);
moon_Frac.comment="Moon is drawn with fragments\n" +
"Less fragments will increase FPS, but the moon become more defective";
"Less fragments will increase FPS, but the moon will become more defective";
moon_Frac.setRequiresMcRestart(false);
moon_Frac.setLanguageKey("config.property.client.moonfrac");

minuteLength = config.get(category, "Minute_Length", 20.0);
minuteLength.comment = "Length of minute in tick. (The minute & hour is displayed on HUD as HH:MM format)";
minuteLength = config.get(category, "Minute_Length", 16.666);
minuteLength.comment = "Number of ticks in a minute. (The minute & hour is displayed on HUD as HH:MM format)";
minuteLength.setRequiresMcRestart(false);
minuteLength.setLanguageKey("config.property.client.minutelength");

hourToMinute = config.get(category, "Hour_Length", 60);
hourToMinute.comment = "Length of hour in minute. (The minute & hour is displayed on HUD as HH:MM format)";
hourToMinute.comment = "Number of minutes in an hour. (The minute & hour is displayed on HUD as HH:MM format)";
hourToMinute.setRequiresMcRestart(false);
hourToMinute.setLanguageKey("config.property.client.hourlength");

Expand Down
28 changes: 14 additions & 14 deletions src/main/java/stellarium/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public void setupConfigManager(File file) {
Property yearOffset;
Property dayOffset;
Property tickOffset;
Property lattitudeOverworld;
Property latitudeOverworld;
Property longitudeOverworld;
Property lattitudeEnder;
Property latitudeEnder;
Property longitudeEnder;
Property moonSize;
Property moonBrightness;
Expand Down Expand Up @@ -110,23 +110,23 @@ public void setupConfig(Configuration config, String category) {
tickOffset.setLanguageKey("config.property.server.tickoffset");
propNameList.add(tickOffset.getName());

lattitudeOverworld = config.get(category, "Lattitude_Overworld", 37.5);
lattitudeOverworld.comment = "Lattitude on Overworld, in Degrees.";
lattitudeOverworld.setRequiresMcRestart(true);
lattitudeOverworld.setLanguageKey("config.property.server.lattitudeoverworld");
propNameList.add(lattitudeOverworld.getName());
latitudeOverworld = config.get(category, "Latitude_Overworld", 37.5);
latitudeOverworld.comment = "Latitude on Overworld, in Degrees.";
latitudeOverworld.setRequiresMcRestart(true);
latitudeOverworld.setLanguageKey("config.property.server.latitudeoverworld");
propNameList.add(latitudeOverworld.getName());

longitudeOverworld = config.get(category, "Longitude_Overworld", 0.0);
longitudeOverworld.comment = "Longitude on Overworld, in Degrees. (East is +)";
longitudeOverworld.setRequiresMcRestart(true);
longitudeOverworld.setLanguageKey("config.property.server.longitudeoverworld");
propNameList.add(longitudeOverworld.getName());

lattitudeEnder = config.get(category, "Lattitude_Ender", -52.5);
lattitudeEnder.comment = "Lattitude on Ender, in Degrees.";
lattitudeEnder.setRequiresMcRestart(true);
lattitudeEnder.setLanguageKey("config.property.server.lattitudeender");
propNameList.add(lattitudeEnder.getName());
latitudeEnder = config.get(category, "Latitude_Ender", -52.5);
latitudeEnder.comment = "Latitude on Ender, in Degrees.";
latitudeEnder.setRequiresMcRestart(true);
latitudeEnder.setLanguageKey("config.property.server.latitudeender");
propNameList.add(latitudeEnder.getName());

longitudeEnder = config.get(category, "Longitude_Ender", 180.0);
longitudeEnder.comment = "Longitude on Ender, in Degrees. (East is +)";
Expand Down Expand Up @@ -156,9 +156,9 @@ public void loadFromConfig(Configuration config, String category) {
manager.yearOffset = yearOffset.getInt();
manager.dayOffset = dayOffset.getInt();
manager.tickOffset = tickOffset.getDouble();
manager.lattitudeOverworld = lattitudeOverworld.getDouble();
manager.latitudeOverworld = latitudeOverworld.getDouble();
manager.longitudeOverworld = longitudeOverworld.getDouble();
manager.lattitudeEnder = lattitudeEnder.getDouble();
manager.latitudeEnder = latitudeEnder.getDouble();
manager.longitudeEnder = longitudeEnder.getDouble();
manager.moonSizeMultiplier = moonSize.getDouble();
manager.moonBrightnessMultiplier = moonBrightness.getDouble();
Expand Down
42 changes: 23 additions & 19 deletions src/main/java/stellarium/DrawSky.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
import net.minecraftforge.client.*;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraftforge.client.IRenderHandler;

import org.lwjgl.opengl.*;
import org.lwjgl.opengl.GL11;

import sciapi.api.value.IValRef;
import sciapi.api.value.euclidian.CrossUtil;
import sciapi.api.value.euclidian.EVector;
import sciapi.api.value.euclidian.IEVector;
import sciapi.api.value.numerics.DFloatSet;
import sciapi.api.value.util.VOp;
import stellarium.stellars.*;
import stellarium.stellars.Color;
import stellarium.stellars.ExtinctionRefraction;
import stellarium.stellars.Optics;
import stellarium.stellars.StellarObj;
import stellarium.stellars.background.BrStar;
import stellarium.util.math.Spmath;
import stellarium.util.math.Transforms;
import stellarium.util.math.VecMath;
import stellarium.world.StellarWorldProvider;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

Expand Down Expand Up @@ -199,7 +205,6 @@ else if (mc.theWorld.provider.isSurfaceWorld())

float bglight=f1+f2+f3;


GL11.glTranslatef(f7, f8, f9); //e,z,s
GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); //e,n,z

Expand Down Expand Up @@ -295,8 +300,8 @@ else if (mc.theWorld.provider.isSurfaceWorld())
difm.set(VecMath.mult(sizem, difm));
difm2.set(VecMath.mult(sizem, difm2));

float alpha=Optics.getAlphaFromMagnitude(-17.0-StellarSky.getManager().Moon.mag-2.5*Math.log10(difactor),bglight);

float alpha=(float) (Optics.getAlphaFromMagnitude(-17.0-StellarSky.getManager().Moon.mag-2.5*Math.log10(difactor),bglight) / (StellarSky.getManager().Moon.getPhase()));
GL11.glColor4d(1.0, 1.0, 1.0, f4*alpha);

tessellator1.startDrawingQuads();
Expand All @@ -321,11 +326,12 @@ else if (mc.theWorld.provider.isSurfaceWorld())
double longdd=(double)longcd/(double)longn;
double latdd=1.0-(double)(latc+1)/(double)latn;

tessellator1.setColorRGBA_F(1.0f, 1.0f, 1.0f, (f4*moonilum[longc][latc]-0.15f*bglight)*2.0f);
float lightlevel = (0.875f*(bglight/2.1333334f));
tessellator1.setColorRGBA_F(1.0f - lightlevel, 1.0f - lightlevel, 1.0f - lightlevel, ((f4*moonilum[longc][latc]-0.015f*bglight)*2.0f));
tessellator1.addVertexWithUV(VecMath.getX(moonvec[longc][latc]), VecMath.getY(moonvec[longc][latc]), VecMath.getZ(moonvec[longc][latc]), Spmath.fmod(longd+0.5, 1.0), latd);
tessellator1.addVertexWithUV(VecMath.getX(moonvec[longcd][latc]), VecMath.getY(moonvec[longcd][latc]), VecMath.getZ(moonvec[longcd][latc]), Spmath.fmod(longdd+0.5,1.0), latd);
tessellator1.addVertexWithUV(VecMath.getX(moonvec[longcd][latc]), VecMath.getY(moonvec[longcd][latc]), VecMath.getZ(moonvec[longcd][latc]), Spmath.fmod(longdd+0.5, 1.0), latd);
tessellator1.addVertexWithUV(VecMath.getX(moonvec[longcd][latc+1]), VecMath.getY(moonvec[longcd][latc+1]), VecMath.getZ(moonvec[longcd][latc+1]), Spmath.fmod(longdd+0.5, 1.0), latdd);
tessellator1.addVertexWithUV(VecMath.getX(moonvec[longc][latc+1]), VecMath.getY(moonvec[longc][latc+1]), VecMath.getZ(moonvec[longc][latc+1]), Spmath.fmod(longd+0.5,1.0), latdd);
tessellator1.addVertexWithUV(VecMath.getX(moonvec[longc][latc+1]), VecMath.getY(moonvec[longc][latc+1]), VecMath.getZ(moonvec[longc][latc+1]), Spmath.fmod(longd+0.5, 1.0), latdd);
}
}

Expand All @@ -338,7 +344,7 @@ else if (mc.theWorld.provider.isSurfaceWorld())
}

GL11.glDisable(GL11.GL_TEXTURE_2D);
float f18 = world.getStarBrightness(par1) * f4;
float f18 = world.getStarBrightness(par1);


GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Expand All @@ -350,6 +356,7 @@ else if (mc.theWorld.provider.isSurfaceWorld())
GL11.glColor3f(0.0F, 0.0F, 0.0F);
double d0 = mc.thePlayer.getPosition(par1).yCoord - world.getHorizon();


if (d0 < 0.0D)
{
f8 = 1.0F;
Expand Down Expand Up @@ -423,13 +430,10 @@ public void renderStar(float bglight, float weathereff, double time){
if(Mag > StellarSky.getManager().mag_Limit)
continue;

// float Turb = StellarSky.getManager().turb *(float) random.nextGaussian();
// Mag+=Turb;

if(VecMath.getZ(pos)<0) continue;

float size=0.5f;
float alpha=Optics.getAlphaFromMagnitudeSparkling(Mag, bglight);
float alpha=Optics.getAlphaFromMagnitudeSparkling(Mag, bglight) - (((1-weathereff)/1)*20f);

dif.set(CrossUtil.cross(pos, new EVector(0.0,0.0,1.0)));
if(Spmath.getD(VecMath.size2(dif)) < 0.01)
Expand All @@ -443,7 +447,7 @@ public void renderStar(float bglight, float weathereff, double time){

Color c=Color.getColor(B_V);

tessellator1.setColorRGBA(c.r, c.g, c.b, (int)(weathereff*alpha*255.0));
tessellator1.setColorRGBA(c.r, c.g, c.b, (int)(alpha*255.0));
tessellator1.addVertexWithUV(VecMath.getX(pos)+VecMath.getX(dif), VecMath.getY(pos)+VecMath.getY(dif), VecMath.getZ(pos)+VecMath.getZ(dif),0.0,0.0);
tessellator1.addVertexWithUV(VecMath.getX(pos)+VecMath.getX(dif2), VecMath.getY(pos)+VecMath.getY(dif2), VecMath.getZ(pos)+VecMath.getZ(dif2),1.0,0.0);
tessellator1.addVertexWithUV(VecMath.getX(pos)-VecMath.getX(dif), VecMath.getY(pos)-VecMath.getY(dif), VecMath.getZ(pos)-VecMath.getZ(dif),1.0,1.0);
Expand Down Expand Up @@ -471,7 +475,7 @@ public void drawStellarObj(float bglight, float weathereff, EVector pos, double
if(VecMath.getZ(pos)<0) return;

float size=0.6f;
float alpha=Optics.getAlphaFromMagnitude(Mag, bglight);
float alpha=Optics.getAlphaFromMagnitude(Mag, bglight) - (((1-weathereff)/1)*20f);

pos.set(VecMath.normalize(pos));

Expand All @@ -487,7 +491,7 @@ public void drawStellarObj(float bglight, float weathereff, EVector pos, double

tessellator1.startDrawingQuads();

tessellator1.setColorRGBA_F(1.0f, 1.0f, 1.0f, weathereff*alpha);
tessellator1.setColorRGBA_F(1.0f, 1.0f, 1.0f, alpha);

tessellator1.addVertexWithUV(VecMath.getX(pos)+VecMath.getX(difm), VecMath.getY(pos)+VecMath.getY(difm), VecMath.getZ(pos)+VecMath.getZ(difm),0.0,0.0);
tessellator1.addVertexWithUV(VecMath.getX(pos)+VecMath.getX(difm2), VecMath.getY(pos)+VecMath.getY(difm2), VecMath.getZ(pos)+VecMath.getZ(difm2),1.0,0.0);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/stellarium/StellarClientHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void renderGameOverlay(RenderGameOverlayEvent.Post event) {

double currentTick = Minecraft.getMinecraft().theWorld.getWorldTime();
double time = StellarSky.getManager().getSkyTime(currentTick);
double date = currentTick / StellarSky.getManager().day + StellarSky.getManager().lattitudeOverworld / 180.0;
double date = currentTick / StellarSky.getManager().day + StellarSky.getManager().latitudeOverworld / 180.0;
double year = date / StellarSky.getManager().year;

int yr = (int)Math.floor(year);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/stellarium/StellarSky.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class StellarSky {

public static final String modid = "stellarsky";
public static final String name = "Stellar Sky";
public static final String version = "0.1.19";
public static final String version = "0.1.19.3";

// The instance of Stellarium
@Instance(StellarSky.modid)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/stellarium/config/EnumViewMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public enum EnumViewMode {

EnumViewMode(String name, boolean showOnHUD, boolean showTick) {
this.name = name;
this.showOnHUD = showOnHUD;
this.showTick = showTick;
}

public String getName() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/stellarium/sleepwake/LightWakeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void loadFromConfig(Configuration config, String category) {
}

private double wakeHourAngle() {
double radLatitude = Spmath.Radians(StellarSky.getManager().lattitudeOverworld);
double radLatitude = Spmath.Radians(StellarSky.getManager().latitudeOverworld);

IValRef pvec=(IValRef)VecMath.mult(-1.0, StellarSky.getManager().Earth.EcRPos);
pvec = Transforms.ZTEctoNEc.transform(pvec);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/stellarium/stellars/Moon.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public IValRef<EVector> getPosition(){
}

//Ecliptic Position of Moon's Local Region from Moon Center (Update Needed)
public synchronized IValRef<EVector> posLocalM(double longitude, double lattitude, double yr){
public synchronized IValRef<EVector> posLocalM(double longitude, double latitude, double yr){
float longp=(float)Spmath.Radians(longitude+mean_mot*yr);
float lat=(float)Spmath.Radians(lattitude);
float lat=(float)Spmath.Radians(latitude);
return VecMath.mult((IValRef)radius, VecMath.add(VecMath.add(VecMath.mult(Spmath.sinf(lat), Pole), VecMath.mult(Spmath.cosf(lat)*Spmath.cosf(longp), PrMer0)), VecMath.mult(Spmath.cosf(lat)*Spmath.sinf(longp), East)));
}

Expand All @@ -120,7 +120,7 @@ public double illumination(EVector p){

//Phase of the Moon(Update Needed)
public double getPhase(){
return (Math.PI-Math.acos(Spmath.getD(BOp.div(VecMath.dot(EcRPos, EcRPosG), BOp.mult(VecMath.size(EcRPos), VecMath.size(EcRPosG))))))/Math.PI;
return 1-(Math.PI-Math.acos(Spmath.getD(BOp.div(VecMath.dot(EcRPos, EcRPosG), BOp.mult(VecMath.size(EcRPos), VecMath.size(EcRPosG))))))/Math.PI;
}

//Time phase for moon
Expand Down
26 changes: 12 additions & 14 deletions src/main/java/stellarium/stellars/Optics.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
public class Optics implements IConfigHandler {

// MagOffset needs to be changed to whatever the maximum Magnitude of Venus is
private static final float magOffset = 5.0f;
private static final float magCompressionBase = 6.5f;
private static final float magOffset = 5.50f;
private static final float magCompressionBase = 6.50f;

private Property brightnessContrastProperty;

//BrightnessContrast needs to be added to the user config and set to StellarSky.getManager().brightnesscontrast
private double brightnessContrast = 1.5;
private double brightnessContrast = 2.0;
private float magCompression;
private float magContrast;

Expand All @@ -26,11 +26,11 @@ public class Optics implements IConfigHandler {

@Override
public void setupConfig(Configuration config, String category) {
brightnessContrastProperty = config.get(category, "Brightness_Contrast", 1.75);
brightnessContrastProperty.comment = "Brightness Contrast determines the contrast"
+ "between bright stars and faint stars."
+ "The bigger the value, the less difference between bright stars and faint stars."
+ "For real world, 1.0 is right. Though default value is 1.75 for visual effect.";
brightnessContrastProperty = config.get(category, "Brightness_Contrast", 2.0);
brightnessContrastProperty.comment = "Brightness Contrast determines the contrast "
+ "between bright stars and faint stars. "
+ "The bigger the value, the less difference between bright stars and faint stars. "
+ "Real world (minimum) = 1.0. Default = 2.0 for visual effect.";
brightnessContrastProperty.setRequiresMcRestart(false);
brightnessContrastProperty.setLanguageKey("config.property.client.brcontrast");
}
Expand All @@ -43,20 +43,18 @@ public void loadFromConfig(Configuration config, String category) {
}

public static float getAlphaFromMagnitudeSparkling(float Mag, float bglight){
double turb = StellarSky.getManager().turb * randomTurbulance.nextGaussian();
return getAlpha(Mag * instance.magCompression + turb * instance.brightnessContrast, bglight);
double turb = randomTurbulance.nextGaussian() * ((StellarSky.getManager().turb) / (Mag + 4.46f));
return getAlpha(((Mag + 1.46f) * instance.magCompression) + turb, bglight);
}

public static float getAlphaFromMagnitude(double Mag, float bglight) {
return getAlpha(Mag * instance.magCompression, bglight);
return getAlpha(Mag, bglight);
}

public static final double constantBgDiv = Math.log(2.1333334f + 1.0f);

private static float getAlpha(double magCompressed, float bglight) {
return (float) ((Math.pow(instance.magContrast,
- magCompressed - magOffset * ((Math.pow(Math.log(bglight + 1.0f)/constantBgDiv, magOffset)))))
- (bglight / 2.1333334f));
return (float) ((Math.pow(instance.magContrast, - magCompressed - magOffset * ((Math.pow(Math.log(bglight + 1.0f)/constantBgDiv, magOffset))))) - (bglight / 2.1333334f));
}

}
8 changes: 4 additions & 4 deletions src/main/java/stellarium/stellars/Planet.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ public IValRef<EVector> getEcRPos(double yr) {
}

//Ecliptic Position of Planet's Local Region from Moon Center (Update Needed)
public IValRef<EVector> posLocalP(double longitude, double lattitude, double time){
public IValRef<EVector> posLocalP(double longitude, double latitude, double time){
double longp=Spmath.Radians(longitude+rot*time);
double lat=Spmath.Radians(lattitude);
double lat=Spmath.Radians(latitude);
return VOp.mult(radius, BOp.add(BOp.add(VecMath.mult(Math.sin(lat), pole), VecMath.mult(Math.cos(lat)*Math.cos(longp), prMer0)), VecMath.mult(Math.cos(lat)*Math.sin(longp), east)));
}

//Ecliptic Position of Planet's Local Region from Earth (Update Needed)
public IValRef<EVector> posLocalE(double longitude, double lattitude, double time){
return VecMath.add(EcRPosE, posLocalP(longitude, lattitude, time));
public IValRef<EVector> posLocalE(double longitude, double latitude, double time){
return VecMath.add(EcRPosE, posLocalP(longitude, latitude, time));
}

//Update magnitude
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/stellarium/stellars/StellarManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class StellarManager {
public double day, year;
public int yearOffset, dayOffset;
public double tickOffset;
public double lattitudeOverworld, lattitudeEnder;
public double latitudeOverworld, latitudeEnder;
public double longitudeOverworld, longitudeEnder;
public double moonSizeMultiplier, moonBrightnessMultiplier;

Expand Down
Loading