CMOD's still have a problem with opacity

Report bugs, bug fixes and workarounds here.
Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

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
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
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

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

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
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 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!"

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

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
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 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

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

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
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4


Return to “Bugs”