Griff's normalmapped ship remakes

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

Moderators: winston, another_commander

User avatar
Tichy
---- E L I T E ----
---- E L I T E ----
Posts: 345
Joined: Wed Jul 11, 2012 5:48 pm

Re: Griff's normalmapped ship remakes

Post by Tichy »

Griff wrote:
@Tichy - I couldn't find a fault with the fer-de-lance shader, oddly enough the op is at V1.0 - which is usually the bug filled version - my OXPs have to get up to about v1.2.45 or whatever until they start working :lol: Is there anything in the log about a shader failing to compile?
I checked, but there wasn't errors... :/
The strange thing is that I just cheated a savefile where I have your new Cobra 3 and changed it to the new F-d-l, and it worked... I'm the one that always have strange issues with shaders? :/ But I swear that when I bought regularly the F-d-l, it was always with the lights off, exactly like it looks in the shipyard... I'm confused...
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2481
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Griff's normalmapped ship remakes

Post by Griff »

ah, maybe you're flying around but the shader still thinks you're docked and has switched off the lights to save your ships battery going flat :lol: I know, sounds like i'm being a wiseguy but this is actually something the shader does, when the player is docked the alert level is set to 0 and the shader doesn't add the glowmap to the ship ( for more details see 'alertCondition on this page' http://wiki.alioth.net/index.php/Shader ... :_uniforms ) for some reason this might be happening whilst you're launched and flying about.

hmm, just grasping at straws here but did you make sure to use the player version of the fer-de-lance in your edited save file, it should be this one:

Code: Select all

    <key>ship_desc</key>
    <string>griff_normalmapped_ferdelance2013_player</string>
there's a small difference in how the 'alert level' lighting is coded in the player version compared to the non player or 'NPC' ship, it might be that there's a shader mixup happening between the npc and player versions

[blog post]
Since ships with fins were wildly popular over in our Elite Dangerous discussion thread recently, I thought i'd make one for Oolite. So that I don't end up with a backwards flying ship again (see griff gnat oxp) I thought i'd make a quick sketch before starting work on it, I never usually do this so it'll be interesting to see if it helps me make a ship model much faster than normal compared to my usual trial and error method.
This is the Ophidian from Angus Duggan's Elite A game for the BBC micro http://elite.acornarcade.com/ships/ophidian.htm
Image

edit: fixed typo's
Last edited by Griff on Sat Aug 17, 2013 5:57 pm, edited 1 time in total.
User avatar
Tichy
---- E L I T E ----
---- E L I T E ----
Posts: 345
Joined: Wed Jul 11, 2012 5:48 pm

Re: Griff's normalmapped ship remakes

Post by Tichy »

I found it!

It's the Respray_for_Griffs OXP. I removed it yesterday.

When I install it, the new F-D-L appears without lights.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Griff's normalmapped ship remakes

Post by Cody »

Griff wrote:
Since ships with fins were wildly popular over in our Elite Dangerous discussion thread recently, I thought i'd make one for Oolite.
Oh yes... we like fins on spaceships! The Ophidian, eh... looks good!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2481
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Griff's normalmapped ship remakes

Post by Griff »

With a bit of editing of Capt. Murphy's 'Respray_for_Griffs.js' script in his respray OXP - http://oolite.aegidian.org/bb/viewtopic.php?f=4&t=12024 I've got the new fer-de-lance working with it, first make a backup copy of your respray oxp, then go to the scripts folder and open Respray_for_Griffs.js in a text editor you need to insert this bit of code around line 687 one a new set of lines directly after the } on line 686 before the line break on line 687

Code: Select all

		if (dataKey ==="griff_normalmapped_ferdelance2013_player")
		{
			this.colours = [0.4];
			this.origColours = [0.4];
			this.shader = this.ferdelancenew2013Shader;
			this.material = this.ferdelancenew2013Material;
			this.decal = ["griff_player_decal.png",[-1.02,"0.395 0.44 8.6359"]];
			this.origDecal = ["griff_player_decal.png",[-1.02,"0.395 0.44 8.6359"]];
		}
That bit of code seems to check the players current ship to test if it's compatible for the respray OXP - the fact that I've got about 3 different versions of the fer-de-lance all with the same ship name is confusing the respray script (I think!)

Then scroll down to somewhere around line 917, there's a block of code here that sets the shader definitions for the script to use, make a bit of space for the new fer-de-lance and paste the following in

Code: Select all

