Cool. I have updated the url above.
Commited a couple small improvements. I think the Earth looks a bit better now, though it has still that zipper behind caused by the rotation of the textures.
Just wondering if anyone else is having any issues. I get the following error using the latest code from SVN and the latest nightly JME3 build. Can anyone help?
Thanks
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferInt.(DataBufferInt.java:41)
at java.awt.image.Raster.createPackedRaster(Raster.java:458)
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
at java.awt.image.BufferedImage.(BufferedImage.java:317)
at javax.imageio.ImageIO.read(ImageIO.java:1416)
at javax.imageio.ImageIO.read(ImageIO.java:1322)
at com.jme3.texture.plugins.AWTLoader.load(AWTLoader.java:125)
at com.jme3.texture.plugins.AWTLoader.load(AWTLoader.java:136)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:201)
at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:240)
at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:259)
at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:271)
at atmosphere.PlanetRenderer.init(PlanetRenderer.java:58)
at atmosphere.Main.setupPlanet(Main.java:141)
at atmosphere.Main.simpleInitApp(Main.java:65)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:155)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:151)
at java.lang.Thread.run(Thread.java:613)
Probably is a problem with the texture size. Try using the lower resolution texture. In PlanetRenderer, change the following to use the land_ocean_ice_2048.jpg texture instead of the other one (the world.topo.bathy… image is too big for some video cards):
[java]
// x2048
t_diffuse1 = app.getAssetManager().loadTexture(“Textures/world.topo.bathy.200404.3x5400x2700.jpg”);
// x1024
//t_diffuse1 = app.getAssetManager().loadTexture(“Textures/land_ocean_ice_2048.jpg”);
[/java]
Also, make sure in the project properties that it is running with the JVM options:
-Xmn256M -Xms512M -Xmx1024M
Some graphics cards dont like textures that are not “power of two” in size…
Well I get this littel friend here, trying to just start the Main class
EmpirePhoenix said:
Well I get this littel friend here, trying to just start the Main class
I guess info on the graphics card vendor and type would be helpful here as this is some shader incompatibility.. Do you have the latest drivers installed? (I guess so ;))
Try now with the latest svn sources, I think it is now more standard.
Well yes, it does not crash now, however everything, except the atmosphere and the skybox is black now.
I have latest cataclyst
and own a 3750HD
Ok. Shall you please try once more?
I suspect now it might be what normen said and changed the default texture.
Empire, I was having the same problem, where the planet was black but the atmosphere was still there on my laptop, however, it worked like a charm (after the directbuffermemory error was fixed) on my desktop with a geforce 8400.
It probably has something to do with the graphics card.
@Jiyzarza,
I really like this work. Currently it seems to be totally aimed towards your project idea of low atmosphere orbit, however, lets say we wanted to see the sky tracing algorithm being used at a depth close enough to the ground that you couldnt see space anymore, well, this doesnt seem possible because of movement limitations based on the radius of the planet itself. I read that you noted that messing with parameters might create problems. Well, are you aware of any parameter which could be changed to make the atmosphere deeper (even by simply increasing the size of the planet/atmosphere themselves at their current ratio) or anything along these lines to see the algorithm take over the sky? If not I could attempt to adapt it to such a function in the future, but i am just curious.
Thanks for all your time you have put in to this, it is greatly appreciated and your good work really shows.
Sorry one more thing, just listened to the background music, gave it a Battlestar Galactica feeling, AWESOME !!!
Nope it is still black.
I guess you are using a nvidia only command somewhere (in the meaning that ati drivers do not implement it)
Well, that’s a shame. I can’t find the problem.
If you have the time, maybe you can make a small test to corner the bug.
Go to MatDefs and open the GroundFromSpace.vert shader. At the end of the file you’ll see assignments to fLightIntensity, v4RayleighColor, v4MieColor. Can you comment those lines and try setting them to a constant value like this?:
fLightIntensity = 1.0;
v4RayleighColor = vec4(1.0);
v4MieColor = vec4(1.0);
Just to find out wether it is the vertex or the fragment shader.
Thanks.
@Eggsworth,
I have been experimenting a bit with what you said. I think it is doable, the difficulty lays in finding the values to maintain a smooth transition between outer space an the atmosphere, since you have to change a bit the SkyFromAtmosphere shader. So far it looks possible to me, but needs some fine tunning.
Here is an example, some stars still show but overall looks feasible:
EDIT: About making deeper the atmosphere, you can try changing the proportion in the Planet class (modify getOuterRadius and the updateCalculations method) and see what happens, as I said the shader calculations are based on that proportion (atmosphere radius = ground radius * 1.025), so probably won’t work well.
Cheers.
@Empire, I have commited a small change to test the ATI card. Please update your code and see if the planet diffuse shows now.
Thanks!
nope it does not
Ok. If the atmosphere works and the ground does not then it has to be related with any of the ground texture commands, which is the only relevant difference between the sky shaders and the ground shaders (sky shaders don’t use textures).
I will look into it, thanks for testing this :).
Well it is probably not.
I just trial and errord through every varaible responsible vor the fragemntcolor
in the groundfromspace.vert
and finally I land here
float fScatter = fSampleDepth * fTemp - fCameraOffset;
if I replace this with
float fScatter = fSampleDepth * 0.1 - fCameraOffset;
the part of the planet on the atmophere side is visible partly.
In the progress of getting there there were some really good looking pictures already. I suppose that having a more intelligent value than 0.1 would show them now too, but this is far to much for trial error
btw where is the attach button?
EmpirePhoenix said:
btw where is the attach button?
Below the "Post Reply" button