Page 1 of 1

Specular in Celestia 1.4.0 pre 6.Is it worth?

Posted: 23.03.2005, 22:28
by danielj
I think the Open GL 2.0 path in Celestia 1.4.0 pre 6 has a kind of specular effect.So,I wonder if is it worth using a Specular Map(maybe the exception could be the Earth).
And aside Earth,what planet or moon really looks better with a specular texture?

Posted: 23.03.2005, 22:41
by Sky Pilot
I just took a look around the room and saw several people looking at each other as if they wanted to ask what a "specular texture" is, but no one wanted to come forward to look really stupid, so I volunteered.

Um, what's a specular texture?

Posted: 23.03.2005, 22:56
by Don. Edwards
It the black and white texture of Earth that shows the oceans as white and the land as black. What does it does do. It tells Celestia were to render reflective sun light of the water and were not to. Anyone that has a video card that render the specmap effects and doesn't use them is really mising out.

BTW,
Specmap support has been in Celestia and the OpenGL extentions almost from the begining. It is not something that has just be added. I have used the effect on my Celestia installs for almost three years now.

Don. Edwards

Posted: 23.03.2005, 23:04
by t00fri
Sky Pilot wrote:I just took a look around the room and saw several people looking at each other as if they wanted to ask what a "specular texture" is, but no one wanted to come forward to look really stupid, so I volunteered.

Um, what's a specular texture?


Sky Pilot,

you surely know that a standard colored texture is actually composed of 3 distinct grayscale channels, one for Red, one for Green and one for Blue (RGB). But there is a fourth channel that less people are aware of: the so-called 'alpha channel'. It's also a grayscale channel but serves a variety of possible functions. The alpha channel may e.g. encode altitude information about the texture. white=highest, black=lowest. Then we call this a 'bump map'. Or it may be used to characterize /transparency/ in the texture. This we often use when making cloud textures! (you want to see down to the surface here and there...)

Or, it may be used to carry information about the 'reflectivity' properties of the texture: black=unreflective , white=total reflection.

That's what a specular texture exploits: suppose you encode all oceans in white (totally reflective) and all land in black in that 'alpha-channel'.
Then in the resulting 3d display you see the Sun's reflection in the sea and no reflections on continents.

In Celestia the reflectivity properties in form of an alpha channel are administrated in a separate so-called specular texture. It is interpreted as an alpha channel internally and produces the decribed effect.

Was this about clear?

Bye Fridger

Posted: 23.03.2005, 23:27
by danielj
I am using a earthspec32k.ctx,but there aren??t any reflection on water,only on earth.What can I do?
Aside Harald Schmidt,is there another specular texture that shows reflections on water?

Posted: 23.03.2005, 23:35
by t00fri
danielj wrote:I am using a earthspec32k.ctx,but there aren??t any reflection on water,only on earth.What can I do?
Aside Harald Schmidt,is there another specular texture that shows reflections on water?


If this is really the case (which sounds hard to believe), you just need to invert the whole earthspec texture, i.e. black -> white, white -> black.

Apparently you did not understand what I tried to explain to Sky Pilot above. Too bad...

There must be many such spec textures on Motherlode. I don't really know. If I need one I quickly make one. Takes less than 2 minutes. Certainly less than writing this post ;-)

Try smaller sizes first. Like 4k. Look whether they are also inverted (land <-> sea reflectivity).

Bye Fridger

Posted: 24.03.2005, 09:35
by Andy74
Fridger,

I really appreciate your explanation about the usage of the alpha channel in textures.
If you could spend another minute, I'd have just one more question: Is the alpha channel also used with normal maps?

Thanks
Andy

Posted: 24.03.2005, 12:57
by t00fri
Andy74 wrote:Fridger,

I really appreciate your explanation about the usage of the alpha channel in textures.
If you could spend another minute, I'd have just one more question: Is the alpha channel also used with normal maps?

Thanks
Andy


Andy,

Normal maps are submitted to rendering in Celestia as regular RGB textures with the normals to the surface in question being encoded with particular colors.

Here is a small illustration of how a normal map of the Himalaya region on Earth would look like:

Bye Fridger

PS: I should have added above that not all image formats are able to host an alpha channel besides RGB! JPG cannot but PNG can...DXT1 cannot but DXT3 can...

Image

Posted: 24.03.2005, 14:12
by Sky Pilot
Wow! Thanks Fridger. I really didn't know all of that. I appreciate very much your answer.

I suppose it's not possible to use the alpha channel for multiple purposes at the same time?? So if I want reflectivity and transparancy and a bump map, I would have to create three seperate textures? Also, I wasn't clear on whether the term "spectral map" refers to ALL uses of the alpha channel or just to its use to provide reflectivity between the land and oceans.

Many thanks.

Posted: 24.03.2005, 16:03
by t00fri
Sky Pilot wrote:Wow! Thanks Fridger. I really didn't know all of that. I appreciate very much your answer.

I suppose it's not possible to use the alpha channel for multiple purposes at the same time?? So if I want reflectivity and transparancy and a bump map, I would have to create three seperate textures? Also, I wasn't clear on whether the term "spectral map" refers to ALL uses of the alpha channel or just to its use to provide reflectivity between the land and oceans.

Many thanks.


Here is an example what can be done along these lines:

As I said, certain image formats allow to host an alpha channel besides the 3 RGB channels. Celestia can indeed directly interpret the alpha channel of such a 4 channel texture file in the rendering process as transparency information.

Standard image manipulation programs (Photoshop, GIMP) have nice facilities to /statically/ render a bump map for the main texture. The result would be a texture with transparency information /and/ static (i.e. time-independent) 3d shading of mountains and valleys...

Via dialogs in the programs, one may once for all adjust the angles of incidence of the lights source responsible for the shadow generation process.

Example: Clouds having a nice 3d like appearance (due to static bump mapping) /and/ transparency, such that we can see through to the planet's surface here and there.

This way, one may indeed combine static shading and transparency in ONE single texture. That's how we actually did it in the early versions of Celestia....

Clearly, the disadvantage is that the shadow patterns would not adapt to the changing position of the Sun!


Bye Fridger

Posted: 24.03.2005, 16:11
by Andy74
Fridger,

thank you very much for your helpful illustrations.
:D

Andy