Page 1 of 1

Space Bar Facelift

Posted: Sun Feb 11, 2024 4:09 am
by phkb
Just creating an individual thread for this one.

The space bar was in need of a bit of a refresh, and it also has an external docking port as part of the model. And now, you can dock through it.

Image

Based on what is in the model, it looks like ships that dock through the external port are transported inside the station, along the short runway and then through the closed gate, so I've implemented that method in this case.

The facelift updates the station to use the default Oolite shaders, adds a new rock texture, adds normal and specular maps, and bumps up the resolution of the station in general. I also tweaked the emission map, to give the lights a real glow effect. Finally, I added some flashers to the standard dock, to help players find their way in.

I think everything is working now for standard ships. If I'm feeling adventurous tomorrow (or later today actually) I'll see what can be dock for big player ships docking at external ports.

SpaceBarFaceLift_1.3.oxz (v1.3)

With thanks to Nite Owl for spotting a mis-named file in the shipdata-overrides.plist file.

Re: Space Bar Facelift

Posted: Sun Feb 11, 2024 3:41 pm
by another_commander
The neon sign was problematic for me. It was inside a black rectangle and was not animating right. I had to adjust the shipdata-overrides.plsit definition a bit and applied the neon effect inside the shader handling the sign's color inside the original Random Hits oxp. Here are the changes I had to do:

shipdata-overrides.plist:

Code: Select all

"griff_spacebar_Arexack_Heretic_Neonsign" = {
	    materials = { 
			"A_H_neonsign_no_shader.png" = { 
				diffuse_map = "a_h_neonsign_no_shader2.png"; 
				specular_color = (0.1, 0.1, 0.1);  // Applies when specular map is not used (no shaders) 
				shininess = 0; 
				emission_map = "a_h_neonsign_no_shader2.png";
			}; 
		};		
		shaders = {
            "A_H_neonsign_no_shader.png" = {
                fragment_shader = "griff_spacebar_arexack_heretic_neon_sign.fragment";
                vertex_shader = "griff_spacebar_arexack_heretic_neon_sign.vertex";
                textures = ("a_h_neonsign_with_shader.png");	<-------------------- Changed line
                uniforms = {
                    uAnimationFramesMap = { type = texture; value = 0; };
                    uTime = "timeElapsedSinceSpawn";
                };
            };
        };
};

griff_spacebar_arexack_heretic_neon_sign.fragment (with comments explaining the changes):

Code: Select all

// Information from Oolite.
uniform sampler2D      uAnimationFramesMap;
varying vec2         vTexCoord;

void main()
{
    vec4 color = texture2D(uAnimationFramesMap, vTexCoord);
	color.rgb = pow(color.rgb, vec3(2.2));	// we must bring all texture colors to linear colorspace for shader manipulation
	color.rgb *= 10.0;						// neon-up baby!
											// normally we would want to add the line below in order to re-apply gamma
											// correction after doing maths with our colors:
	// color.rgb = pow(color.rgb, vec3(1.0 / 2.2));
											// but there is no need to apply the 1.0/2.2 correction here - this is done at the
											// end of rendering by the game engine
											// actually, it would be wrong to apply it here because we would be ending up
											// double-correcting for gamma
	
	if (color.a < 0.5)  discard;
	
	gl_FragColor = color;
}

Re: Space Bar Facelift

Posted: Sun Feb 11, 2024 10:04 pm
by phkb
Thanks a_c! New version with these changes is out now.

Re: Space Bar Facelift

Posted: Mon Feb 12, 2024 3:58 pm
by Griff
Awesome work guys, that looks fantastic!