Griff ships with player-defined decals

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

Moderators: winston, another_commander

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

Post by Griff »

El Viejo wrote:
Question... how difficult would it be to add a paint colour to the underside of the Cobra?


It's a very minor thing, but it would complete the 'look'.
It's not too difficult if you're fairly happy working with colour and alpha channels in an image editing program like photoshop or paintshop pro or GIMP, if you're not, don't worry you'll soon pick it up after a bit of head scratching, it's not too complex.
basically, this cobra shader uses 2 single colour image maps (similar to greyscale images) to work out where the paint is to go, how it works is these single colour images are recoloured using the paint value in the shipdata.plist and added into the final texture, black of course has RGB values of 0,0,0 and if you add 0 to a value there's no change, so basically in the paintmaps any bits that are are black don't get any paint applied (even though the shader has to actually calculate paint vales for every bit of the ship - one of the reasons that paintmaps are switched off in simple shader mode)
The 2 paintmaps are both in the Griff_cobra_mk3_mainhull_effects.png image, 1 is in the green channel and the other is in the alpha channel. a free program called XnView has a really handy extract channel command that will let you split out the green and alpha channels from the texture, so you can work on them or i could post up my texture file with the layers all seperated out if you'd like to work from that, basically you'll need to paint in some colour into the parts of the paintmap that coincide with the bottom of the hull

edit: i think i might have over complicated things, you could just use xnview to split the alpha from Griff_cobra_mk3_mainhull_diffuse_spec.png and save it somewhere for safekeeping whilst you recolour the rest of texture map in paint or gimp and then use GIMP to add the alpha channel back into the texture and resave it ready for Oolite
Last edited by Griff on Wed Feb 24, 2010 4:40 pm, edited 1 time in total.
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:

Post by Cody »

Thanks, I'll look into GIMP and maybe start to experiment.
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
Selezen
---- E L I T E ----
---- E L I T E ----
Posts: 2530
Joined: Tue Mar 29, 2005 9:14 am
Location: Tionisla
Contact:

Post by Selezen »

If it's any use, Inkscape can generate some lovely PNGs without any effort at all! If there's no background colour set on the canvas (i.e. no shape drawn as a background colour) then the "export as bitmap" option will generate a transparent PNG by default.
Chrisfs
---- E L I T E ----
---- E L I T E ----
Posts: 433
Joined: Sun Sep 20, 2009 10:24 am
Location: California

Post by Chrisfs »

Yeah for DeadHead Cobbies!

http://www.kpfa.org/archive/date/2010/02/20

DeadHead Marathon
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:

Post by Cody »

Chrisfs wrote:
Yeah for DeadHead Cobbies!
Just for you Chrisfs... and any other Dead Heads out there.

Image
Last edited by Cody on Sun May 02, 2010 12:50 am, edited 1 time in total.
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: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Here's a quick guide on cuttting out a decal (if your lucky enough to have a decal image sitting on a plain colour background!)

1.
Image
Here's our decal, what a sexy dude, we need to cut around those fine chiselled features for our decal and we need to do it fast, we've got narcotics to trade.

2.
Image
GIMP has a neat tool called 'select by Colour'which will help us out here, click on it, then click on an area of background in your decals image
http://docs.gimp.org/en/gimp-tool-by-color-select.html

3.
Image
Use the magnifying tool to zoom in a bit closer so we can check out the selection (when using the magnifying glass you can hold down shift and click to zoom out). If you notice, the selected area hasn't quite reached the edges of our decal, if we cut out the background now we'll have a nasty red halo around our artwork, well, we could start faffing about with the threshold settings on the Colour Select tool, but a quicker way would just be to grow the selection by 1 or 2 pixels

4.
Click on 'Select' from the top menu, then Grow, a 'Grow Selection' options box will appear, in this case i'm going to only grow the selection by 1 pixel, so i'll click OK
Image
there, that looks like it's done the trick, now go to 'Edit' on the top menu and choose 'Cut'

