Back to the age old question

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 23 years
Location: Altair

Back to the age old question

Post #1by Rassilon » 19.05.2002, 06:47

No one has ever answered me on this...maybe now I will get one I hope...

How do I create a PNG file that takes advantage of spectural mapping like the earth.png file? Photoshop obviously is incompatible with this format of PNG...so what painting program(s) do I need? And how are they created?

Thanks...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Matt McIrvin
Posts: 312
Joined: 04.03.2002
With us: 22 years 11 months

Alpha channel

Post #2by Matt McIrvin » 20.05.2002, 02:53

The gloss map is just the PNG's alpha channel, isn't it? If so, then there is no fundamental difference between this kind of file, and a cloud map with transparency. You'd create the gloss map in exactly the same way that you'd create the transparency map for a cloud, however that might be.

I don't have specific experience with Photoshop-- personally I use Graphic Converter and Painter on a Mac. With Graphic Converter there is an option to add an 8-bit alpha channel to any 32-bit color image, and you can draw and paste images into the alpha channel.

Matt McIrvin
Posts: 312
Joined: 04.03.2002
With us: 22 years 11 months

Alpha channel

Post #3by Matt McIrvin » 20.05.2002, 03:02

The gloss map is just the PNG's alpha channel, isn't it? If so, then there is no fundamental difference between this kind of file, and a cloud map with transparency. You'd create the gloss map in exactly the same way that you'd create the transparency map for a cloud, however that might be.

I don't have specific experience with Photoshop-- personally I use Graphic Converter and Painter on a Mac. With Graphic Converter there is an option to add an 8-bit alpha channel to any 32-bit color image, and you can draw and paste images into the alpha channel.

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 23 years
Location: Altair

Post #4by Rassilon » 20.05.2002, 04:35

Yeah you would think that an alpha1 is what the thing uses...In this case it is not so...In photoshop alpha1 is rendered b/w...The PNG file when loaded shows only the oceans layer...Land layer is nowhere to be found...

Not that I can see though...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 23 years
Location: Seattle, Washington, USA

Post #5by chris » 20.05.2002, 16:46

Rassilon wrote:Yeah you would think that an alpha1 is what the thing uses...In this case it is not so...In photoshop alpha1 is rendered b/w...The PNG file when loaded shows only the oceans layer...Land layer is nowhere to be found...

You can't see the land because it has an alpha value of 0, so it appears completely transparent in Photoshop.

Photoshop 6.0 seems to have a bug in it's handling of the completely transparent parts of images. I ended up writing a custom utility (for Linux) that merges two images--one for colors and another for alpha--into a single PNG.

--Chris

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 10 months
Location: Hamburg, Germany

Post #6by t00fri » 20.05.2002, 16:57

chris wrote:
Rassilon wrote:Yeah you would think that an alpha1 is what the thing uses...In this case it is not so...In photoshop alpha1 is rendered b/w...The PNG file when loaded shows only the oceans layer...Land layer is nowhere to be found...
You can't see the land because it has an alpha value of 0, so it appears completely transparent in Photoshop.

Photoshop 6.0 seems to have a bug in it's handling of the completely transparent parts of images. I ended up writing a custom utility (for Linux) that merges two images--one for colors and another for alpha--into a single PNG.

--Chris


But for Linux GIMP works perfectly with Alpha channels! GIMP for Windows also has a bug with alpha...

Bye Fridger

Guest

Post #7by Guest » 20.05.2002, 17:46

Damn...What can I do to use the linux version? Is linux that difficult to install?

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 23 years
Location: Altair

Post #8by Rassilon » 20.05.2002, 17:50

I other words if I have a free partition to use linux with will it mess with the other partition? I hear its possible to partition a segment of your HD to use solely with linux...

And what GUI should I use? And is it public domain or do I have to purchase it from the store?

Geez mon alot of questions eh :mrgreen:
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 10 months
Location: Hamburg, Germany

Post #9by t00fri » 20.05.2002, 19:57

Rassilon wrote:I other words if I have a free partition to use linux with will it mess with the other partition? I hear its possible to partition a segment of your HD to use solely with linux...

And what GUI should I use? And is it public domain or do I have to purchase it from the store?

Geez mon alot of questions eh :mrgreen:


Many people nowadays have Linux and Windows peacefully coexisting on the HD (so do I, and Chris, and...). The installation of the major Linux distributions (RedHat, SuSE, Debian, Mandrake) is virtually trivial meanwhile, with hardware in most cases being recognized automatically. The stability of Linux is unbeaten!
And /all/ Software is freeeeeee and nevertheless of very high standard;-).

You do not even need an unused partition for Linux, just reduce the spce for Windows somewhat by means of the usual software. Then start the Linux installation from the CD of directly from a server and the remaining space will be used for Linux automatically. The partitioning and formatting will be done under Linux. When you boot, there will then be a nice bootselector and you may chose Windows or Linux as the default, as you like.

Bye Fridger

Guest

Post #10by Guest » 20.05.2002, 20:13

chris wrote:You can't see the land because it has an alpha value of 0, so it appears completely transparent in Photoshop.

Photoshop 6.0 seems to have a bug in it's handling of the completely transparent parts of images. I ended up writing a custom utility (for Linux) that merges two images--one for colors and another for alpha--into a single PNG.

--Chris


Since I was in a hurry in my previous reply, once more a little more in detail:

