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.