Page 3 of 4

Posted: Sat Jul 03, 2010 11:38 am
by ADCK
Smivs wrote:
ADCK wrote:
I'm confused, why are you using an illumination map AND a emission map when you could merge the two and use emission_and_illumination_map or just a single emission map?

From http://wiki.alioth.net/index.php/Materials_in_Oolite
A texture whose RGB channels act like emission_map, and whose alpha channel acts like illumination_map (and can be coloured with illumination_modulate_color). This uses less memory (on systems with shaders) than using separate shaders, although blending the emission and illumination maps into a single emission map, as described above, is still preferable.
Hi ADCK,
I'm confused as well! :?
I'm trying to get all three elements working in a single map (diffuse map, illumination map and emission map) as per Ahruman's post further up, and I just can't get it to work.
I have got illumination_and_emission maps working (with a few minor glitches), but adding the diffuse map as the base layer just won't work for me for some reason.
I just find it easier to make each one seperately and then merge them. I have no training of any kind in any of this, so I'm learning as I go along, and tend to do things in the way that I find easiest. So currently I have seperate maps for everything, and I'm hoping to crack this soon so that I can merge them all into a single map for each model.
Perhaps you can advise.
Just to re-iterate I'm placing the diffuse map as the first layer in Normal mode, then adding the illumination map as the second layer in Multiply mode, and finally adding the emission map as the third layer in Lighten Only mode. This is using Gimp, following Ahruman's instructions further up this thread. It doesn't work. If I do this the illumination and emission elements are OK, but the base texture (diffuse map) doesn't show...the resulting ship has the default Oolite texture, except where the illumination is. Here it shows my texture.
Any thoughts? By the way, I should mention that my computer doesn't support shaders. Am I trying to do something my computer can't handle?
Eh, I see what you're doing wrong, Oolite can only handle two layers (1 base layer and 1 alpha channel) per image (as far as i know), if the emiision map and illumination map were combined into a single image it would work, but not as 3 seperate layers. But that would need custom shaders i think.

I think you misunderstood what Ahruman was saying, he meant combining the illumination map and emission map into a single-layered image AFAIK.

What I think he meant was:

...put the diffuse map in the bottommost layer, then the illumination map as second layer, choose multiply in 'mode' then choose 'merge down' in layers, then the emission map as yet another layer, choose 'lighten only' in 'mode' then choose 'merge down' in layers.

Posted: Sat Jul 03, 2010 11:51 am
by Smivs
Ah, that could be the answer.
I'll try that.
Fingers crossed that will work.
I'll let you know how I get on, and many thanks for the advice.

Posted: Sat Jul 03, 2010 11:52 am
by ADCK
I edited my post for more detail.

I dont think you can have a diffuse map and illumination map in the same image without custom shaders, I think Griffs ships do something similar, but thats too complicated for me.

Posted: Sat Jul 03, 2010 11:53 am
by Smivs
ADCK wrote:
I edited my post for more detail.
Yeah, just spotted that...it makes sense. Thanks again.

Posted: Sat Jul 03, 2010 12:00 pm
by ADCK
and edited my newer post too, (I love editing lol, never happy with what I write until I re-write it a thousand times)

I think it is possible to have all 3 images merged into a single image and working as you want, (don't quote me on that, i'm likely wrong) using a similar method to what Griff uses, but I wouldn't know how to do something that complicated, and It would need custom shaders probably.
Neolites also does something similar (but using channels) for the effects maps, where the Green channel is the specular map, the red channel an emission map for engine glows, the blue channel for window glows.
But that is also with custom shaders.

It would be easier to make it two images (and not require custom shaders), 1 diffuse map and 1 effects map, in my opinion.
And it would be alot easier to retexture/edit the image if you want to at a later date if they were seperate.
But that's just how I do things, and is a personal taste thing.

Posted: Sat Jul 03, 2010 1:17 pm
by Smivs
...put the diffuse map in the bottommost layer, then the illumination map as second layer, choose multiply in 'mode' then choose 'merge down' in layers, then the emission map as yet another layer, choose 'lighten only' in 'mode' then choose 'merge down' in layers.
OK, just tried that., and still not working, I'm afraid. The result of following your directions was a single layer image. Is that right? I'm still seeing the default texture, not my diffuse map.
So I tried making a new composite emission map by starting with the illumination map in multiply mode, then adding the emission map in Lighten Only mode, then merging down to make one layer. I saved this, then started a new image with the diffuse map (layer One) and added the new (composite) emission map as layer Two. This did the same (default texture visible, not mine), only the illumination element was far too bright this time as well.
I also tried my diffuse map and the composite emission map separately and that worked, but again with the illumination being too bright.

Posted: Sat Jul 03, 2010 1:34 pm
by ADCK
As I said above, combining a diffuse map/effects map in one image likely won't work without custom shaders.

I'd suggest using two seperate images (not merged or not two layers in one image. Two seperate files.), one being the diffuse map, and the other image the effects map
(the effects map would be the merged illumiation/emission map)

Posted: Sat Jul 03, 2010 1:41 pm
by Smivs
ADCK wrote:
As I said above, combining a diffuse map/effects map in one image likely won't work without custom shaders.

I'd suggest using two completely unrelated seperate images (not merged, not two layers in one image, two spererate files), one being the diffuse map, and the other image the effects map (the effects map would be the merged illumiation/emission map)
That's what I just tried - the diffuse map and the combined illumination and emission map (as described above) as two separate images. It IS working but the illumination element is too bright...there's a white-out effect instead of a gentle illumination. I've just been playing around with 'illumination_modulate_color' in the shipdata.plist to try to sort this out, but it doesn't seem to have any effect.