If you want to merge in GIMP a rgb texture with an alpha channel (e.g. containing specular reflections, or level info (bumpmapping)), one proceeds as follows. Load your rgb texture (call it rgb.jpg) into GIMP, as well as the file for the alpha channel, 'alpha.jpg', say. Convert alpha.jpg into grayscale if it is not yet in this form (click Image/Mode/Grayscale). Next /decompose/ your rgb texture rgb.jpg as well into r,g,b, grayscale files by clicking Image/Mode/Decompose. Next, click on Image/Mode/Compose, then a dialog pops up, you activate RGBA mode and assign the three previous r,g,b grayscale files to the r,g,b channels and alpha.jpg to the alpha slot. Click return and your final picture comes up. Save it in whatever format you like, e.g. PNG or .tga if you want to convert it into DXT3 afterwards.

That's it. Works perfectly.

Bye Fridger

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 23 years
Location: Altair

Post #11by Rassilon » 20.05.2002, 22:38

Thanks again Fridger...

What I find to be distressing is that Adobe is supposed to be the best painting software out there for Win32 and it doesnt support alpha thresh hold 100%...

And I suspect by all of your answers there is no program, painting or otherwise that supports alpha 0 in Win32?

Okay Im off to look into Linux...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 23 years
Location: Seattle, Washington, USA

Post #12by chris » 20.05.2002, 22:53

Have you tried Paint Shop Pro?

Also, I can try an build my little alpha texture utility on Windows. It should be pretty straightforward.

--Chris

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 23 years
Location: Altair

Post #13by Rassilon » 20.05.2002, 23:02

I wondered if you could do that...Would it take two TGA files and combine and convert to PNG or possibly two PNG files? One for non specular...the other for alpha 0?

PSP I had at one time...Dont remember if it uses alpha 0, but its worth a shot :)

Thanks Chris!
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 10 months
Location: Hamburg, Germany

Post #14by t00fri » 20.05.2002, 23:22

Rassilon:

I have just checked GIMP for Windows as to bugs in connection with mounting rgb +alpha (8bit) into a PNG file. NO Problems!

You might really try GIMP first. It is so powerful and not hard to learn, notably if you know Photoshop!

Bye Fridger

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 23 years
Location: Altair

Post #15by Rassilon » 21.05.2002, 01:11

Yeah Im looking at gimp now...Nice program for shareware...

But sadly the PNG file in the channels tab only shows RGB...I will keep looking for alpha 0...

Now if I am to save a file as PNG with alpha 0...Would I use 2 seperate PNG files? Or is there some tutorials on the web on this issue...

Thanks Fridger!
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 10 months
Location: Hamburg, Germany

Post #16by t00fri » 21.05.2002, 14:23

Rassilon wrote:Yeah Im looking at gimp now...Nice program for shareware...

But sadly the PNG file in the channels tab only shows RGB...I will keep looking for alpha 0...

Now if I am to save a file as PNG with alpha 0...Would I use 2 seperate PNG files? Or is there some tutorials on the web on this issue...

Thanks Fridger!


This is perfectly correct! The alpha channel is never shown in the channels menue. On the gimp site there is an excellent tutorial/manual. Look further up, I have described the process in detail...

Bye Fridger

Guest

Post #17by Guest » 21.05.2002, 14:28

Rassilon:
------------

here is my description from the previous page.

If you want to merge in GIMP a rgb texture with an alpha channel (e.g. containing specular reflections, or level info (bumpmapping)), one proceeds as follows.
Load your rgb texture (call it rgb.jpg) into GIMP, as well as the file for the alpha channel, 'alpha.jpg', say. Convert alpha.jpg into grayscale if it is not yet in this form (click Image/Mode/Grayscale). Next /decompose/ your rgb texture rgb.jpg as well into r,g,b, grayscale files by clicking Image/Mode/Decompose. Next, click on Image/Mode/Compose, then a dialog pops up, you activate RGBA mode and
assign the three previous r,g,b grayscale files to the r,g,b channels and alpha.jpg
to the alpha slot. Click return and your final picture comes up. Save it in whatever format you like, e.g. PNG or .tga if you want to convert it into DXT3 afterwards.

That's it. Works perfectly.

Bye Fridger

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 23 years
Location: Altair

Post #18by Rassilon » 29.05.2002, 19:20

Now I see the solution...that now I am learning GIMP...

Alpha 0 will never show up in Win32 but its there...Ok I'll be back to report my progress on PNG spectural maps!
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 10 months
Location: Hamburg, Germany

Post #19by t00fri » 29.05.2002, 19:56

Rassilon wrote:Now I see the solution...that now I am learning GIMP...

Alpha 0 will never show up in Win32 but its there...Ok I'll be back to report my progress on PNG spectural maps!


RIGHT! You may always check whether a picture has an alpha channel, by clicking Image->decompose: Alpha.
If there is an Alpha channel, it will be extracted as a grayscale image and will pop up in front of you. If there is no alpha, then a dialog will tell you so...

Bye the way: Bumpmaps you find under Filter->Map->Bumpmaps.

There, you may specify a grayscale image (containing the level info). You may also just use a grayscale component (R,G,B) of your original image that you first blur with some pixels (5-10). You may also use Noise which gives a very nice canvas type surface etc.

Bye Fridger

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 23 years
Location: Altair

Post #20by Rassilon » 31.05.2002, 06:26

Well I am here to report that there is a way for us Windows users to make png...

Well fridger there is something to be said about GIMP...Cant see a reason not to use it :)

For people interested in reflective planet textures...
2 pictures one a spectural map...or inverse of the origional...Think white reflects and black swallows...The other is your texture...

The trick is getting the blend correct to produce that certain look...Bova was one of those unexpected creations...I kind of look at the land texture as another layer of clouds...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!


Return to “Development”