fixed the shaders in Vector 1.3 OXP (see Griff's post about "Ahruman's later shaders" and now they seem to work, clean Latest.log and now I can see the ship.

Moderators: winston, another_commander
I strongly recommend not using macros like that. Since 1.73, the default shader uses two functions – CalcDiffuseLight() and CalcSpecularLight() – instead.Griff wrote:important note: if you copy and paste the above into your shaders, make sure you check for blank spaces after the \ at the end of every line in the light macro in the fragment shader (lines 74 - 79) - there musn't be any, if there are, your shader won't run and you'll have a whole load of errors in your log - basically nearly almost everyline in the shader will be flagged up as having an error in it
Closest to what you want is here, but its quite technical. Ahruman wrote it!Arexack_Heretic wrote:Could someone give me a redirect to a howto for normal maps?
I've been looking, but not very successfully. thanks:)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!Gimi wrote:Maybe you could start a Kickstarter Campaign to found your £4500 pledge.drew wrote:£4,500 though!<Faints>
Cheers,
Drew.
I think Griff has done one, or has previously linked to one done by somebody else.Arexack_Heretic wrote:Yeah, thanks. I've 'read' that dissertation, without understanding much of it... the technical talk was actually less confusing than visual examples. hehehe
I'm more looking for a tutorial like step-by-step overview of how to create a simple (! I'm not planning on doing anything complex...yet.) normal map.
Or bumpmap for that matter.
I'll just muddle on a bit. :p
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
There are several different costs to consider in this sort of question: texture storage, drawing set-up costs, per-vertex costs, and per fragment costs.Arexack_Heretic wrote:Say Griff,
would it be a bad idea to give my cargopods normal mapping etc,
system-resourcewise?
I had intentionally left them fairly simple, so that clouds of them would not lead to any slowdown problems,
but with the all the glowing debris clouds etc that are now possible, this concern seems a bit superceded by progress.
There must be some more in-depth posts about making normal maps somewhere on the boards, i've only managed to dig this one up though:Arexack_Heretic wrote:I'm more looking for a tutorial like step-by-step overview of how to create a simple (! I'm not planning on doing anything complex...yet.) normal map.
Or bumpmap for that matter.
I'll just muddle on a bit. :p
Code: Select all
materials =
{
"myship_diffuse_texture.png" =
{
normal_map = "myship_normal_map_texture.png";
emission_and_illumination_map = "myship_glow_map_texture.png";
emission_modulate_color = (160, 255, 160);
illumination_modulate_color = (180, 180, 200);
};
};
There has never been a released version where you could apply normal maps with custom shaders but not the material model.Griff wrote:The oolite bit of actually applying the normal map to the model has become a whole lot easier these days, you no longer need to write custom shaders
It works in simple mode too.Griff wrote:(although oolite's shaders setting will need to set to full *i think* in order to see the actual normal map effect in game)
Code: Select all
varying vec2 vTexCoord;
Code: Select all
textures =
(
"griff_coriolis_dock_diffuse.png",
"griff_coriolis_dock_normal.png",
{name = "griff_coriolis_dock_effects.png"; repeat_s = "yes";}
);
Code: Select all
uniforms =
{
uColorMap = { type = texture; value = 0; };
uNormalMap = { type = texture; value = 1; };
uEffectsMap = { type = texture; value = 2; };
uTime = "universalTime";
};
Code: Select all
// Uniforms from Oolite
uniform float uTime;
Code: Select all
// Set up a float to add to the texture coords in order to scroll them
float counter = mod(uTime * 0.25, 1.0);
Code: Select all
// set up the scrolling light map
float ScrollingIllumMap = texture2D(uEffectsMap, vec2(vTexCoord.s - counter, vTexCoord.t)).g;
Code: Select all
vTexCoord.s - counter
Code: Select all
float ScrollingIllumMapmask = texture2D(uEffectsMap, vTexCoord).r;
Code: Select all
vec3 ScrollingLampColour = vec3(0.7368, 1.0, 0.4736);
Code: Select all
(ScrollingIllumMap * ScrollingIllumMapmask)
Code: Select all
* ScrollingLampColour
Code: Select all
color += (ScrollingIllumMap * ScrollingIllumMapmask) * ScrollingLampColour;
Code: Select all
materials =
{
"accipiter_no_shaders.png" =
{
diffuse_map = "accipiter_diffuse.png";
emission_map = "accipiter_lights.png";
effects_map = "accipiter_effects.png";
};
vertex_shader = ahruman-generic-accipiter.vertex;
fragment_shader = accipiter-effects.fragment;
};