Space Bar Facelift

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

Moderators: winston, another_commander

Post Reply
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Space Bar Facelift

Post 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.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Space Bar Facelift

Post 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;
}
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Space Bar Facelift

Post by phkb »

Thanks a_c! New version with these changes is out now.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Space Bar Facelift

Post by Griff »

Awesome work guys, that looks fantastic!
Post Reply