Page 2 of 13

Posted: Wed Feb 24, 2010 3:16 pm
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

Posted: Wed Feb 24, 2010 4:36 pm
by Cody
Thanks, I'll look into GIMP and maybe start to experiment.

Posted: Thu Feb 25, 2010 9:08 am
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.

Posted: Thu Feb 25, 2010 5:44 pm
by Chrisfs
Yeah for DeadHead Cobbies!

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

DeadHead Marathon

Posted: Thu Feb 25, 2010 8:23 pm
by Cody
Chrisfs wrote:
Yeah for DeadHead Cobbies!
Just for you Chrisfs... and any other Dead Heads out there.

Image

Posted: Thu Feb 25, 2010 11:02 pm
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.

Posted: Thu Feb 25, 2010 11:56 pm
by DaddyHoggy
Griff,

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

I may have asked this before... :?

Posted: Fri Feb 26, 2010 1:15 am
by Cody
Thanks for the tutorial, Griff. I'll try and make good use of it.

Posted: Fri Feb 26, 2010 9:21 am
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!

Posted: Fri Feb 26, 2010 10:45 am
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...)

Posted: Fri Feb 26, 2010 11:45 am
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:

Posted: Fri Feb 26, 2010 3:49 pm
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?

Posted: Fri Feb 26, 2010 3:59 pm
by Corny
You probably didn't activate the alpha channel (Layer -> Transparency)

Posted: Fri Feb 26, 2010 4:16 pm
by Cody
Got it! Thank you sir.

Posted: Fri Feb 26, 2010 4:48 pm
by Cody
Ahh... that's better. Thanks for the help, all.

Coyote rides again!

Image