//ferdelance New 2013
this.ferdelancenew2013Shader = {"griff_ferdelance_new2013_diffuse.png":{fragment_shader: "griff_ferdelance_new2013_PLAYER.fragment",textures:["griff_ferdelance_new2013_diffuse.png","griff_ferdelance_new2013_normal.png","griff_ferdelance_new2013_effects.png","griff_player_decal.png"],uniforms:{uColorMap:{type:"texture",value:0}, uNormalMap:{type:"texture",value:1}, uEffectsMap:{type:"texture",value:2}, uDecalMap:{type:"texture",value:3},uTime:"universalTime", alertlevel: "alertCondition", damage_amount: "damage", hull_heat_level: "hullHeatLevel", engine_power: "speedFactor", laser_heat_level: "laserHeatLevel", PaintColor1:{scale: 0.5,type: "randomUnitVector"}, Decal1_Scale_and_Position:{type:"vector",value:"0.395 0.44 8.6359"}, Decal1_Rotation:{type:"float",value:-1.02}},vertex_shader:"griff_normalmap_ships.vertex"}}
this.ferdelancenew2013Material = {"griff_ferdelance_new2013_diffuse.png":{diffuse_map:"griff_ferdelance_new2013_diffuse.png",emission_map:{extract_channel:"a",name:"griff_ferdelance_new2013_normal.png"},emission_modulate_color:[0.9926,0.9686,0.9926],shininess:7,specular_color:[0.6,0.5,0.5]}};
save the file and restart Oolite with the shift key held down until the title screen appears to force Oolite to re-read in all your OXP files and scripts, otherwise it won't spot your edits

edit: missing " " around the decal texture name in the above bit of code!
Last edited by Griff on Sun Aug 18, 2013 10:57 am, edited 3 times in total.
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Griff's normalmapped ship remakes

Post by Disembodied »

Griff wrote:
Since ships with fins were wildly popular over in our Elite Dangerous discussion thread recently, I thought i'd make one for Oolite. So that I don't end up with a backwards flying ship again (see griff gnat oxp) I thought i'd make a quick sketch before starting work on it, I never usually do this so it'll be interesting to see if it helps me make a ship model much faster than normal compared to my usual trial and error method.
Oh, yes, definitely! Ships with fins make perfect sense in Oolite, because the ships all use magic reactionless drives: so if you enter the atmosphere, you don't need lift, but you might not say no to a bit of stability. It's glueing random fins onto ballistic ships that irks my inner pedant! ("Hey, we're all about science, us; physics and hard sums, yeah! Ooh, no, don't lift that, don't look under there, don't ask those questions ...") :)
User avatar
Tichy
---- E L I T E ----
---- E L I T E ----
Posts: 345
Joined: Wed Jul 11, 2012 5:48 pm

Re: Griff's normalmapped ship remakes

Post by Tichy »

@Griff: It worked. Thanks! Now I can even respray it. :)

(Anyway, I just noticed that the same happens with the new Cobra 3)
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Griff's normalmapped ship remakes

Post by Diziet Sma »

Tichy wrote:
(Anyway, I just noticed that the same happens with the new Cobra 3)
<chuckles> now you tell him.. :mrgreen:
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2481
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Griff's normalmapped ship remakes

Post by Griff »

There's going to be a few ships that don't work, most of the new stuff such as the wolf, bug, the mamba and cobraI alt versions probably won't work, i'll make a start on posting up the edits for the respray script to add them in - there's no way these edits could be saved as a .js file in the relevant ship oxp and somehow read in by Capt. Murphy's scripts is there? - sort of how you can use shipdata-overrrides.plist to add in extra settings to other ships?

anyway here's how to get the gnat oxp working
Ship check code: insert on new lines after the break on line 696 (although this is just to keep the list of ships in alphabetical order)

Code: Select all

		case "Gnat":
		this.colours = [0.28,0.26];
		this.origColours = [0.28, 0.26];
		this.shader = this.gnatShader;
		this.material = this.gnatMaterial;
		this.decal = ["griff_player_decal.png",[3.1,"0.72 0.765 12.0",3.05,"0.19 0.765 12.0"]];
		this.origDecal = ["griff_player_decal.png",[3.1,"0.72 0.765 12.0",3.05,"0.19 0.765 12.0"]];
		if (dataKey === "griff_gnat_player_alt_paintmap")
		{
		this.colours = [0.28,0.26];
		this.origColours = [0.28, 0.26];
		this.shader = this.gnataltpaintmapShader;
		this.material = this.gnatMaterial;
		this.decal = ["griff_player_decal.png",[3.1,"0.72 0.765 12.0",3.05,"0.19 0.765 12.0"]];
		this.origDecal = ["griff_player_decal.png",[3.1,"0.72 0.765 12.0",3.05,"0.19 0.765 12.0"]];
		}
		break;
