...
 
Commits (511)
......@@ -510,9 +510,12 @@
**Fixed bugs:**
<<<<<<< HEAD
=======
- Fix position discrepancy of stars in stereo mode \(points vs billboards\) [\#258](https://github.com/langurmonkey/gaiasky/issues/258)
- Screenshot and frame mode switch from simple to advanced produces null pointer [\#257](https://github.com/langurmonkey/gaiasky/issues/257)
- Refactor time [\#256](https://github.com/langurmonkey/gaiasky/issues/256)
>>>>>>> lwjgl3
- Streaming catalog loader never attempts previously discarded pages [\#241](https://github.com/langurmonkey/gaiasky/issues/241)
- Fix returning from panorama mode through stereo mode [\#238](https://github.com/langurmonkey/gaiasky/issues/238)
- Add object scaling to scripting API [\#227](https://github.com/langurmonkey/gaiasky/issues/227)
......@@ -536,9 +539,12 @@
**Closed issues:**
<<<<<<< HEAD
=======
- Is this update also coming? [\#261](https://github.com/langurmonkey/gaiasky/issues/261)
- Enable particle effects [\#254](https://github.com/langurmonkey/gaiasky/issues/254)
- Add-ons [\#250](https://github.com/langurmonkey/gaiasky/issues/250)
>>>>>>> lwjgl3
- Crash with TGAS GPU dataset [\#236](https://github.com/langurmonkey/gaiasky/issues/236)
- Preferences window shows wrong version number [\#234](https://github.com/langurmonkey/gaiasky/issues/234)
- Cannot build desktop:dist [\#233](https://github.com/langurmonkey/gaiasky/issues/233)
......
This diff is collapsed.
This diff is collapsed.
octree/
catalog/
tgas_*/
gdr2hip/
meshes/dr2/
kepler-exoplanets.csv
countries.csv
meshes-dr2.json
kepler-exoplanets.csv
countries.csv
meshes-dr2.json
gaiasky-data.json
{
"name" : "DR2 - 20%/0.5% (win)",
"description" : "Gaia DR2 (20% / 0.5% error). 7.5M stars.",
"data" : [
{
"loader": "gaia.cu9.ari.gaiaorbit.data.group.OctreeGroupLoader",
"files": [ "D:/Gaia/data/GDR2/dr2int6/out/52-mag-100000-0.2-0.005/particles/", "D:/Gaia/data/GDR2/dr2int6/out/52-mag-100000-0.2-0.005/metadata.bin" ]
}
]}
{
"name" : "TGAS+HYG (GPU)",
"description" : "Gaia DR1 TGAS catalog, GPU version. About 1.5 million stars.",
"data" : [
{
"loader": "gaia.cu9.ari.gaiaorbit.data.JsonLoader",
"files": [ "data/particles-tgas.json" ]
}
]}
\ No newline at end of file
# Dummy version file
# It is used for running the app during development
buildtime=01/12/2050 10:00 AM
build=0cbf381
builder=tsagrista
version=Development-vr
system=Linux linteum 3.8.0-33-generic Ubuntu Oct 23 09:16:58 UTC 2013 x86_64 GNU/Linux
This diff is collapsed.
This diff is collapsed.
#X Y Z
-0.10565816 0.06518645 0.19980872
0.19917662 -8.263368E-5 -0.011495531
0.09219582 0.020462701 -0.027474076
0.076021895 -0.002412905 -0.19194633
-0.17060989 0.040226225 -0.045016617
0.022066126 0.011490575 -0.3484097
-0.058466416 0.05320036 -0.10133502
0.1616083 -0.08241023 -0.356325
0.13432476 0.038188543 0.07130456
0.19578469 -0.021206746 0.1392554
0.07584491 -0.021823853 0.15568072
-0.036784034 0.05000581 0.38099778
0.00781688 0.054530602 -0.07253161
1.0844934 0.06613745 0.7483497
1.5871736 -0.039834246 0.22244132
1.2039416 0.006874001 -1.7309673
0.19398609 -0.047878444 0.63225365
1.7345868 -0.058673214 -0.268781
1.7080067 0.0068285526 -0.76869375
0.9190818 0.043433867 0.7187761
1.4478648 -0.087340325 0.44784674
0.46172112 -0.04971786 0.830955
1.5400147 -0.065716594 0.22868836
0.13619499 0.058464274 0.70646584
0.38405007 -0.029898256 0.9056766
1.2384328 0.04785854 0.62449366
0.69378877 0.053213403 1.0298204
1.7067602 -0.006579097 -0.7400002
1.5574623 -0.0030088576 -1.1348176
1.7277092 -0.041750696 -0.3411556
0.5879685 0.1295065 0.87626714
1.6246439 0.04303494 -0.1334297
0.31839424 -0.07913414 0.72457016
1.595921 -0.05325707 0.098951936
0.98648655 0.0034291164 0.8286448
-0.097038716 -0.083581686 0.671231
1.5724081 -0.045706593 -1.1533186
1.0723336 -0.0023225143 0.66042084
1.3381681 0.14635156 0.5463112
1.2587551 0.0091697555 0.72891146
0.20746097 0.022108912 0.76228964
1.7921798 -0.021635879 -0.4820994
1.4799329 0.045490015 0.24500978
0.5547415 0.05768782 0.88005596
0.11692488 -0.06365575 0.5066473
1.3893882 -0.056018513 0.55726653
0.46656722 0.040706143 0.9047468
0.08281593 -0.06794716 0.84103805
1.328226 -0.029337166 0.5182821
1.7541178 -0.040006667 -0.30478722
0.66962194 -0.008107803 0.2011191
-0.035922706 0.0012589507 -1.4831281
0.90488917 0.078157894 -0.42311043
0.540481 0.070021056 0.337932
-0.9688797 0.021467455 -1.7187457
0.4590742 0.025481172 0.6492746
-1.2088842 0.102314144 -1.6845126
0.013964355 -0.022427786 -1.5045881
0.75072765 -0.0035242843 -0.29910856
0.6040091 0.056327567 -0.028585285
0.68151164 -0.06807146 0.26366642
0.42381752 0.023165066 -1.2423337
-0.17565781 0.06564798 -1.5391085
0.78691983 0.011844264 0.05783096
0.23727393 0.121440604 -1.4467692
0.86547554 0.013483076 -0.4650786
0.30561954 -0.02048209 0.3698281
0.9220699 0.10535915 -0.08579677
-0.033592105 0.06695285 -1.5210862
0.21437925 0.0035076854 -1.371566
-0.017750569 -0.010833822 0.53124905
-0.5084636 0.08129511 -1.7049849
0.5002129 0.0231408 0.17683864
0.80147755 -0.0089070415 0.034468174
-0.20629543 0.009701457 -1.5212638
0.67438024 -0.1065848 0.16694987
0.3139929 0.06898313 0.22805819
0.6314987 -0.03045897 -0.99693865
-0.9846717 -0.025990497 -1.6870644
-0.94154936 -0.04796191 -1.7120445
-0.4788044 -0.074997514 -1.6768155
-0.27972335 -0.03901392 -1.6273906
-0.96193767 0.02311684 -1.7551422
-0.14846134 -0.08983239 -1.509058
-1.0816438 -0.03314751 -1.6785505
-0.9262353 -0.015585862 -1.7688329
-0.3803187 0.03762728 -1.6758318
-1.4823757 -0.003984958 -0.39961135
-1.3744736 -0.06234191 1.6055205
0.0922828 -0.0034356855 -0.61993873
-0.9556172 -0.099593714 -0.79046696
-1.6149417 -0.008769959 0.1996041
-0.029904699 -0.011140865 -0.6529546
-1.0777913 -0.018703174 -0.7886716
-0.07475016 0.012839752 -0.7255467
-1.6184564 0.0056976182 0.7358615
-0.4528791 0.006768165 -0.9713272
-0.37351763 -0.025494967 -0.79327637
-1.1952689 -0.03654176 -0.69429076
-0.50047994 0.058804434 -0.98821175
-0.49371243 -0.08383548 -0.90723145
-0.20062712 0.021841228 -0.77313864
-1.3544043 -0.019505206 1.5818348
-0.587295 0.003972075 -0.94909334
-1.2679756 0.035098393 -0.6853555
-1.6517668 -0.07326053 0.09991479
-0.28476351 -0.06619609 -0.9477868
-0.2637544 0.010851266 -0.81756103
-0.6289956 0.09515956 -0.84708965
-0.36777875 -0.0156149715 -0.7730684
-0.17555678 -0.0026128602 -0.77071583
-1.66167 -0.041447498 0.21175915
-0.17674427 0.053137287 -0.6822326
-1.4601785 0.05662845 1.3902073
-1.7006384 -0.05007264 0.9301575
-0.9778318 -0.011553057 -0.81490564
-1.2065336 -0.04766565 -0.67216885
-0.7118116 -0.0053045927 -0.8822245
-1.7104523 -0.021239484 0.61350614
-0.43532267 -0.04185646 -0.82777584
-1.1525649 0.003488687 1.759022
-0.45798486 0.014396966 -0.8725555
-1.7801641 -0.034009703 0.3820414
-1.3971821 -0.09940337 -0.4838604
0.8717711 0.033797815 1.7090695
-0.51655954 0.018966712 -0.32792526
-0.6524285 0.038808506 -0.23233962
-0.49576885 -0.00785228 -0.33009177
-0.85897565 0.13334313 0.5016164
-0.8243612 -0.08729837 0.572336
-0.7165561 0.016521186 0.07156998
1.0627869 -0.08181008 1.6855876
-0.4974104 0.0015350505 -0.34935108
-0.1491981 0.020221353 -0.3325873
-0.6757562 0.021545794 -0.08097255
-0.07284123 0.022085667 -0.20958771
-0.4771613 -0.0019167576 -0.40567034
0.40574878 -0.065677136 1.7540951
-0.1293098 -0.06496168 -0.53750473
-0.9599185 0.021275057 0.49759895
-0.10279118 -0.07160435 -0.53986406
-0.72779614 -0.012135939 0.41076124
-0.65200955 -0.03654397 0.043649107
-0.8955326 0.042409856 0.39898038
0.55456436 -0.047060452 1.6641014
-0.043316334 -0.01212638 -0.44351822
-0.6617288 0.05519665 -0.09949744
-0.20493028 -0.05019484 1.4367177
-0.636607 -0.0031957887 0.683001
0.102323055 -0.029918969 1.5373743
-0.6669971 -0.03427368 -0.33136046
-0.4054204 0.070759885 -0.28749794
-0.8190367 0.100384615 -0.06549826
-0.26589048 0.057427965 1.326823
-0.6852524 -0.021934992 0.707249
-0.18463665 0.024531515 -0.49827713
-0.30618322 -0.016488228 1.3639672
-0.33083826 -0.066452436 1.167593
-0.4099728 -0.0023619356 -0.34095892
-0.8538648 0.052928604 0.36202043
0.8964567 0.12054319 1.778372
This diff is collapsed.
This diff is collapsed.
assets/img/crosshair-green-arrow.png

2.97 KB | W: | H:

assets/img/crosshair-green-arrow.png

561 Bytes | W: | H:

assets/img/crosshair-green-arrow.png
assets/img/crosshair-green-arrow.png
assets/img/crosshair-green-arrow.png
assets/img/crosshair-green-arrow.png
  • 2-up
  • Swipe
  • Onion skin
assets/img/crosshair-green.png

6.4 KB | W: | H:

assets/img/crosshair-green.png

6.39 KB | W: | H:

assets/img/crosshair-green.png
assets/img/crosshair-green.png
assets/img/crosshair-green.png
assets/img/crosshair-green.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
# Test script. Tests brightness and contrast commands.
# Created by Toni Sagrista
from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface
gs = EventScriptingInterface.instance()
gs.disableInput()
gs.cameraStop()
print("Testing brightness")
gs.setBrightnessLevel(-1.0)
gs.sleep(1)
gs.setBrightnessLevel(-0.5)
gs.sleep(1)
gs.setBrightnessLevel(-0.0)
gs.sleep(1)
gs.setBrightnessLevel(0.5)
gs.sleep(1)
gs.setBrightnessLevel(1.0)
gs.sleep(1)
gs.setBrightnessLevel(0.0)
gs.sleep(1)
print("Testing contrast")
gs.setContrastLevel(0.0)
gs.sleep(1)
gs.setContrastLevel(0.5)
gs.sleep(1)
gs.setContrastLevel(1.0)
gs.sleep(1)
gs.setContrastLevel(1.5)
gs.sleep(1)
gs.setContrastLevel(2.0)
gs.sleep(1)
gs.setContrastLevel(1.0)
gs.sleep(10)
print("Check out of bounds parameter still works")
gs.setContrastLevel(4.0)
gs.sleep(1)
gs.setContrastLevel(1.0)
gs.enableInput()
This diff is collapsed.
# Tour of Gaia, the hyades and proper motions
# Starts at Earth, moves to Gaia, sees it in movement, enables
# clusters, moves to the Hyades and demonstrates proper motions
from time import sleep
from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface
from gaia.cu9.ari.gaiaorbit.util import GlobalConf
gs = EventScriptingInterface.instance()
gs.disableInput()
gs.cameraStop()
gs.minimizeInterfaceWindow()
gs.setFov(60)
gs.setRotationCameraSpeed(20)
gs.setTurningCameraSpeed(20)
gs.setCameraSpeed(20)
gs.setSimulationPace(0)
gs.setStarBrightness(27.0)
gs.setStarSize(8.0)
gs.setBrightnessLevel(0)
gs.setContrastLevel(1)
gs.setAmbientLight(0)
gs.setBloom(0)
gs.setMotionBlur(False)
gs.setRotationCameraSpeed(40)
gs.setTurningCameraSpeed(30)
gs.setCameraSpeed(30)
gs.setVisibility('element.labels',False)
gs.setVisibility('element.constellations',False)
gs.setVisibility("element.orbits", True)
gs.setSimulationTime(2018,4,25,10,0,0,0)
initialTime=gs.getSimulationTime();
gs.setCameraFocus("Earth")
gs.setCameraPosition([-79512530.4015463, -34466201.483790025, -123027319.20420773])
gs.setCameraDirection([-0.05362818839866128, -0.7694543330834683, -0.6364464209249313])
gs.setCameraUp([-0.2819369721261508, 0.6230989993308738, -0.7295609506965115])
gs.setCrosshairVisibility(False)
gs.sleep(5)
gs.setCinematicCamera(True)
gs.sleep(5)
gs.setCameraSpeed(10)
gs.goToObject("Earth", 10.0, 10)
gs.sleep(3)
gs.setCinematicCamera(True)
gs.setTurningCameraSpeed(0.01)
gs.setRotationCameraSpeed(1)
gs.setCameraFocus("Gaia")
dgaia=gs.getDistanceTo("Gaia")
gs.sleep(2)
gs.goToObject("Gaia", 60, 1)
from gaia.cu9.ari.gaiaorbit.util import GlobalConf
au_to_km = 149597900.0
gs.disableInput()
gs.minimizeInterfaceWindow()
gs.setRotationCameraSpeed(20)
gs.setTurningCameraSpeed(20)
gs.setCameraSpeed(30)
gs.setVisibility('element.labels',False)
gs.setVisibility('element.labels',False)
gs.setVisibility('element.planets',True)
gs.setVisibility('element.moons',True)
gs.setCinematicCamera(True)
gs.setCameraFocus("Gaia")
gs.setCameraLock(True)
gs.sleep(5)
gs.setCameraOrientationLock(False)
gs.setSimulationPace(1000.0)
gs.startSimulationTime()
gs.sleep(5)
gs.sleep(5)
gs.setCinematicCamera(True)
gs.setRotationCameraSpeed(40)
gs.cameraRotate(1,0)
gs.sleep(15)
gs.cameraStop()
gs.sleep(10)
gs.setCinematicCamera(True)
gs.setTargetTime(2019,4,25,10,0,0,0)
gs.setSimulationPace(1000000.0)
gs.setCinematicCamera(True)
gs.sleep(15)
gs.setVisibility("element.orbits", False)
gs.sleep(20)
gs.stopSimulationTime()
gs.setSimulationPace(0)
gs = EventScriptingInterface.instance()
gs.disableInput()
gs.cameraStop()
gs.minimizeInterfaceWindow()
gs.setCinematicCamera(True)
gs.setRotationCameraSpeed(20)
gs.setTurningCameraSpeed(20)
gs.setCameraSpeed(20)
gs.setVisibility('element.labels',False)
gs.setSimulationPace(1)
gs.setVisibility('element.labels',False)
gs.setVisibility('element.planets',True)
gs.setVisibility('element.moons',True)
gs.startSimulationTime()
gs.setTurningCameraSpeed(0.1)
gs.setCameraSpeed(5)
gs.setTurningCameraSpeed(1)
gs.setVisibility("element.clusters", True)
gs.goToObject("78The2Tau", 0.000004, 25)
gs.setVisibility("element.clusters", False)
gs.setCameraLock(True)
gs.cameraStop()
gs.setCameraLock(False)
gs.setCameraFree()
gs.setVisibility("element.propermotions", True)
gs.sleep(5)
gs.setSimulationPace(1e12)
gs.sleep(5)
gs.setVisibility("element.propermotions", False)
gs.sleep(5)
pace=-3e12
gs.setSimulationPace(pace)
gs.setTargetTime(initialTime)
gs.sleep(8)
gs.setSimulationPace(0)
gs.startSimulationTime()
gs.sleep(1)
au_to_km = 149597900.0
gs.setTurningCameraSpeed(20)
gs.setCameraSpeed(20)
gs.disableInput()
gs.cameraStop()
gs.minimizeInterfaceWindow()
gs.setSimulationTime(initialTime)
gs.setRotationCameraSpeed(20)
gs.setTurningCameraSpeed(20)
gs.setCinematicCamera(True)
gs.setSimulationPace(0)
gs.setCameraSpeed(5)
gs.sleep(3)
gs.goToObject("78The2Tau", 0.0000000007, 40)
gs.setCameraFocus("78The2Tau")
gs.setCameraLock(True)
gs.sleep(5)
gs.startSimulationTime()
gs.setCinematicCamera(True)
gs.cameraRotate(0.3,0)
gs.sleep(1)
gs.enableInput()
gs.maximizeInterfaceWindow()
gs.setCameraSpeed(20)
gs.setSimulationPace(1)
gs.setStarBrightness(27.0)
gs.setStarSize(8.0)
gs.setRotationCameraSpeed(40)
gs.setTurningCameraSpeed(24)
gs.setCameraSpeed(40)
gs.setBrightnessLevel(0)
gs.setContrastLevel(1)
gs.setAmbientLight(0)
gs.setBloom(0)
gs.setMotionBlur(False)
gs.setFov(60)
from java.util import Date
now = Date()
gs.setSimulationTime(now.getTime())
gs.setVisibility('element.labels',True)
gs.setVisibility('element.planets',True)
gs.setVisibility('element.moons',True)
# Tour through the solar system
# Starts at Earth, goes to Saturn and ends with a view of the asteroids in motion
from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface
gs = EventScriptingInterface.instance()
# Camera params
gs.setCameraSpeed(3.0)
gs.setRotationCameraSpeed(42.0)
gs.setTurningCameraSpeed(4.0)
gs.setCinematicCamera(True)
# Visibility
gs.setVisibility("element.planets", True)
gs.setVisibility("element.atmospheres", True)
gs.setVisibility("element.stars", True)
gs.setVisibility("element.moons", True)
gs.setVisibility("element.satellites", True)
gs.setVisibility("element.galaxies", True)
gs.setVisibility("element.milkyway", True)
gs.setVisibility("element.asteroids", False)
gs.setVisibility("element.orbits", False)
gs.setVisibility("element.labels", False)
gs.setVisibility("element.constellations", False)
gs.setVisibility("element.boundaries", False)
gs.setVisibility("element.equatorial", False)
gs.setVisibility("element.ecliptic", False)
gs.setVisibility("element.galactic", False)
gs.setVisibility("element.clusters", False)
gs.setVisibility("element.meshes", False)
gs.setVisibility("element.titles", False)
gs.setCrosshairVisibility(False)
# Start at Earth
gs.setSimulationTime(2018, 4, 25, 12, 0, 0, 0)
gs.setCameraFocusInstantAndGo("Earth")
gs.sleep(3.0)
gs.goToObject("Earth", 49.0, 0.0)
# Rotate slowly
gs.sleep(5.0)
gs.setVisibility("element.orbits", True)
gs.sleep(5.0)
gs.goToObject("Earth", 1.0)
gs.cameraStop()
gs.sleep(2.0)
gs.stopSimulationTime()
gs.goToObject("Saturn", 40.0, 0.0)
gs.cameraRotate(0.6, 0.0)
gs.setSimulationPace(5000.0)
gs.startSimulationTime()
gs.sleep(15.0)
gs.cameraStop()
gs.setVisibility("element.asteroids", True)
gs.setVisibility("element.orbits", False)
gs.goToObject("Sol", 0.16, 0.0)
gs.cameraStop()
gs.startSimulationTime()
initime = 4000.0
endtime = 4000000.0
def frange(x, y, jump):
while x < y:
yield x
x += jump
# 10 seconds, in steps of 0.1 is 100 steps
step = (endtime - initime) / 200.0
gs.setSimulationPace(initime)
for t in frange(initime, endtime, step):
gs.setSimulationPace(t)
gs.sleep(0.05)
gs.sleep(10.0)
gs.cameraRotate(0.0, -1.0)
gs.setVisibility("element.orbits", True)
gs.sleep(10.0)
gs.goToObject("Sol", 0.01, 0.0)
gs.stopSimulationTime()
gs.cameraStop()
......@@ -36,7 +36,7 @@ vec4 drawSimple(vec2 tc) {
discard;
}
float light = light(dist, light_decay);
return vec4(v_color.rgb, v_color.a) * light;
return v_color * light;
}
......
......@@ -42,7 +42,7 @@ out vec2 v_texCoords;
void main()
{
v_color = vec4(u_color.rgb, u_color.a);
v_color = u_color;
v_texCoords = a_texCoord0;
mat4 transform = u_projTrans;
......
......@@ -16,6 +16,8 @@ uniform float u_alpha;
uniform float u_size;
uniform float u_scaleFactor;
uniform int u_cubemap;
// VR scaling, if any
uniform float u_vrScale;
// Current julian date, in days, emulates a double in vec2
uniform vec2 u_t;
......@@ -82,6 +84,7 @@ vec4 keplerToCartesian() {
float ox = rc_t * cos(nu_t);
float oy = rc_t * sin(nu_t);
// 6
float sinomega = sin(omega_ap);
float cosomega = cos(omega_ap);
......@@ -95,9 +98,10 @@ vec4 keplerToCartesian() {
float z = ox * (sinomega * sini) + oy * (cosomega * sini);
// 7
x *= M_TO_U;
y *= M_TO_U;
z *= M_TO_U;
float fac = M_TO_U * u_vrScale;
x *= fac;
y *= fac;
z *= fac;
return vec4(y, z, x, 1.0);
}
......
......@@ -13,6 +13,7 @@ uniform mat4 u_projModelView;
uniform vec3 u_camPos;
uniform vec3 u_camDir;
uniform int u_cubemap;
uniform float u_vrScale;
uniform vec2 u_pointAlpha;
uniform float u_thAnglePoint;
......@@ -45,10 +46,13 @@ out vec3 v_fragPosView;
#define len0 170000.0
#define len1 len0 * 100.0
#define day_to_year 1.0 / 365.25
void main() {
// Lengths
float l0 = len0 * u_vrScale;
float l1 = l0 * 100.0;
vec3 pos = a_position - u_camPos;
// Proper motion
pos = pos + a_pm * float(u_t) * day_to_year;
......@@ -82,7 +86,7 @@ void main() {
float viewAngleApparent = atan((a_sizeMag.x * u_alphaSizeFovBr.w) / dist) / u_alphaSizeFovBr.z;
float opacity = pow(lint2(viewAngleApparent, 0.0, u_thAnglePoint, u_pointAlpha.x, u_pointAlpha.y), 1.2);
float fadeout = smoothstep(dist, len0, len1);
float fadeout = smoothstep(dist, l0, l1);
v_col = vec4(a_color.rgb, opacity * u_alphaSizeFovBr.x * fadeout);
gl_Position = u_projModelView * vec4(pos, 0.0) * v_discard;
......
#version 120
// Light scattering implementation by Toni Sagrista
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
#define N 30
// Current frame
uniform sampler2D u_texture0;
// Glow texture
uniform sampler2D u_texture1;
// Pre pass
uniform sampler2D u_texture2;
uniform vec2 u_viewport;
uniform int u_nSamples;
uniform float u_textureScale;
varying vec2 v_texCoords;
uniform vec2 u_lightPositions[N];
uniform float u_lightViewAngles[N];
uniform vec3 u_lightColors[N];
uniform int u_nLights;
float len(vec2 vect, float ar){
return sqrt(vect.x * vect.x * ar * ar + vect.y * vect.y);
}
// Computes luminance of rgba color
float luminance(vec4 color){
return (0.299 * color.r + 0.587 * color.g + 0.114 * color.b) * color.a;
}
float average(vec4 color){
return (color.r + color.g + color.b) / 3.0;
}
float fx(float t, float a){
return a * t * cos(t);
}
float fy(float t, float a){
return a * t * sin(t);
}
void main()
{
float ar = u_viewport.x / u_viewport.y;
gl_FragColor = vec4(0.0);
for (int li = 0; li < u_nLights; li++){
float viewAngle = min(0.0001, u_lightViewAngles[li]);
vec3 lightColor = u_lightColors[li];
// Size of sampling spiral
float a = u_textureScale * viewAngle * 5.0;
// Archimedes' spiral (fx = a*t*cos(t), fy = a*t*sin(t)) sampling from 0 to 3*Pi (extends to a radius of roughly 10)
float t = 0;
float dt = 3.0 * 3.14159 / u_nSamples;
float lum = 0.0;
for(int idx = 1; idx < u_nSamples; idx++){
vec2 curr_coord = u_lightPositions[li] + vec2(fx(t, a) / ar, fy(t, a));
lum += (texture2D(u_texture2, curr_coord)).r;
t += dt;
}
vec4 star_color = texture2D(u_texture2, u_lightPositions[li] + vec2(fx(t, a) / ar, fy(t, a) * ar));
lum += star_color.r;
lum /= u_nSamples;
float size = u_textureScale * min(1.0, viewAngle * 500000) * lum;
vec2 glow_tc = (v_texCoords - u_lightPositions[li]);
glow_tc.x *= ar;
float dist_center = length(glow_tc);
glow_tc /= size;
glow_tc += 0.5;
float color_glow = clamp(average(texture2D(u_texture1, glow_tc)), 0.0, 1.0);
float core_inc = (0.1 - min(0.1, dist_center)) * color_glow;
gl_FragColor += vec4(color_glow * lightColor.r + core_inc, color_glow * lightColor.g + core_inc, color_glow * lightColor.b + core_inc, 1.0);
}
gl_FragColor += texture2D(u_texture0, v_texCoords);
//gl_FragColor *= 0.00001;
//gl_FragColor += texture2D(u_texture2, v_texCoords);
}
......@@ -656,7 +656,7 @@
"fontColor": "white"
},
"msg-18": {
"font": "ui-21",
"font": "ui-18",
"fontColor": "white"
},
"msg-19": {
......
......@@ -32,7 +32,7 @@ allprojects {
box2DLightsVersion = "1.3"
ashleyVersion = "1.4.0"
aiVersion = "1.5.0"
lwjglVersion = "3.2.1"
lwjglVersion = "3.2.2"
jcommanderVersion = '1.72'
slf4jVersion = "1.7.25"
sparkjavaVersion = "2.7.2"
......@@ -136,13 +136,16 @@ project(":core") {
compile group: "org.lwjgl", name: "lwjgl-opengl", version: "$lwjglVersion"
compile group: "org.lwjgl", name: "lwjgl-openal", version: "$lwjglVersion"
compile group: "org.lwjgl", name: "lwjgl-openvr", version: "$lwjglVersion"
compile "org.lwjgl:lwjgl-openvr:$lwjglVersion:natives-linux"
compile "org.lwjgl:lwjgl-openvr:$lwjglVersion:natives-windows"
compile "org.lwjgl:lwjgl-openvr:$lwjglVersion:natives-macos"
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-controllers-platform:$gdxVersion:natives-desktop"
compile group: "commons-io", name: "commons-io", version: "$commonsioVersion"
compile "org.apache.commons:commons-compress:$compressVersion"
compile "com.beust:jcommander:$jcommanderVersion"
......@@ -171,7 +174,7 @@ project(":core") {
jar {
manifest {
attributes "Implementation-Title": "Gaia Sky",
attributes "Implementation-Title": "Gaia Sky VR",
"Implementation-Version": version
}
from("../assets") {
......
apply plugin: "java"
apply plugin: "com.install4j.gradle"
import org.apache.tools.ant.taskdefs.condition.Os
sourceCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
......@@ -295,13 +297,17 @@ task dist (dependsOn: gaiaskyJar, description: "Compiles the project, creates th
project.ext.versionFile = file("build/classes/java/main/version").text
ant.replace(file: "$distDir/README.md", token: "--------------------------", value: "$versionFile")
// Generate man
println("Generate man: $distDir/gaiasky.6.gz")
exec {
commandLine "help2man", "-N", "--section=6", "--include", "$baseDir/core/man/gaiasky.h2m", "--output=$distDir/gaiasky.6", "$distDir/gaiasky"
}
exec {
commandLine "gzip", "$distDir/gaiasky.6"
// Generate man (linux only)
if(Os.isFamily(Os.FAMILY_UNIX)) {
println("Generate man: $distDir/gaiasky.6.gz")
exec {
commandLine "help2man", "-N", "--section=6", "--include", "$baseDir/core/man/gaiasky.h2m", "--output=$distDir/gaiasky.6", "$distDir/gaiasky"
}
exec {
commandLine "gzip", "$distDir/gaiasky.6"
}
} else {
println("Skipping generation of man pages")
}
}
}
......
......@@ -71,6 +71,9 @@ OPTS="$OPTS -Dassets.location=\"$GSDIR/\""
# SimpleLogger defaults
OPTS="$OPTS -Dorg.slf4j.simpleLogger.defaultLogLevel=warn -Dorg.slf4j.simpleLogger.showThreadName=false"
# Assets location
OPTS="$OPTS -Dassets.location=\"$GSDIR/\""
#
# Run.
#
......
......@@ -12,7 +12,7 @@ SET GSDIR=%~dp0
cd %GSDIR%
:: Memory
SET OPTS=-Xms2g -Xmx4g
SET OPTS=-Xms2g -Xmx8g
:: Garbage Collector G1
SET OPTS=%OPTS% -XX:+UseG1GC
:: Assets location
......
<?xml version="1.0" encoding="UTF-8"?>
<install4j version="7.0.10" transformSequenceNumber="7">
<directoryPresets config="@gs-git-folder@/assets/img" />
<application name="GaiaSky" distributionSourceDir="" applicationId="8310-5272-6362-8592" mediaDir="./" mediaFilePattern="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:sys.version}" compression="9" lzmaCompression="false" pack200Compression="false" excludeSignedFromPacking="true" commonExternalFiles="false" createMd5Sums="true" shrinkRuntime="true" shortName="gaiasky" publisher="ARI - ZAH - Universität Heidelberg" publisherWeb="http://www.zah.uni-heidelberg.de/gaia/outreach/gaiasky" version="@version-tag@" allPathsRelative="true" backupOnSave="false" autoSave="false" convertDotsToUnderscores="true" macSignature="????" macVolumeId="c3380c949a34b4f7" javaMinVersion="1.8" javaMaxVersion="" allowBetaVM="false" jdkMode="runtimeJre" jdkName="">
<application name="GaiaSky VR" distributionSourceDir="" applicationId="8310-5272-6362-8592" mediaDir="./" mediaFilePattern="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:sys.version}" compression="9" lzmaCompression="false" pack200Compression="false" excludeSignedFromPacking="true" commonExternalFiles="false" createMd5Sums="true" shrinkRuntime="true" shortName="gaiasky" publisher="ARI - ZAH - Universität Heidelberg" publisherWeb="http://www.zah.uni-heidelberg.de/gaia/outreach/gaiasky" version="@version-tag@" allPathsRelative="true" backupOnSave="false" autoSave="false" convertDotsToUnderscores="true" macSignature="????" macVolumeId="c3380c949a34b4f7" javaMinVersion="1.8" javaMaxVersion="" allowBetaVM="false" jdkMode="runtimeJre" jdkName="">
<languages skipLanguageSelection="false" languageSelectionInPrincipalLanguage="false">
<principalLanguage id="en" customLocalizationFile="" />
<additionalLanguages />
......
This diff is collapsed.
......@@ -43,7 +43,7 @@ public abstract class StreamingOctreeLoader implements IObserver, ISceneGraphLoa
/**
* Data will be pre-loaded at startup down to this octree depth.
*/
protected static final int PRELOAD_DEPTH = 4;
protected static final int PRELOAD_DEPTH = 3;
/**
* Default load queue size in octants
*/
......
......@@ -8,6 +8,7 @@ package gaia.cu9.ari.gaiaorbit.data.group;
import com.badlogic.gdx.utils.Array;
import gaia.cu9.ari.gaiaorbit.scenegraph.ParticleGroup.ParticleBean;
import gaia.cu9.ari.gaiaorbit.scenegraph.StarGroup.StarBean;
import gaia.cu9.ari.gaiaorbit.util.Constants;
import gaia.cu9.ari.gaiaorbit.util.GlobalConf;
import gaia.cu9.ari.gaiaorbit.util.I18n;
......@@ -116,10 +117,14 @@ public class BinaryDataProvider extends AbstractStarGroupDataProvider {
// Double
for (int i = 0; i < StarBean.I_APPMAG; i++) {
data[i] = in.readDouble();
if (i < 6)
data[i] *= Constants.VR_SCALE;
}
// Float
for (int i = StarBean.I_APPMAG; i < StarBean.I_HIP; i++) {
data[i] = in.readFloat();
if (i == StarBean.I_SIZE)
data[i] *= Constants.VR_SCALE;
}
// Int
data[StarBean.I_HIP] = in.readInt();
......@@ -165,10 +170,14 @@ public class BinaryDataProvider extends AbstractStarGroupDataProvider {
// Double
for (int i = 0; i < StarBean.I_APPMAG; i++) {
data[i] = mem.getDouble();
if (i < 6)
data[i] *= Constants.VR_SCALE;
}
// Float
for (int i = StarBean.I_APPMAG; i < StarBean.I_HIP; i++) {
data[i] = mem.getFloat();
if (i == StarBean.I_SIZE)
data[i] *= Constants.VR_SCALE;
}
// Int
data[StarBean.I_HIP] = mem.getInt();
......
......@@ -105,7 +105,7 @@ public class OctreeGroupLoader extends StreamingOctreeLoader {
}
@SuppressWarnings("unchecked")
Array<StarBean> data = (Array<StarBean>) particleReader.loadDataMapped(octantFile.path(), 1.0);
StarGroup sg = StarGroup.getDefaultStarGroup("stargroup-%%SGID%%", data, fullInit);
StarGroup sg = StarGroup.getDefaultStarGroup("stargroup-%%SGID%%", data, fullInit, GlobalConf.runtime.OPENVR);
synchronized (octant) {
sg.octant = octant;
......
......@@ -7,6 +7,7 @@ package gaia.cu9.ari.gaiaorbit.data.group;
import com.badlogic.gdx.utils.Array;
import gaia.cu9.ari.gaiaorbit.scenegraph.ParticleGroup.ParticleBean;
import gaia.cu9.ari.gaiaorbit.util.Constants;
import gaia.cu9.ari.gaiaorbit.util.GlobalConf;
import gaia.cu9.ari.gaiaorbit.util.I18n;
import gaia.cu9.ari.gaiaorbit.util.Logger;
......@@ -26,7 +27,7 @@ import java.util.zip.GZIPInputStream;
*/
public class PointDataProvider implements IParticleGroupDataProvider {
private static final Log logger = Logger.getLogger(PointDataProvider.class);
public Array<? extends ParticleBean> loadData(String file) {
return loadData(file, 1d);
}
......
......@@ -5,6 +5,7 @@
package gaia.cu9.ari.gaiaorbit.data.octreegen;
import gaia.cu9.ari.gaiaorbit.util.Constants;
import gaia.cu9.ari.gaiaorbit.util.GlobalConf;
import gaia.cu9.ari.gaiaorbit.util.Logger;
import gaia.cu9.ari.gaiaorbit.util.Logger.Log;
......@@ -78,12 +79,12 @@ public class MetadataBinaryIO {
try {
// name_length, name, appmag, absmag, colorbv, ra, dec, dist
long pageId = data_in.readInt();
float x = data_in.readFloat();
float y = data_in.readFloat();
float z = data_in.readFloat();
float hsx = data_in.readFloat() / 2f;
float hsy = data_in.readFloat() / 2f;
float hsz = data_in.readFloat() / 2f;
float x = data_in.readFloat() * (float) Constants.VR_SCALE;
float y = data_in.readFloat() * (float) Constants.VR_SCALE;
float z = data_in.readFloat() * (float) Constants.VR_SCALE;
float hsx = (data_in.readFloat() / 2f) * (float) Constants.VR_SCALE;
float hsy = (data_in.readFloat() / 2f) * (float) Constants.VR_SCALE;
float hsz = (data_in.readFloat() / 2f) * (float) Constants.VR_SCALE;
long[] childrenIds = new long[8];
for (int i = 0; i < 8; i++) {
childrenIds[i] = data_in.readInt();
......@@ -146,10 +147,10 @@ public class MetadataBinaryIO {
try {
// name_length, name, appmag, absmag, colorbv, ra, dec, dist
long pageId = mem.getInt();
float x = mem.getFloat();
float y = mem.getFloat();
float z = mem.getFloat();
float hsx = mem.getFloat() / 2f;
float x = mem.getFloat() * (float) Constants.VR_SCALE;
float y = mem.getFloat() * (float) Constants.VR_SCALE;
float z = mem.getFloat() * (float) Constants.VR_SCALE;
float hsx = (mem.getFloat() / 2f) * (float) Constants.VR_SCALE;
//float hsy = mem.getFloat() / 2f;
mem.position(mem.position() + 4); // skip hsy
float hsy = hsx;
......
......@@ -30,10 +30,10 @@ public class StarGroupBinaryIO implements IStarGroupIO {
/**
* Writes the list to the output stream. The list must contain a single star
* vgroup.
* group.
*
* @param list
* The list with the star vgroup to write
* The list with the star group to write
* @param out
* The output stream to write to
*/
......@@ -45,11 +45,11 @@ public class StarGroupBinaryIO implements IStarGroupIO {
}
/**
* Reads a single star vgroup from the given input stream.
* Reads a single star group from the given input stream.
*
* @param in
* The input stream to read the star vgroup from
* @return A list with a single star vgroup object
* The input stream to read the star group from
* @return A list with a single star group object
*/
public Array<AbstractPositionEntity> readParticles(InputStream in) {
@SuppressWarnings("unchecked")
......
......@@ -48,7 +48,7 @@ import java.io.*;
*/
public class NBGLoader extends AbstractCatalogLoader implements ISceneGraphLoader {
private static final Log logger = Logger.getLogger(NBGLoader.class);
boolean active = true;
@Override
......
This diff is collapsed.
......@@ -34,8 +34,8 @@ import java.util.Properties;
/**
* Desktop GlobalConf initialiser, where the configuration comes from a
* global.properties file.
*
* global.vr.properties file.
*
* @author tsagrista
*/
public class DesktopConfInit extends ConfInit {
......@@ -49,7 +49,7 @@ public class DesktopConfInit extends ConfInit {
public DesktopConfInit() {
super();
try {
String propsFileProperty = System.getProperty("properties.file");
String propsFileProperty = System.getProperty("properties.vr.file");
if (propsFileProperty == null || propsFileProperty.isEmpty()) {
propsFileProperty = initConfigFile(false);
}
......@@ -536,11 +536,11 @@ public class DesktopConfInit extends ConfInit {
private String initConfigFile(boolean ow) throws IOException {
// Use user folder
File userFolder = SysUtils.getConfigDir();
File userFolderConfFile = new File(userFolder, "global.properties");
File userFolderConfFile = new File(userFolder, "global.vr.properties");
if (ow || !userFolderConfFile.exists()) {
// Copy file
copyFile(new File("conf" + File.separator + "global.properties"), userFolderConfFile, ow);
copyFile(new File("conf" + File.separator + "global.vr.properties"), userFolderConfFile, ow);
}
String props = userFolderConfFile.getAbsolutePath();
System.setProperty("properties.file", props);
......
package gaia.cu9.ari.gaiaorbit.desktop.vr;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Files;
import com.badlogic.gdx.files.FileHandle;
import gaia.cu9.ari.gaiaorbit.desktop.format.DesktopDateFormatFactory;
import gaia.cu9.ari.gaiaorbit.desktop.format.DesktopNumberFormatFactory;
import gaia.cu9.ari.gaiaorbit.desktop.util.DesktopConfInit;
import gaia.cu9.ari.gaiaorbit.interfce.ConsoleLogger;
import gaia.cu9.ari.gaiaorbit.util.ConfInit;
import gaia.cu9.ari.gaiaorbit.util.I18n;
import gaia.cu9.ari.gaiaorbit.util.Logger;
import gaia.cu9.ari.gaiaorbit.util.format.DateFormatFactory;
import gaia.cu9.ari.gaiaorbit.util.format.NumberFormatFactory;
import gaia.cu9.ari.gaiaorbit.vr.openvr.OpenVRQuery;
import java.io.File;
import java.io.FileInputStream;
public class OpenVRQueryDesktop {
public static void main(String[] args) {
try {
// Assets location
String ASSETS_LOC = (System.getProperty("assets.location") != null ? System.getProperty("assets.location") : "../assets/");
new ConsoleLogger();
Gdx.files = new Lwjgl3Files();
// Initialize number format
NumberFormatFactory.initialize(new DesktopNumberFormatFactory());
// Initialize date format
DateFormatFactory.initialize(new DesktopDateFormatFactory());
// Initialize i18n
I18n.initialize(Gdx.files.internal("i18n/gsbundle"));
// Initialize conf
ConfInit.initialize(new DesktopConfInit(new FileInputStream(new File(ASSETS_LOC + "conf/global.vr.properties")), new FileInputStream(new File(ASSETS_LOC + "data/dummyversion"))));
I18n.initialize(new FileHandle(ASSETS_LOC + "i18n/gsbundle"));
OpenVRQuery.queryOpenVr();
} catch (Exception e) {
Logger.getLogger(OpenVRQueryDesktop.class).error(e);
}
}
}
......@@ -582,6 +582,17 @@ public enum Events {
* with the state (display/no display) and the localised name
**/
DISPLAY_GUI_CMD,
/**
* Toggles VR GUI display. Contains a name and a boolean with the state
*/
DISPLAY_VR_GUI_CMD,
/** Displays VR Controller hints **/
DISPLAY_VR_CONTROLLER_HINT_CMD,
/**
* Informs of the current selecting state. Contains the state (true|false) and a double in [0,1] with the completion
* rate
*/
VR_SELECTING_STATE,
/**
* Informs the UI theme has been reloaded. Contains the new skin.
*/
......@@ -1109,6 +1120,12 @@ public enum Events {
**/
UNPOST_RUNNABLE,
/** New VR device connected. Contains the VRDevice object. **/
VR_DEVICE_CONNECTED,
/** VR device disconnected. Contains the VRDevice object. **/
VR_DEVICE_DISCONNECTED,
// INPUT LISTENER EVENTS
TOUCH_DOWN, TOUCH_UP, TOUCH_DRAGGED, SCROLLED, KEY_DOWN, KEY_UP,
......
......@@ -43,6 +43,11 @@ public abstract class AbstractGui implements IObserver, IGui {
*/
protected String name;
/**
* Horizontal offset, for VR
*/
protected int hoffset;
/** Lock for sync **/
protected Object lock;
......@@ -128,4 +133,14 @@ public abstract class AbstractGui implements IObserver, IGui {
public void notify(Events event, Object... data) {
// Empty by default
}
@Override
public void setHoffset(int hoffset) {
this.hoffset = hoffset;
}
@Override
public boolean mustDraw() {
return true;
}
}
......@@ -6,9 +6,13 @@
package gaia.cu9.ari.gaiaorbit.interfce;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.*;
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.SnapshotArray;
import gaia.cu9.ari.gaiaorbit.GaiaSky;
import gaia.cu9.ari.gaiaorbit.event.EventManager;
import gaia.cu9.ari.gaiaorbit.event.Events;
......@@ -27,6 +31,8 @@ import gaia.cu9.ari.gaiaorbit.util.scene2d.OwnLabel;
import gaia.cu9.ari.gaiaorbit.util.scene2d.OwnTextIconButton;
import gaia.cu9.ari.gaiaorbit.util.scene2d.OwnTextTooltip;
import static gaia.cu9.ari.gaiaorbit.event.Events.FOCUS_CHANGED;
/**
* Part of the user interface which holds the information on the current focus
* object and on the camera.
......@@ -56,6 +62,10 @@ public class FocusInfoInterface extends Table implements IObserver, IGuiInterfac
float pad3, pad5, pad10, bw;
public FocusInfoInterface(Skin skin) {
this(skin, false);
}
public FocusInfoInterface(Skin skin, boolean vr) {
super(skin);
this.setBackground("table-bg");
......@@ -203,27 +213,29 @@ public class FocusInfoInterface extends Table implements IObserver, IGuiInterfac
focusInfo.add(new OwnLabel("ID", skin, "hud-big")).left();
focusInfo.add(focusId).left().padLeft(pad10);
focusInfo.row();
focusInfo.add(new OwnLabel(I18n.txt("gui.focusinfo.alpha"), skin, "hud-big")).left();
focusInfo.add(focusRA).left().padLeft(pad10);
focusInfo.row();
focusInfo.add(new OwnLabel(I18n.txt("gui.focusinfo.delta"), skin, "hud-big")).left();
focusInfo.add(focusDEC).left().padLeft(pad10);
focusInfo.row();
focusInfo.add(new OwnLabel(I18n.txt("gui.focusinfo.mualpha"), skin, "hud-big")).left();
focusInfo.add(focusMuAlpha).left().padLeft(pad10);
focusInfo.row();
focusInfo.add(new OwnLabel(I18n.txt("gui.focusinfo.mudelta"), skin, "hud-big")).left();
focusInfo.add(focusMuDelta).left().padLeft(pad10);
focusInfo.row();
focusInfo.add(new OwnLabel(I18n.txt("gui.focusinfo.radvel"), skin, "hud-big")).left();
focusInfo.add(focusRadVel).left().padLeft(pad10);
focusInfo.row();
focusInfo.add(appmagLabel).left();
focusInfo.add(focusAppMag).left().padLeft(pad10);
focusInfo.row();
focusInfo.add(absmagLabel).left();
focusInfo.add(focusAbsMag).left().padLeft(pad10);
focusInfo.row();
if (!vr) {
focusInfo.add(new OwnLabel(I18n.txt("gui.focusinfo.alpha"), skin, "hud-big")).left();
focusInfo.add(focusRA).left().padLeft(pad10);
focusInfo.row();
focusInfo.add(new OwnLabel(I18n.txt("gui.focusinfo.delta"), skin, "hud-big")).left();
focusInfo.add(focusDEC).left().padLeft