Posted: Sat Jul 03, 2010 1:43 pm
by ADCK
Smivs wrote:
ADCK wrote:
As I said above, combining a diffuse map/effects map in one image likely won't work without custom shaders.

I'd suggest using two completely unrelated seperate images (not merged, not two layers in one image, two spererate files), one being the diffuse map, and the other image the effects map (the effects map would be the merged illumiation/emission map)
That's what I just tried - the diffuse map and the combined illumination and emission map (as described above) as two separate images. It IS working but the illumination element is too bright...there's a white-out effect instead of a gentle illumination. I've just been playing around with 'illumination_modulate_color' in the shipdata.plist to try to sort this out, but it doesn't seem to have any effect.
Hmm, well for illumination maps, if you want to make it darker all you have to do is make the white in the illumination maps image greyer, the closer to black it is, the less bright it is.

Posted: Sat Jul 03, 2010 1:45 pm
by ADCK
can you post the materials section of your ship from the shipdata.plist so I can see what you're doing?

Posted: Sat Jul 03, 2010 2:10 pm
by Smivs
ADCK wrote:
Hmm, well for illumination maps, if you want to make it darker all you have to do is make the white in the illumination maps image greyer, the closer to black it is, the less bright it is.
That sounded familiar so I just tried it quickly, and it seems to be heading in the right direction...perhaps just a bit more fine tuning needed. One thing I've noticed is that I'm trying to illuminate a white logo and in direct sunlight this tends to disappear - all other elements of the graphic are illuminating as expected with various light levels. Perhaps I'll just use coloured or black logos.
ADCK wrote:
can you post the materials section of your ship from the shipdata.plist so I can see what you're doing?
This has varied depending on what images I've been using. I've got a Boa running at the moment, so the current one (which is now working) is:-

Code: Select all


materials = 
		{ 
			"boa_redux.png" = { 
diffuse_map = "smivs'-boa.png";
emission_map = "smivs'-boa_em-map.png";
                           };  
		};
where "smivs'-boa_em-map.png" is the combined illumination and emission map.

As I said above, I'm fairly confident that this is basically sorted and just needs a bit of fine-tuning, particularly the intensity of the illumination map which may need to be a bit darker still.
It seems from what you say that I will need to continue to use two images for now, but I'm happy with that...it's better than three and does give some flexibility for any future changes.
So, I'm a happy guy at last :D
Many, many thanks for your time and help.

Posted: Sun Jul 04, 2010 3:08 am
by ADCK
That material section if perfect at this stage, nice and simple.

When you're happy with what you've got you could then add stuff like the 'shininess' and 'specular' entries to make minor improvemnets to its look.

Have you considered using 'normal_map' ? it would increase it to 3 images, but a good normal map can vastly improve a ships appearance.
It's pretty easy to do, there's a plugin for normal mapping in gimp.
(But I think I remember you saying you don't have shaders on your PC, so you wouldn't be able to test it :P ... so nevermind that part.)

Posted: Sun Jul 04, 2010 5:58 pm
by Smivs
Yes, it's all working OK now (thanks again ADCK). Back on page 2 we were discussing THAT Python with the 'test' (ie totally s**t) illumination map. I've just re-done it using my new-found skills and a decent emission map and it looks a whole lot better :-

Image

Now, about specular and shininess.
I've had a quick look at the Wiki and I'm assuming I can't use a specular map as that'd be a third image, or can it be incorporated into the emission map I'm now using? What exactly is a specular map anyway?
Otherwise it looks as though some of this can be done by adding info to the 'materials' in the code...specifying colours etc, but again I'm hitting stuff I have no prior knowledge of.
Could you (ADCK if you're there) or anyone give me a push in the right direction. Perhaps an example or an explanation as to how this should be coded?
As always, any help is really appreciated. :)

Posted: Tue Jul 06, 2010 6:01 am
by ADCK
Shininess is pretty self explainatory, so i'll skip that, but specular is a little complicated. (I think it only works in shader mode too, so you might not be able to use it anyway)

specular_map is an image which changes how parts of your ship look when in direct sunlight, so you can specify areas that are reflective/shiny (like parts of ships like windows/metal plating/etc) and areas that are non-reflective/dull (eg you might not want decals to be reflective) and what color the reflected light is.

But since it requires shaders and using another image and is rather complicated, might as welll skip it. Oolite's default specular behaviour is pretty good anyway.

specular_color is what color the light reflected is, I don't know if this works in non-shader mode. but I usually use the following settings:

Code: Select all

specular_color = "1.0 0.7 0.5 1.0";
specular_color wont work if specular_map is specified.

I've never used specular_map before (only specular_color) so I can't really offer much advice there. Most of my experiance of using specular maps is from retexturing neolites ships and their specular mapping is handled very differantly than that of standard oolites.

Posted: Tue Jul 06, 2010 9:38 am
by Smivs
ADCK wrote:
Shininess is pretty self explainatory, so i'll skip that, but specular is a little complicated...
...specular_color is what color the light reflected is, I don't know if this works in non-shader mode. but I usually use the following settings:

Code: Select all

specular_color = "1.0 0.7 0.5 1.0";
.
Hi ADCK, just tried the specular color and it does seem to work, even on my non-shader computer. The effect was a bit strong but I've fiddled with the numbers and the effect is now quite nice. I've added a small amount of shininess as well. You were certainly right about this making an improvement, albeit a small one.
Yet again, thanks for the advice. :)