The thing I'm having trouble is the shininess. When using materials entry Simon has used the same texture for both diffuse map and specular map producing a nice shiny metallic surface. When I do that with my copied fragment shader, it's not shiny any more . If I manually multiply specularLight with something like 5, the shine returns. I'm obviously not understanding something. Am I missing something obvious?
The only thing I have changed in the fragment file are these settings
OOSTD_DIFFUSE_MAP 1
OOSTD_SPECULAR 1
OOSTD_SPECULAR_MAP 1
OOSTD_NORMAL_MAP 1
OOSTD_EMISSION_MAP 1
and shipdata snippet looks like this:
Code: Select all
shaders = {
"carrierI.png" = {
fragment_shader = "ncc_carrier.fragment";
vertex_shader = "oolite-tangent-space-vertex.vertex";
textures =
(
"ncc_carrier.png",
"ncc_carrier-glows.png",
"ncc_carrier_n.png",
"ncc_name1.png"
);
uniforms =
{
uColorMap = { type = texture; value = 0; };
uNormalMap = { type = texture; value = 2; };
uEmissionMap = { type = texture; value = 1; };
uSpecularMap = { type = texture; value = 0; };
uTime = "timeElapsedSinceSpawn";
uHullHeatLevel = "hullHeatLevel";
};
};
};
Code: Select all
materials = {
"carrierI.png" = {
diffuse_map = "ncc_carrier.png";
specular_map = { name = "ncc_carrier.png";};
emission_map = { name = "ncc_carrier-glows.png";};
normal_map = { name = "ncc_carrier_n.png";};
};
};
I managed to make it work like this:
Code: Select all
materials = {
"carrierI.png" = {
diffuse_map = "ncc_carrier.png";
specular_map = { name = "ncc_carrier.png";};
emission_map = { name = "ncc_carrier-glows.png";};
fragment_shader = "ncc_carrier.fragment";
vertex_shader = "oolite-tangent-space-vertex.vertex";
textures =
(
"ncc_carrier.png",
"ncc_carrier-glows.png",
"ncc_carrier_n.png"
);
uniforms =
{
uColorMap = { type = texture; value = 0; };
uNormalMap = { type = texture; value = 2; };
uEmissionMap = { type = texture; value = 1; };
uSpecularMap = { type = texture; value = 0; };
uTime = "timeElapsedSinceSpawn";
uHullHeatLevel = "hullHeatLevel";
};
};
};