Very good.
The behaviour is expected. v1.6 has switched to VisualEffects (introduced in Oolite v1.77) and replaces the jump sequence rings in Oolite. The effect can only be spawned on
.shipWillExitWitchspace
. The stretching happens because the shader uses a screen aligned quad with no further transformations in the vertex shader.
It is possible to pass the required screen resolution as uniform, although - in my eyes - it would make more sense to add a Oolite specific uniform which holds the screen resolution or at least the aspect ratio. For BGS it is not hard to add this, as the required structures are already available and even the uniform
ovSpecials
is already passed with a unused .z component which could be filled with the aspect ratio from BGS-M.js.
The changes would look like:
BGS-M.js
:
Code: Select all
this.shipWillExitWitchspace = function()
{
if(!this.bgsHyperFX || player.ship.docked) return;
system.breakPattern = false;
var a = worldScripts.Cabal_Common_Overlay.ovAdd({cclov_type:2,cclov_blend:8,cclov_id:"BGSHYPER",cclov_fx:"bgs_hyper",cclov_autoremove:1});
if(a){
if(system.isInterstellarSpace) this.bgsHyperControl[1] = 1;
else this.bgsHyperControl[1] = 0;
this.bgsHyperControl[2] = oolite.gameSettings.gameWindow.width/oolite.gameSettings.gameWindow.height; // added
a.shaderVector2 = this.bgsHyperControl;
}
};
and the new
bgs_hyper.vertex
:
Code: Select all
uniform vec4 ovSpecials;
varying vec2 vTexCoord;
void main(void)
{
float asp = clamp(ovSpecials.z,1.0,2.0);
vec2 s = vec2(1.0,asp);
vec4 Position = gl_Vertex;
gl_Position = vec4(Position.xy*s,0.0,1.0);
Position.x += 0.5;
Position.y += 0.5;
vTexCoord = Position.xy;
}