Shader definitions code: insert on new lines in a suitable spot somewhere around line 920 or where ever makes the most sense to you - the ships in this bit of the code don't seem to be in alphabetical order, just don't paste this it in the middle of another ships definitions :lol:

Code: Select all

// Gnat
this.gnatShader = {"griff_gnat_diffuse.png":{fragment_shader: "griff_gnat_PLAYER.fragment",textures:["griff_gnat_diffuse.png","griff_gnat_normal.png","griff_gnat_effects.png","griff_player_decal.png"],uniforms:{uColorMap:{type:"texture",value:0}, uNormalMap:{type:"texture",value:1}, uEffectsMap:{type:"texture",value:2}, uDecalMap:{type:"texture",value:3},uTime:"universalTime", alertlevel: "alertCondition", damage_amount: "damage", hull_heat_level: "hullHeatLevel", engine_power: "speedFactor", laser_heat_level: "laserHeatLevel", PaintColor1:{scale: 1.0,type: "randomUnitVector"},PaintColor2:{scale: 1.0,type: "randomUnitVector"}, Decal1_Scale_and_Position:{type:"vector",value:"0.72 0.765 12.0"}, Decal1_Rotation:{type:"float",value:3.1},Decal2_Scale_and_Position:{type:"vector",value:"0.19 0.765 12.0"}, Decal2_Rotation:{type:"float",value:3.05}},vertex_shader:"griff_normalmap_ships.vertex"}}
this.gnataltpaintmapShader = {"griff_gnat_diffuse.png":{fragment_shader: "griff_gnat_PLAYER.fragment",textures:["griff_gnat_diffuse.png","griff_gnat_normal.png","griff_gnat_effects_alt_paintmap.png","griff_player_decal.png"],uniforms:{uColorMap:{type:"texture",value:0}, uNormalMap:{type:"texture",value:1}, uEffectsMap:{type:"texture",value:2}, uDecalMap:{type:"texture",value:3},uTime:"universalTime", alertlevel: "alertCondition", damage_amount: "damage", hull_heat_level: "hullHeatLevel", engine_power: "speedFactor", laser_heat_level: "laserHeatLevel", PaintColor1:{scale: 1.0,type: "randomUnitVector"},PaintColor2:{scale: 1.0,type: "randomUnitVector"}, Decal1_Scale_and_Position:{type:"vector",value:"0.72 0.765 12.0"}, Decal1_Rotation:{type:"float",value:3.1},Decal2_Scale_and_Position:{type:"vector",value:"0.19 0.765 12.0"}, Decal2_Rotation:{type:"float",value:3.05}},vertex_shader:"griff_normalmap_ships.vertex"}}
this.gnatMaterial = {"griff_gnat_diffuse.png":{diffuse_map:"griff_gnat_diffuse.png",emission_map:
{extract_channel:"a",name:"griff_gnat_normal.png"},emission_modulate_color:[0.9926,0.9686,0.9926],shininess:5,specular_color:[0.2,0.2,0.2]}};
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2481
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Griff's normalmapped ship remakes

Post by Griff »

OK, i think i've got the new cobra III oxp working, it's a bit confusing in there now with lots of different versions of the cobraIII being referenced, i can't remember which ones exist or not anymore so i've just added the ones from this oxp onto the end!

