Fading a model

All about models for Celestia. How-to, programs, work in progress...
Avatar
Topic author
Click
Posts: 4
Joined: 16.09.2017
With us: 7 years 2 months

Fading a model

Post #1by Click » 27.01.2018, 19:54

Folks,

Newbie question: is it possible to [dynamically] change the transparency/opacity of an ssc/dsc model so that it might fade in or out of a scene?

Thanks.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #2by CM1215 » 28.01.2018, 01:09

Hi,

#1: SSC/DSC files are NOT models. Models files are most times CMOD files.

#2: You are able to edit the opacity of CMOD models with a CMOD model editor program called "cmodview". It can be found here: ./viewtopic.php?f=25&t=17655
Just open the model file in cmodview, click the model, then use the side panel on the right side of the screen to edit the opacity value.

Hope this helps,
CM1215
CM1215: Celestial master in learning.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #3by selden » 28.01.2018, 10:35

The position (ScriptedOrbit), orientation (ScriptedRotation) and size (Radius) of an object, along with whether or not it's drawn at all (Visibility), can be changed dynamically at runtime. Unfortunately, changing its visual characteristics (e.g. by changing its surface texture image, including transparency) can't be. One workaround is to use "page flipping". I.e. you can pre-define multiple objects which differ appropriately and change each object's Visibility at runtime. Also, Celestia has bugs in how it depth-sorts transparent objects, which can cause strange visual effects in some cases.
Selden

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 8 months
Location: United Kingdom

Post #4by Joe » 29.01.2018, 03:29

Selden, great help as always! Your explanation hits the bullseys! You are the most valuable knowledge pool of Celestia in the Forum, my hat to you with big applause :clap: :clap: :clap: .
Joe
8O

Avatar
Topic author
Click
Posts: 4
Joined: 16.09.2017
With us: 7 years 2 months

Post #5by Click » 29.01.2018, 16:57

I had considered transitioning between different models of varying opacity -- as you say, "page flipping" -- but was concerned that the number of models needed to support a seemingly continuous transition (@ 20+ Hz or so) would be prohibitively large. Varying the radius at runtime is an option I hadn't considered: much easier to do and it may provide a similar effect that might do just as well ... if not better.


Thanks again, guys. 'Much appreciated!

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Post #6by Fenerit » 04.02.2018, 11:38

I recall a model could be made translucent by assigning a PNG with transparent canvas upon the CMOD model set with opacity 1. But I don't recall whether assigning a PNG with transparent canvas upon the CMOD set with opacity 0 could made the model translucent in converse way: let say, the model is opaque where the PNG is transparent and transparent where the PNG is opaque. In this way the model's fading could be achieved by changing the mapping texture through cycling several steps of texture's opacity: i.e texture1 0.1, texture2 0.2, texture3 0.3 and so on. (Selden?).

Added after 54 minutes 33 seconds:
Ok, this:

fading_sphere.png

The sphere has opacity 0, and the texture starts fading transparency from the middle. About how to cycle between textures, once there was a script somewhere. Major concern possibly will be the "depth sort bug".

zip here:
fading_sphere.zip
(355.79 KiB) Downloaded 416 times

Extract in ..\"extras", load Celestia->enter->tap "fading_sphere" without quotes
Never at rest.
Massimo


Return to “Modelling”