ee, that looks really odd to say the least!
Capt Kev, i'm not sure if that's the correct shader to use
try this as the dodo's fragment (from todays updated version of the oxp)
Code: Select all
varying vec2 vTexCoord;
varying vec3 vEyeVector;
varying vec3 vLight0Vector;
varying vec3 vLight1Vector;
varying vec3 v_normal;
// Constants
const float KspecExponent = 8.0;
// Uniforms from Oolite
uniform sampler2D uColorMap;
void Light(in vec3 lightVector, in vec3 lightColor, in vec3 eyeVector,
in float KspecExponent, inout vec3 totalDiffuse, inout vec3 totalSpecular)
{
lightVector = normalize(lightVector);
vec3 reflection = normalize(-reflect(lightVector, v_normal));
totalDiffuse += gl_FrontMaterial.diffuse.rgb * lightColor * max(dot(v_normal, lightVector), 0.0);
totalSpecular += lightColor * pow(max(dot(reflection, eyeVector), 0.0), KspecExponent);
}
#define LIGHT(idx, vector) Light(vector, gl_LightSource[idx].diffuse.rgb, eyeVector, KspecExponent, diffuse, specular)
void main()
{
vec3 eyeVector = normalize(vEyeVector);
vec3 colorMap = texture2D(uColorMap, vTexCoord).rgb;
float glowMap = texture2D(uColorMap, vTexCoord).a;
float specIntensity = 12.0 * colorMap.r * colorMap.r;
vec3 diffuse = vec3(0.0), specular = vec3(0);
#ifdef OO_LIGHT_0_FIX
LIGHT(0, normalize(vLight0Vector));
#endif
LIGHT(1, normalize(vLight1Vector));
diffuse += gl_FrontMaterial.ambient.rgb * gl_LightModel.ambient.rgb;
// Add in the glow map
diffuse += glowMap * 3.0;
// Calculate the lighting
vec3 color = diffuse * colorMap + specular * specIntensity;
gl_FragColor = vec4(color.rgb, 1.0);
}
and this as its vertex shader
Code: Select all
varying vec2 vTexCoord;
varying vec3 vEyeVector;
varying vec3 vLight0Vector;
varying vec3 vLight1Vector;
varying vec3 v_normal;
void main()
{
v_normal = normalize(gl_NormalMatrix * gl_Normal);
vec3 eyeVector = -vec3(gl_ModelViewMatrix * gl_Vertex);
vEyeVector = eyeVector;
#ifdef OO_LIGHT_0_FIX
vec3 light0Vector = gl_LightSource[0].position.xyz + vEyeVector;
vLight0Vector = light0Vector;
#endif
vec3 light1Vector = gl_LightSource[1].position.xyz + vEyeVector;
vLight1Vector = light1Vector;
vTexCoord = gl_MultiTexCoord0.st;
gl_Position = ftransform();
}
support for the tex0, tex1 bit at the top of the shader to get the texture files into the shader has been dropped or is due to be dropped by Oolite soon i think, there's a much more human friendly way of doing it in the shipdata.plist, the shaders bit for the dodo should now look something like this, first you list your texture png's, then you can link them using uniforms to the shader, i've chosen to use an uniform called "uColorMap" which is assigned to the texture, then referenced in the shader by using the same uniform name
Code: Select all
shaders =
{
"capt_kev_dodo_plain.png" =
{
vertex_shader = "capt_kev_dodo.vertex";
fragment_shader = "capt_kev_dodo.fragment";
textures = (
"capt_kev_dodo_plain.png"
);
uniforms =
{
uColorMap = { type = texture; value = 0; };
};
};
};
see if that makes it work better.
These 2 shaders above don't support normal mapping, do you have a bump map made for the station? if so i can send some new shaders that will be able to use it (the ones from the coriolis in the normal mapped shipset i'm working on)