Progress

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Killer Wolf wrote:
far too late for that.
Not really, it’s the same each time.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

As of r3134, Oolite supports greyscale+alpha PNGs for textures. I think this means Oolite now handles all valid PNG formats and is therefore truly PNG-compliant, but I haven’t tried any test suites.

This format uses half as much memory as an RGBA texture of the same size and is primarily useful for shaders which happen to need 4 × N + 2 texture channels. Greyscale+alpha PNGs are loaded in GL_LUMINANCE_ALPHA mode, which means the r, g and b vector components are all the grey channel and the a component is the alpha channel. Exactly what you’d get if you converted the PNG to RGBA, in other words.

Most graphics apps don’t support greyscale+alpha mode, but PNG optimizer tools like OptiPNG will automatically convert to greyscale+alpha when appropriate (i.e. when all pixels are grey and the alpha channel isn’t all 100 % opaque). This could cause problems for a non-compliant PNG reader like pre-3134 versions of Oolite, but is now a Good Thing from our perspective. Yay!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Debug flag handling for the console has been changed somewhat. Instead of using a bunch of magic numbers specified in a comment in the script, there are now symbolic constants, so you can do things like:

Code: Select all

console.debugFlags = console.DEBUG_BOUNDING_BOXES
New shader loading behaviour: when loading a shader in full mode fails (typically due to a syntax error), Oolite now tries to fall back to simple mode. Unfortunately, this currently does not happen when a shader is too complex to run on the current system. This behaviour can be suppressed with the debug flag DEBUG_NO_SHADER_FALLBACK.

Additionally, extra validation tests will be run if the debug flag DEBUG_SHADER_VALIDATION is set. This will catch certain types of inconsistencies between vertex shader and fragment shader, and log warnings about things that don’t break the shader on your system but might on others. The precise nature of this validation is implementation-defined.

I strongly recommend using DEBUG_NO_SHADER_FALLBACK and DEBUG_SHADER_VALIDATION all the time if you write shaders, so here’s a trivial OXP to set them at startup (assuming the debug console is active).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Implemented preliminary support for the emission_map (glow map) material property in non-shader mode. This requires the GL_ARB_texture_env_combine extension (which all but the most ancient systems will support; you can see your OpenGL extensions in Oolite’s log) and is disabled in reduced detail mode.

At the moment, emission_map cannot be combined with emission in non-shader mode. (In shader mode, the emission colour is multiplied with the emission map.) I expect to fix this.

Also, it is not possible to combine a cube-mapped diffuse map with a non-cube-mapped emission map in non-shader mode, while it is not possible to use a cube-mapped emission map with the default shader in shader mode. (You could work around this by using a custom shader.)

I intend to handle illumination_map and emission_and_illumination_map in non-shader mode by converting them to emission maps (i.e., premultiplying the illumination map with the diffuse map and adding to the emission map). This will also be done for emission_and_illumination_map in shader mode, and emission_and_illumination_map will be deprecated. Standalone illumination_map will not be deprecated, because it is potentially useful to save memory by using a single-channel illumination map with a full-colour diffuse map (although this advantage will be lost in non-shader mode). I also intend to add an illumination_color attribute to make single-channel illumination maps more useful.

Note: to convert an illumination map to an emission map in Photoshop or GIMP, put the diffuse map over it in a separate layer and use Multiply blend mode.
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Post by JazHaz »

Ahruman wrote:
Implemented preliminary support for the emission_map (glow map) material property in non-shader mode. This requires the GL_ARB_texture_env_combine extension (which all but the most ancient systems will support; you can see your OpenGL extensions in Oolite’s log) and is disabled in reduced detail mode.
Coo! My OpenGL configuration includes GL_ARB_texture_env_combine! 8) :D
JazHaz

Gimi wrote:
drew wrote:
£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

Ahruman wrote:
Killer Wolf wrote:
far too late for that.
Not really, it’s the same each time.
too late in that due to multiple reboots using the new 3131 which worked, the log was long gone.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

  •  New texture option extract_channel, which allows the use of a single channel of an RGBA PNG as a greyscale texture. The intended use is to extract one channel from an effect map for use in a non-shader-mode fallback, as in: emission_map = { name = "foo_effect_map.png"; extract_channel = "a"; };. Valid values are “r”, “g”, “b” and “a”. No effect on greyscale or greyscale+alpha textures. (This is in last night’s nightly.)
  • Specular highlights in non-shader mode now use “separate specular” mode, where the specular highlight is applied after the diffuse light colour is modulated with the diffuse material texture (which is also what happens in the default shader). Previously, the specular highlight was added to the diffuse light before modulating with the shader, making it impossible to have a bright specular highlight on a dark texture. This is essentially a fix for a bug in the earliest versions of the OpenGL specification, but it has to be enabled explicitly and Oolite wasn’t doing so.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

  • Full support for all meaningful combinations of emission and illumination maps and colours in non-shader mode. Test case: non-shady-griff-moray.oxp, requires griff_moray_normalmapped.oxp.
  • Material properties diffuse, specular, ambient and emission have been renamed to diffuse_color, specular_color, ambient_color and emission_color. The old names are still supported for compatibility.
  • New material property illumination_color. Modulates illumination map. Unlike emission_color, this has no effect if there is no corresponding map.
Last edited by JensAyton on Wed Apr 21, 2010 7:16 pm, edited 1 time in total.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

  • Cube-mapped diffuse maps without custom shaders are now mapped using vertex positions rather than normals. Assuming the mesh is properly centred on the origin, this gives a more predictable mapping. The sample OXP’s shader has been updated to do the same thing.
  • expandDescription() and expandMissionText() now take an optional dictionary of substitutions, as in:

    Code: Select all

    expandDescription("police-attack-warning", { "describe-Pirate" : "naughty person" });
  • The DEBUG_NO_SHADER_FALLBACK debug flag now has the additional effect of forcing all materials to use shaders in simple shader mode. (Without DEBUG_NO_SHADER_FALLBACK, non-smoothed objects without explicit vertex normals and with no custom shader, emission_map or illumination_map are rendered without shaders.)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Cube maps can now be used for planets. A planet texture six times as high as it is wide is assumed to be a cube map (explicitly specifying cube_map is neither necessary nor possible). Using a cube map for a planet resolves all known problems with planet texture mapping and is the recommended approach from 1.74 on.
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

Ahruman wrote:
Cube maps can now be used for planets. A planet texture six times as high as it is wide is assumed to be a cube map (explicitly specifying cube_map is neither necessary nor possible). Using a cube map for a planet resolves all known problems with planet texture mapping and is the recommended approach from 1.74 on.

Nice!

I like to see an example :)
It comes to late for Famous Planets. That's now entering Beta Phase and I have not the time to redo all the textures in the cube map style. But for System Redux2 it could be great.!
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

pagroove wrote:
I like to see an example :)
Quick and dirty, using the cubemap from Ahruman's cubemap test oxp (click thumbnail for full size):
Image
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

There seems to be an artefact right across the Caspian Sea, however.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

That’s a scaling artefact in my test texture.
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

Is there, by chance, a forth-coming script or tool to convert a "normal" 2x1 texture to a cube map?
Post Reply