Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

About planets

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: About planets

Post 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.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: About planets

Post 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...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: About planets

Post 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.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: About planets

Post by Kaks »

Postponing the lightmapping bit in favour of more atmosphere texturing stuff! Lightmaps will come though! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: About planets

Post 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.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: About planets

Post 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
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: About planets

Post 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.
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: About planets

Post 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.
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Shady Planet

Post by submersible »

Quick screenshot from my working copy with what I believe is the world's least optimized atmosphere shader.
Image
Last edited by submersible on Sat Mar 31, 2018 11:30 pm, edited 1 time in total.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Shady Planet

Post 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.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: About planets

Post 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
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: About planets

Post 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
Last edited by submersible on Sat Mar 31, 2018 11:31 pm, edited 1 time in total.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16078
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: About planets

Post by Cody »

That #150 is a beautiful image... sweet!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6884
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: About planets

Post 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!
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: About planets

Post 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!)
Post Reply