5.The background of your image will change to a chessboard pattern, this is just GIMP's way of showing you that the pixels there are now transparent, if you still have some stray areas of background you need to get rid of, like in this part of the image here:
Image
First go back to 'Select' on the top menu and choose 'None' to remove our previous selection, then Select the Eraser tool, http://docs.gimp.org/en/gimp-tool-eraser.html
choose a small brush size (1 or 2 pixels) and a high opacity so you don't have to keep drawing over the pixels many times watching them slowly fade away with each stroke, a high opacity eraser will wipe them pixels out in no time at all!
Image

6. once you're done, we just need to save our final image as a png for Oolite, go to 'File' on the top menu, then 'Save as'
in the Save as options box, expand the 'Select File type' options by clicking on the +, then scroll down and select PNG image from the list, double check your file name and the 'Save in Folder' location then click Save
Image

7. And now we find out that for somebody writing a tutorial, he knows very little about image saving, after clicking save, you will see these options appear, suprisingly in my case, i don't know what they do.
Image
when i was testing this out, i un-ticked the 'Save background colour' and the 'Save color values from transparent pixels' - i ended up with a suitable png for Oolite but i don't know if you're supposed to untick those 2 options or not, they seem related to transparency and it doesn't hurt to untick them, everything else i left at default.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Griff,

is there anyway to make the decals glow (as per your other whizzy lighting effects)?

I may have asked this before... :?
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
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:

Post by Cody »

Thanks for the tutorial, Griff. I'll try and make good use of it.
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: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

DaddyHoggy wrote:
Griff,
is there anyway to make the decals glow (as per your other whizzy lighting effects)?
I may have asked this before... :?
I'm not sure, it should be possible i'll have another look at the code, the decals are handled a bit differently in these shaders, at the moment the decal texture gets mixed into the colour texture before the lighting is calculated (so that it gets proper lighting and shadowing along with the bit of hull texture it's being superimposed onto) glow maps work by being mixed into the texture after the lighting has been calculated so it looks like they're emitting light since the pixels in the glowmap don't get dimmed like all the others do, i'll have a study to see if the 'decal texture mixing into the colourmap' order can be moved to a point in the shader after the lighting is calculated - it's a really nice idea - especially for the pirate decals - it would be nice to get the hazzard symbol decals glowing all radioactive!
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Griff wrote:
DaddyHoggy wrote:
Griff,
is there anyway to make the decals glow (as per your other whizzy lighting effects)?
I may have asked this before... :?
I'm not sure, it should be possible i'll have another look at the code, the decals are handled a bit differently in these shaders, at the moment the decal texture gets mixed into the colour texture before the lighting is calculated (so that it gets proper lighting and shadowing along with the bit of hull texture it's being superimposed onto) glow maps work by being mixed into the texture after the lighting has been calculated so it looks like they're emitting light since the pixels in the glowmap don't get dimmed like all the others do, i'll have a study to see if the 'decal texture mixing into the colourmap' order can be moved to a point in the shader after the lighting is calculated - it's a really nice idea - especially for the pirate decals - it would be nice to get the hazzard symbol decals glowing all radioactive!
Oddly enough that's exactly what I was thinking! (Re:RadHaz) And pirates would want you to know they were coming, perhaps get you to dump cargo without firing a single shot? (I was also thinking about some pimped up ships with perhaps some glowy flame effects added as Decals...)
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
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

Post by Griff »

maybe rock hermits would paint glowy symbols on their asteroids to mark them as theirs in case they float off into another hermits patch of space, like sheep farmers :lol:
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:

Post by Cody »

Downloaded GIMP today… the first time I’ve seen it.
Followed Griff’s tutorial as above… when I come to the cut stage, the background doesn’t go to a checkerboard pattern, it just goes white and this remains in the decal.
Can anybody tell me what I’m doing wrong?
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
Corny
---- E L I T E ----
---- E L I T E ----
Posts: 363
Joined: Sun Dec 20, 2009 11:50 am
Location: (northern) Germany

Post by Corny »

You probably didn't activate the alpha channel (Layer -> Transparency)
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:

Post by Cody »

Got it! Thank you sir.
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
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:

Post by Cody »

Ahh... that's better. Thanks for the help, all.

Coyote rides again!

Image
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!
Post Reply