BPlanets

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: BPlanets

Post by Cholmondely »

Ditto!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: BPlanets

Post by Commander_X »

Nice to see some more opinions in the thread!
Regarding the dynamic generation of the maps, for those that are not so faint of heart, are managing correctly their kitchen sink, and know how to keep their cats away from any harm, here's a quick receipt that can be a starting point to move the map generation from inside Objective-C code (as done currently, and unfortunately on the CPU), in the fragment shader (which executes on the GPU):

Step 1. Make all your planets green -- in the oolite-default-planet.fragment file in your Resources/Shaders folder (of course don't forget to back-up, or even better, use an AddOns/Shader approach), add a

Code: Select all

normal = vec3(0, 0, 1);
right after

Code: Select all

#else
   vec3 normal = vec3(0, 0, 1);
#endif
(i.e. such that the above becomes

Code: Select all

#else
  vec3 normal = vec3(0, 0, 1);
#endif
  normal = vec3(0, 0, 1);
)
Similarly, comment out

Code: Select all

vec3 diffuseColor = diffuseMapSample.rgb;
and add

Code: Select all

vec3 diffuseColor = vec3(0.0, 1.0, 0.0);
right after (i.e. "transforming" the first line into two:

Code: Select all

// vec3 diffuseColor = diffuseMapSample.rgb;
vec3 diffuseColor = vec3(0.0, 1.0, 0.0);
)
Step 2. Let there be map - create/copy/adapt any favorite GLSL noise based sample you consider worthy to replace the new diffuseColor value (and deduce the new normal value from it)
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: BPlanets

Post by submersible »

Commander_X wrote:
2. The initial package has only Earth like variants. As mentioned above, I used Povray Planets as a source of inspiration, and tried to cover this initial type of planet. As a reference, I classified the G1 Povray Planets in 5 main types: Terran (119), Barren (115), Water (7), Winter (5), and Gas Giants (10).
To clarify Water and Winter are extremes of 'Continental' in the povray planets code, sometimes they're just overrun with polar ice or have minimal landmass.

Redspear wrote: Tue Jun 16, 2020 6:18 pm
Commander_X wrote: Tue Jun 16, 2020 2:33 pm
I have some ideas about how to deal with this...
I sort of cheated in Additional Planets and used real world cloud layers. I think there were 6 (or was it 8?) different layers that I used but I didn't fully exploit their potential.
Cheating is totally encouraged. I confess that the gas giants in povray planets are cheating because they are not entirely procedural. There is procedural turbulence and warping but it is driven by some iterative simulation output maps.

Image
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: BPlanets

Post by Commander_X »

submersible wrote: Sun Oct 18, 2020 2:25 pm
[...]
To clarify Water and Winter are extremes of 'Continental' in the povray planets code, sometimes they're just overrun with polar ice or have minimal landmass.
[...]
Good point, will check if I can tweak the shaders to provide for these two types, just like that ;)
submersible wrote: Sun Oct 18, 2020 2:25 pm
[...]
Cheating is totally encouraged.
[...]
I can hear you! But given the whole set of tricks Blender provides, if I find I need to use an external texture that can be "approximated" procedurally, I have the tendency to take the time to make that effort.
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: BPlanets

Post by Reval »

These look really spectacular. Nice work :)

Is BPlanets compatible with Habitable Planets and System Redux (which I currently have installed)? If so, I'll definitely give them a whirl...
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: BPlanets

Post by Commander_X »

