CMOD's still have a problem with opacity

Report bugs, bug fixes and workarounds here.
Topic author
cartrite
Posts: 1778
Joined: 15.09.2005
With us: 14 years
Location: Pocono Mountains, Pennsylvania, USA

CMOD's still have a problem with opacity

Post #1by cartrite » 24.09.2009, 12:40

selden wrote:1. RGBA textures which are applied to Celestia's internal planetary spheres have their A channels treated as specularity.

2. RGBA textures which are specified within CMOD or 3DS models as diffuse materials have their A channels used for opacity. A separate material is used for specularity.

3. RGBA textures which are applied to CMOD or 3DS Meshes using an SSC Texture statement replace the models' internal diffuse textures and have their A channels used for specularity. This is for consistency with how RGBA textures are applied to Celestia's internal planetary spheres. All other SSC texture declarations are ignored when applied to Meshes.
I've tried renaming a texture that was inside a cmod sphere to use earth.png and this is what I see.
The alpha channel still seems to be used as opacity no matter what. In the past, I was trying to get a rgba texture to work with an empty alpha channel. So I don't know what's going on here.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap42.3
and Tumbleweed

Avatar
selden
Developer
Posts: 10062
Joined: 04.09.2002
With us: 17 years
Location: NY, USA

Re: CMOD's still have a problem with opacity

Post #2by selden » 24.09.2009, 13:56

Do you mean that you changed a texture0 statement in the .cmod file to point to earth.png?

If so, the result you show is exactly what I'd expect. The alpha channel of a texture specified as a diffuse material within a mesh specifies its opacity.

You have to use a Texture statement in the SSC file for the alpha channel to be used for specularity.
You can explicitly specify a specularmap in the cmod file, but I think that uses the primary image and may ignore the alpha channel.
Selden

Topic author
cartrite
Posts: 1778
Joined: 15.09.2005
With us: 14 years
Location: Pocono Mountains, Pennsylvania, USA

Re: CMOD's still have a problem with opacity

Post #3by cartrite » 24.09.2009, 14:22

Do you mean that you changed a texture0 statement in the .cmod file to point to earth.png?
No,
Here is the cmod file.

Code: Select all

material
texture0 "earth1.png"
diffuse 0.640000 0.640000 0.640000
specular 0.500000 0.500000 0.500000
specpower 50.000000
end_material

And here is the ssc file.

Code: Select all

Modify "Earth" "Sol"
{
   Texture "earth2.png"
   Mesh "earth.cmod"
}

I used Celestia's earth.png, renamed it to earth2.png, and put it in the textures/medres folder next to the models folder in the addon. I also tried removing the specular and specpower statements from the model.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap42.3
and Tumbleweed

Avatar
Cham M
Posts: 4325
Joined: 14.01.2004
Age: 54
With us: 15 years 8 months
Location: Montreal

Re: CMOD's still have a problem with opacity

Post #4by Cham » 24.09.2009, 14:48

Just a question (I'm curious) : why are you doing this ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Topic author
cartrite
Posts: 1778
Joined: 15.09.2005
With us: 14 years
Location: Pocono Mountains, Pennsylvania, USA

Re: CMOD's still have a problem with opacity

Post #5by cartrite » 24.09.2009, 15:00

Cham wrote:Just a question (I'm curious) : why are you doing this ?
I was testing an icosphere mesh to see what it would look like at the poles.
When I saw this, I tested a UV sphere and got the same results with the png alpha map.
I even got the same results when I used the earth texture on my 3dmars model.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap42.3
and Tumbleweed

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

Re: CMOD's still have a problem with opacity

Post #6by chris » 24.09.2009, 15:24

The behavior that your observing is correct, though I admit that it's a bit confusing that the same texture looks so different when applied to a cmod instead of a sphere. There's currently no way for a cmod material to use the alpha channel of the base texture as a specular mask instead of opacity.

--Chris

Topic author
cartrite
Posts: 1778
Joined: 15.09.2005
With us: 14 years
Location: Pocono Mountains, Pennsylvania, USA

Re: CMOD's still have a problem with opacity

Post #7by cartrite » 24.09.2009, 15:28

OK,
I guess I misunderstood when I read this from selden.
3. RGBA textures which are applied to CMOD or 3DS Meshes using an SSC Texture statement replace the models' internal diffuse textures and have their A channels used for specularity. This is for consistency with how RGBA textures are applied to Celestia's internal planetary spheres. All other SSC texture declarations are ignored when applied to Meshes.
cartrite
Toshiba Satellite P875=S7200 laptop, Intel i5 processor 2.5 ghz 6 gb ram, Graphics Intel(R) HD Graphics 4000 openSUSE Leap42.3
and Tumbleweed


Return to “Bugs”

Who is online

Users browsing this forum: 11 guests