Very nice! I might implement that with what I’m working on right now.
i svn updated the latest version, a couple of notes:
there is a good day/night transition which wasnt there before
there seems to be a problem with the ground when in the atmosphere, specifically on the night side. When i go into the atmosphere where the ground is dark, the texture goes from black to being fully lighted and seemingly greyscale.
otherwise im loving it
Yes Eggsworth, I am playing a bit further with it and its current state is unfinished.
Thanks to nehon and Empire tests I have realized that there are odd differences related to shader parameters between nvidia and ATI cards, probably driver issues.
I intend to commit a working version sometime today (GMT+1), for both ATI and nVidia.
Cheers!
i have always been curious, what causes the cards to react differently?
what differences are there?
Some functions are differently implemented, optimized, for example I bet the transformation thing on nvidia is just there, because the driver has it hardcoded for some speed gain
Also GLSL compilation is a lot more permissive with NVIDIA cards. Some errors are just raised as warnings,so it work on nvidia but will fail to compile on ATI.
There are some hardware specificity too, for example, nvidia has a hard coded 2x2 PCF filtering for shadow map lookup. ATI has something called the Fetch4 that that is related to shadows too, but i don’t really get what it does…
Usually, if your shader works with ATI, there is a good chance that it will work on nvidia…the other way around is far from true.
Yay the far one works now on my ati without problems, however it seems that the near one for the planet surface is still black.
But from what I can see so far this really looks great
Well. The current version should work now in the two major brands (the day a third comes into play I’ll panic and return to paper and pencil 3D j/k).
Some notes:
1.- Finally have decided that using the same material for the ground, either from space or the atmosphere works pretty well. This is a temporary solution, untill I find what is the sneaky issue with the GroundFromAtmosphere material.
2.- Realistic planets look flat. Well, yes, at the end the Inquisition was almost right. But its really like the moon at the night. Sun light is so intense that shadow due to the planet body is either total or null. There is a narrow transition (orange-ish, due to atmospheric scattering) between day and night, and the illuminated side looks pretty much flat.
I kind of like round planets, artistically speaking, so there are two lines of code to give a very soft shadow that gives a bit of volume to the planet. It is easy to turn off if you prefer a completely realistic planet. Basically, look for the variable fLightIntensity and remove it:
Edit GroundFromSpace.vert and towards the end, comment the line:
fLightIntensity = (dot(v3LightPos, vec3(inNormal)) + 1.0) * 0.5;
Then edit GroundFromSpace.frag, and remove it from the equation:
gl_FragColor = 1.0 - exp(-fExposure * (v4RayleighColor + v4Diffuse * v4MieColor) * fLightIntensity);
Then remove it from the declarations.
3.- There is a visual glitch that you surely have seen already. In the day-night transition, from a relatively close view the mesh polygons are very noticeable. I have tried with a higher poly mesh but as far as my experience has been, blender allows me to create icospheres up to 6 subdivisions, which is the one I am currently using. I am not sure why this happens, and my hope is that with a dynamic LOD mesh and enough resolution it will disappear. Maybe someone around here has an idea about it.
Edit:
4.- Ah, I almost forget this one. The teddy bear zipper due to texture rotations is still there.
Cheers.
3, how about using a sphere shape as model?
I used that at first (the first pics use a sphere shape) but it didn’t work well and produced black holes (pun not intended :p) and other artefacts. Apparently it needs a mesh with evenly distributed normals to start with.
use the binominal generator over it that helps greatly
TangentBinormalGenerator.generate(geo.getMesh());
Using a sphere shape for the ground improves the effect a bit.
But I am getting a lot of warnings (it seems for every triangle) when calling TangentBinormalGenerator.generate(geom) (its the same on the sphere shape and the icosphere mesh) :
07-oct-2010 16:49:43 com.jme3.util.TangentBinormalGenerator processTriangleData
WARNING: Binormal is flipped for vertex 9.376.
Any idea what’s wrong?
Thanks.
My first attempts with the new NeoTextureEditor plugin (overall a 20 mins experiment). Exciting!
All you have to do is to follow @normen instructions here.
Use it with the GroundFromSpace material. you need to create a tgr with two output textures named as m_Diffuse1 and m_Diffuse2, and assign the GroundFromSpace.j3md to the loaded material (this is done in the PlanetRenderer class).
Cheers.
Whoa, cool 8) You saw that you can use tgr files like textures in j3m files now? I think that should become the preferred way of using the tgr loader.
Cheers,
Normen
Amazing. And I agree, it is more flexible that way. Great!
Screenshots look amazing, look forward to trying it out tonight
Cool!!!
Can I use your code for my project, jiyarza?
Yes, use it at your will.
@jiyarza: I’d also like to use your planet for the animated jMonkeyPlatform intro screen, I hope you dont mind:
Its also featured in the new jME video as you might have recognized
Cheers,
Normen
Edit: Maybe I would even use one of your songs, would that be ok too?