first add in these lines in the ship check part of the script (somewhere around line 666 - there's already some lines like this in there so just add the two after them)

Code: Select all

		if (dataKey === "griff_normalmapped_alt_cobra_mkIII_Multidecal_PLAYER_scuffed") {this.shader = this.cobra3altShaderscuffed;this.material = this.cobra3altMaterial; this.decal = false;this.colours = [0.07,0.28];this.origColours = [0.07,0.28];}
		if (dataKey === "griff_normalmapped_alt_cobra_mkIII_Multidecal_PLAYER_clean") {this.shader = this.cobra3altShaderclean;this.material = this.cobra3altMaterial; this.decal = false;this.colours = [0.07,0.28];this.origColours = [0.07,0.28];}
then scroll down and put these shader definitions for these ships right at the end of the script

Code: Select all

// player multidecal Cobra III (new scuffed & clean versions)
this.cobra3altShaderscuffed = {"griff_cobra_III_(alt)_mainhull_diffuse_scuffed.png":{fragment_shader: "griff_normalmapped_cobra_III_(alt)_multidecal_PLAYER_scuffed.fragment",textures:["griff_cobra_III_(alt)_mainhull_diffuse_scuffed.png","griff_cobra_III_(alt)_mainhull_normal_scuffed.png","griff_cobra_III_(alt)_effects_scuffed.png",{name:"griff_cobra_III_(alt)_player_multidecals.png", repeat_s:true}],uniforms:{PaintColor1:{scale: 0.07,type: "randomUnitVector"},PaintColor2:{scale: 0.28,type: "randomUnitVector"}, alertlevel: "alertCondition", damage_amount: "damage", engine_power: "speedFactor", hull_heat_level: "hullHeatLevel", uColorMap:{type:"texture",value:0},uDecalMap:{type:"texture",value:3},uEffectsMap:{type:"texture",value:2},uNormalMap:{type:"texture",value:1},uTime:"universalTime"},vertex_shader:"griff_normalmap_ships.vertex"}};
this.cobra3multidecalMaterial = {};

this.cobra3altShaderclean = {"griff_cobra_III_(alt)_mainhull_diffuse_scuffed.png":{fragment_shader: "griff_normalmapped_cobra_III_(alt)_multidecal_PLAYER_clean.fragment",textures:["griff_cobra_III_(alt)_mainhull_diffuse_clean.png","griff_cobra_III_(alt)_mainhull_normal_clean.png","griff_cobra_III_(alt)_effects_clean.png",{name:"griff_cobra_III_(alt)_player_multidecals.png", repeat_s:true}],uniforms:{PaintColor1:{scale: 0.13,type: "randomUnitVector"},PaintColor2:{scale: 0.2,type: "randomUnitVector"}, alertlevel: "alertCondition", damage_amount: "damage", engine_power: "speedFactor", hull_heat_level: "hullHeatLevel", uColorMap:{type:"texture",value:0},uDecalMap:{type:"texture",value:3},uEffectsMap:{type:"texture",value:2},uNormalMap:{type:"texture",value:1},uTime:"universalTime"},vertex_shader:"griff_normalmap_ships.vertex"}};
this.cobra3multidecalMaterial = {};
User avatar
Tichy
---- E L I T E ----
---- E L I T E ----
Posts: 345
Joined: Wed Jul 11, 2012 5:48 pm

Re: Griff's normalmapped ship remakes

Post by Tichy »

With this camoufage, the thargoids won't notice my ship :)
Image

(I can also hide myself in a camp of watermelons... :P )
User avatar
ZygoUgo
---- E L I T E ----
---- E L I T E ----
Posts: 406
Joined: Mon Nov 17, 2008 4:15 pm
Location: Blighty

Re: Griff's normalmapped ship remakes

Post by ZygoUgo »

If your wonderful models are ever trying to choke lesser systems, you could always make a simple model and bake a normal map from the high-detail model.
Chuck them both into xNormal and hey presto! *trying to make it seem easy* :D
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Griff's normalmapped ship remakes

Post by Svengali »

Griff wrote:
there's no way these edits could be saved as a .js file in the relevant ship oxp and somehow read in by Capt. Murphy's scripts is there? - sort of how you can use shipdata-overrrides.plist to add in extra settings to other ships?
The script doesn't need the hardcoded materials/shaders. It can read in the whole thing, apply it's changes and write it back for quite some time now.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2481
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Griff's normalmapped ship remakes

Post by Griff »

I've sort of mangled the paintmap code into a burning damage shader through a bit of trial and error in Rendermonkey!
Image
I've cobbled it into a test oxp, there's a savegame included in the zip, load that and you'll get a ship to test the shader with, launch from the station and switch to an external camera view then drain the energy banks by constantly using the ECM, when the energy falls to about 40% the effect will kick in - to be honest it looks a bit silly as when the ship builds it's energy back up all the burnt off paint comes back as good as new! :lol:

Damage shader ship test - https://app.box.com/s/cngnzyhjfl13rk34nqs4 about 2.5MB
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Griff's normalmapped ship remakes

Post by Diziet Sma »

The fading cockpit light was a nice touch.. 8)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Post Reply