Page 6 of 11

Re: About planets

Posted: Sat Apr 14, 2012 11:50 am
by Eric Walch
submersible wrote:
[I've noticed too that planetinfo.plist "texture"="my_texture.png"; yields a planet with the default white material - no errors in log. This is plaguing my effort with materials and shaders too which are now exhibiting the same problem. I suspect I'm calling [_planetDrawable setMaterial] either at the wrong time , or that somehow the material is destroyed before planetDrawable renderOpaqueParts is called.
I noticed that moons have a texture, but (secundary) planets are white as you say. So it seems atmosphere related. When asking for 'system.planets[x].texture', I do get the right name for the white planets.

Re: About planets

Posted: Sat Apr 14, 2012 12:49 pm
by Kaks
I haven't got round to see what happens there yet, but chances are that whenever you assign a texture the atmosphere is recreated as a white blanket covering the perfectly rendered texture underneath...

Re: About planets

Posted: Sat Apr 14, 2012 7:53 pm
by Eric Walch
Kaks wrote:
I haven't got round to see what happens there yet, but chances are that whenever you assign a texture the atmosphere is recreated as a white blanket covering the perfectly rendered texture underneath...
Probably true. When de-activating the new_atmosphere in line 29, the texture is visible again. So, submersible can experiment further with textures by making a build without the atmosphere, until the atmosphere is working properly.

Re: About planets

Posted: Sun Apr 15, 2012 12:49 pm
by Kaks
Postponing the lightmapping bit in favour of more atmosphere texturing stuff! Lightmaps will come though! :)

Re: About planets

Posted: Sun Apr 15, 2012 3:22 pm
by JensAyton
As I asked elsewhere:
Ahruman wrote:
By the way, have you guys played with the PERLIN_3D macro? That mode was intended to be the “real” new planets; as far as I remember it was turned off because I was researching faster 3D noise functions. (3D noise doesn’t have distortion problems towards the poles, and it can be mapped onto cube maps more usefully than the current approach.)
To my eye, the 3D noise mode needs some work (less steep mountains, less medium-frequency contribution to the height map) but the result is significantly better.

Re: About planets

Posted: Sun Apr 15, 2012 4:24 pm
by Kaks
Haven't touched the noise generator yet, just working towards getting the other wrinkles (like the Mysterious White Balls) ironed out at the moment! :D

Re: About planets

Posted: Sun Apr 15, 2012 9:53 pm
by submersible
Kaks wrote:
Haven't touched the noise generator yet, just working towards getting the other wrinkles (like the Mysterious White Balls) ironed out at the moment! :D
The mystery of the White Balls certainly seems to be in part related to NEW_ATMOSPHERE, with it switched off , I'm back to the problem of (what appears to be) light vector or normals with planet + synthesized material. I think one of the previous videos I posted shows that problem.

Interestingly - it looks to me like OOPlanetEntity initFromDictionary is called more often than I would expect, as in called 3 times in a row for the same planet. I need to investigate more.

I should have a reference OXP uploaded in a day or two so anyone else interested has a set of consistent maps to refer to.

Re: About planets

Posted: Sat Apr 28, 2012 7:55 am
by submersible
AHA - OOPlanetEntity.m , setTextureFileName when the argument textureName is not nil , the atmosphereDrawable never has it's material set, so the entity has an atmosphereDrawable with a nil material - hence ending up with the default white material.

My suggestions for a material model for planets based on my reading of trunk..,

I think this approach would provide the ability to specify either or both planet surface and atmosphere textures, and allow for materials and shaders to extend this - also makes for a sensible fallback when materials/shaders are not available, much like the behaviour of ship material definitions

Code: Select all

"0 47" = {
  texture = "some_texture.png";
  atmosphere_texture = "some_atmosphere.png";
  materials = {
    "some_texture.png" = { // some_texture.png becomes the fallback diffuse map
        diffuse_map = "special_some_texture.png";
    };
    "some_atmosphere.png" = { 
        diffuse_map = "some_atmosphere.png";
        specular_map = { name="some_atmosphere.png"; extract_channel="a"; };
    };
  };
  shaders = {
    "some_texture.png" = {
      /* vertex_shader fragment_shader , etc
    };
  };
};
My current todo list for OOPlanetEntity
  • Support both 'texture' and 'atmosphere_texture' as planetinfo.plist keys for a planet
  • Add JS binding for 'setAtmosphereTexture' ala 'setTexture'
  • Split setTextureFileName / setUpPlanetFromTexture into surface and atmosphere specific methods
  • Use the given 'texture' or 'atmosphere_texture' as the key to look for 'materials' and 'shaders' in the planet's dictionary
  • Shader Uniform binding for radius/atmosphere_radius
And so I dive back into the code.

Shady Planet

Posted: Fri May 18, 2012 2:08 pm
by submersible
Quick screenshot from my working copy with what I believe is the world's least optimized atmosphere shader.
Image

Re: Shady Planet

Posted: Fri May 18, 2012 2:25 pm
by SandJ
submersible wrote:
Quick screenshot from my working copy with what I believe is the world's least optimized atmosphere shader.
Ooh, that's nice. Gotta love the green aurora at the pole, too.

Re: About planets

Posted: Sat May 19, 2012 2:44 pm
by Griff
Oo, that looks great! I've got to admit i always get a little shiver of excitement when i see this thread bumped back up the board :D

Re: About planets

Posted: Mon May 21, 2012 1:42 pm
by submersible
Griff wrote:
Oo, that looks great! I've got to admit i always get a little shiver of excitement when i see this thread bumped back up the board :D
Well you'll certainly like these shots of a modified griff_earth.fragment (minus the rimlight) , with a tasty atmosphere. I think I have the directional scattering part working now too which makes for a nice sunrise.
http://assets.povray-planets.org/static ... te-150.png
http://assets.povray-planets.org/static ... te-151.png
http://assets.povray-planets.org/static ... te-152.png

Re: About planets

Posted: Mon May 21, 2012 1:45 pm
by Cody
That #150 is a beautiful image... sweet!

Re: About planets

Posted: Mon May 21, 2012 1:49 pm
by Disembodied
submersible wrote:
Well you'll certainly like these shots of a modified griff_earth.fragment (minus the rimlight) , with a tasty atmosphere. I think I have the directional scattering part working now too which makes for a nice sunrise.
Outstanding. The only problem I foresee is getting people to tear themselves away from the view long enough to play the game!

Re: About planets

Posted: Mon May 21, 2012 3:57 pm
by cim
Disembodied wrote:
submersible wrote:
Well you'll certainly like these shots of a modified griff_earth.fragment (minus the rimlight) , with a tasty atmosphere. I think I have the directional scattering part working now too which makes for a nice sunrise.
Outstanding. The only problem I foresee is getting people to tear themselves away from the view long enough to play the game!
What, you mean sitting in clear space with nothing on the scanner just admiring the planet isn't part of the game? (I can see myself doing quite a bit of this in future - excellent work, submersible!)