so I bought a Chromebook lately and apparently there's no way to run Oolite on this machine (unless I go in developper mode but I'd like not to do that). It is a shame because it's my only machine with decent GPU power.
Google's philosophy is to do everything in the browser, including gaming. And WebGL is supposed to be the way to go.
Rewriting Oolite completely in WebGL would be a huge endeavor, but I'd be happy to have at least pieces of working code to experiment with. WebGL is also an interesting technology per se. So I started learning about it and tried to render Oolite's models with it.
Here is for instance my attempt at modelling the Cobra Mk.III
As you can see the texture is messed up, but it's encouraging for a first attempt. Fixed: Ok I have a better grasp on how textures work now. Just need to write a script to automate the mapping from the .dat.
I will report progress on this thread if it raises interests.
Hmm... I've made some professional webgl application in 2012 (nuclear plant decommissioning software prototype) with the gecko engine.
At the time, my biggest limitation was the size of the models and textures (download time, size in memory, limited speed of manipulation). Is this better now?
My Oolite installation uses something like 4gb of ram...
My conversion script seems to be working fine, and I finally understood how to show several models in the same screen without reloading all the buffers.
A very difficult part was to preload all texture images. If I don't some models just don't show up.
Thanks to this guy who provided a weird, yet efficient solution.
Six ships so far : Anaconda, Asp, Boa, CobraIII, constrictor and krait. Adding a ship only takes a few seconds but I'll focus on the Coriolis station from now on.
Since this is HTML5, it is totally possible to add those to the Oolite website for decoration purpose. Feel free to do so.
I can try, but I'm not sure where they are or how to identify them.
In the 1.82 release Resource folder, look inside Models for oolite-*.dat and inside Textures for oolite-*.png files. These are the ones Oolite uses at the moment.
I can try, but I'm not sure where they are or how to identify them.
In the 1.82 release Resource folder, look inside Models for oolite-*.dat and inside Textures for oolite-*.png files. These are the ones Oolite uses at the moment.
It seems that they are much bigger. cobra3_redux.dat has less than 15 vertices while oolite_cobra3.dat has more than a thousand.
The format is also a bit different (the first field in the TEXTURES section is just 1 for oolite_cobra3.dat, which was unexpected).
It will require some tweaking but it's doable.
Also, I remember now that I did not use oolite_cobra3.dat because it provides a reference to two 'materials' called 'Gun' and 'Hull' and no obvious reference to textures. And I don't know how to deal with materials yet.
Also, I remember now that I did not use oolite_cobra3.dat because it provides a reference to two 'materials' called 'Gun' and 'Hull' and no obvious reference to textures. And I don't know how to deal with materials yet.
For textures corresponding to materials, check shipdata.plist in the Config folder. It is not entirely straightforward, but all the information is there. For example, cobra3-trader has a like_ship reference to oolite_template_cobra3-trader, which in turn has a like_ship reference to oolite_template_cobra3, which references the Hull and Gun materials as having diffuse maps oolite_cobra3_diffuse.png and oolite_cobra3_subents.png respectively. It can work in similar way for the rest of the ships.
The following wiki pages describe the related config files:
[wiki]Materials in Oolite[/wiki]
[wiki]Shipdata.plist[/wiki] Subentities will be your next challenge.
The trick is the textures use alpha channel (I guess for emission or the sorts). By just replacing it with 1.0, you're mainly discarding its use (well, at least until there is something useful to do with it later ).
The 1.8+ cobra3 in your image looks wrongly UV mapped. The easiest way to fix it (another hack ) is to replace all the "1"s in the first column for the TEXTURES section of the .dat file with 0 (that is to make it single texture), and use only the diffuse (hull) texture. The gun will be textured a bit weird, but the main hull will look OK (this is what I used to get the model converted for Blender -- whole UV map is better than no UV map).
The trick is the textures use alpha channel (I guess for emission or the sorts). By just replacing it with 1.0, you're mainly discarding its use (well, at least until there is something useful to do with it later ).
That does work indeed:
Thanks. With this I may be able to render the Coriolis station. And if I have a Coriolis station and the ships, I can do a big part of the gameplay in space.
The 1.8+ cobra3 in your image looks wrongly UV mapped. The easiest way to fix it (another hack ) is to replace all the "1"s in the first column for the TEXTURES section of the .dat file with 0 (that is to make it single texture), and use only the diffuse (hull) texture.
The problem is that I thought what I did was amounting to doing exactly this. Apparently not.
I'm very much confused by what happened to the 1.8+ cobra3. I need to think on it hard to understand what's wrong.