I don't think it's "compatible".
From what I remember System Redux was used to populate/texture extra planets/moons, and thus it shouldn't interfere.
For Habitable Planets, although not sure (i.e. didn't test), it might just replace the first set of planets that are textured (some hundred or so in Galaxy 1).
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: BPlanets

Post by Reval »

Thanks again. I'll just give it a go, then, and see what can be seen :)

(which is really the whole fun of it anyway).
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: BPlanets

Post by submersible »

I've been reading the default planet shader and it looks like normal maps with cube map is supported. What makes me curious is how you've reproduced the 'hairy ball' tangent space with blender to get these awesome normal maps. I had always assumed that cube map normals would need to be object space or differential to object space.

Code: Select all

        
        /*      Fun sphere facts: the normalized coordinates of a point on a sphere at the origin
                is equal to the object-space normal of the surface at that point.
                Furthermore, we can construct the binormal (a vector pointing westward along the
                surface) as the cross product of the normal with the Y axis. (This produces
                singularities at the pole, but there have to be singularities according to the
                Hairy Ball Theorem.) The tangent (a vector north along the surface) is then the
                inverse of the cross product of the normal and binormal.
        */
#if USE_NORMAL_MAP
#if OOSTD_CUBE_MAP
        vec4 normalMapSample = textureCube(uNormalMap, vCoords);
#else
        vec4 normalMapSample = texture2D(uNormalMap, texCoords);
#endif
I really need to get oolite installed and try them - looks *really* interesting.
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: BPlanets

Post by Commander_X »

submersible wrote: Thu Dec 10, 2020 9:34 am
I've been reading the default planet shader and it looks like normal maps with cube map is supported. What makes me curious is how you've reproduced the 'hairy ball' tangent space with blender to get these awesome normal maps. I had always assumed that cube map normals would need to be object space or differential to object space.
[...]
It's really all about UV unwrapping. Once the UV map in Blender matches what Oolite expects, any baked texture will match (although, to be honest, I didn't try the equirectangular maps -- I hate with a passion the poles' distorsion -- but they work for another_commander's "<planet_in_Oolite> is <planet_in_Solar_system>" OXPs).
submersible wrote: Thu Dec 10, 2020 9:34 am
[...]
I really need to get oolite installed and try them - looks *really* interesting.
Ouch! :D

If interested, I can send the Blender file I'm trying to munch on for creating these maps. I think that will be the better distribution for this, considering the size of the files for _not-even-half_ of G1.
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: BPlanets

Post by submersible »

Commander_X wrote: Thu Dec 10, 2020 2:57 pm
If interested, I can send the Blender file I'm trying to munch on for creating these maps. I think that will be the better distribution for this, considering the size of the files for _not-even-half_ of G1.
No rush - same reason I don't have blender installed as oolite, not for work laptops. Povray in a container I can get away with. I will continue to follow this thread with interest.
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: BPlanets

Post by Commander_X »

Commander_X wrote: Thu Oct 08, 2020 4:17 pm
[...]
Step 2. Let there be map - create/copy/adapt any favorite GLSL noise based sample you consider worthy to replace the new diffuseColor value (and deduce the new normal value from it)
A quick (Oolite in-game) composition to test planet map generation in shaders:
Image

Considering the size of an unfinished G1 (+5G for 235 planets) using Blender, it might make more sense to try to pursue this avenue. There would be two more main goals to make this "official" -- 1 (easy) to bring in some more uniforms from planetinfo.plist (e.g. land_color, land_fraction, random_seed) to help with more variety; 2. (not so easy) to implement heightmap -> normal conversion in the shader.

Lower priority (or not quite so for some :) ): night lights, gas giant variants.
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: BPlanets

Post by Commander_X »

Whew, heightmap -> normalmap finally done! :)

Image
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2685
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: BPlanets

Post by Redspear »

Surface looks great but are they clouds?

My usual comment re clouds: more please! :D

Assumptions:
Blue = water = evaporation
Green = flora = transpiration
...and I'm no expert here but...
Crude assessment in presence of both = whacking great cloud layers sweeping AND swirling ominously through the firmament :P

Regardless, that's one cool looking texture 8)
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: BPlanets

Post by Commander_X »

Redspear wrote: Wed Jan 27, 2021 1:56 am
Surface looks great but are they clouds?
[...]
Them clouds are those provided by the OOTB (out of the box) game. :D
Here's a more cloudy example:

Image

These are from my attempt to "move" the planet textures creation in the shader. Even for only the diffuse + spec + normal, I'm not sure what would be the hit for older graphic cards. (Realistic) Clouds would be quite a high call at the moment.
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: BPlanets

Post by submersible »

Commander_X wrote: Wed Jan 27, 2021 2:15 am
These are from my attempt to "move" the planet textures creation in the shader. Even for only the diffuse + spec + normal, I'm not sure what would be the hit for older graphic cards.
Looking good!

Commander_X - are you doing this with code changes or using plists and providing the vertex/fragment shaders?
Post Reply