Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
alpha problem with sprites #254743
03/05/09 06:37
03/05/09 06:37
Joined: Feb 2007
Posts: 353
A
amy Offline OP
Senior Member
amy  Offline OP
Senior Member
A

Joined: Feb 2007
Posts: 353
I do an alpha fade from 0% to 100% alpha. With a model entity it works without problems. With the same code a sprite entity stays invisible from 0% to 50%. This looks like a bug to me.

my code:
Code:
void fadein(ENTITY *e, var seconds)
{
	var ticks = seconds * 16;
	reset(e, INVISIBLE);
	e.alpha = 0;
	while(e.alpha < 100) {e.alpha = minv(e.alpha + 100/ticks * time_step, 100); wait(1);}
}
the TRANSLUCENT flag is set.

Re: alpha problem with sprites [Re: amy] #254745
03/05/09 07:51
03/05/09 07:51
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt

Re: alpha problem with sprites [Re: jcl] #254746
03/05/09 07:54
03/05/09 07:54
Joined: Feb 2007
Posts: 353
A
amy Offline OP
Senior Member
amy  Offline OP
Senior Member
A

Joined: Feb 2007
Posts: 353
I don´t understand what this has to do with my problem? I don´t use alpha testing. I want to slowly fade in an entity.

Re: alpha problem with sprites [Re: amy] #254753
03/05/09 08:42
03/05/09 08:42

M
mercuryus
Unregistered
mercuryus
Unregistered
M



Has your sprite an alpha channel? (tga/dds)?
GS can't handle this full fading because of some reasons.

Re: alpha problem with sprites [Re: amy] #254754
03/05/09 08:42
03/05/09 08:42
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Code:
function fadein()
{
	set(my,TRANSLUCENT);
	while(1)
	{
		my.alpha += 5*time_step
		if(my.alpha == 100){break; reset(my,TRANSLUCENT);}
		wait(1);
	}
}


Just an idea. wink

EDIT: Or use the fade in example in the manual:
Code:
set(my,TRANSLUCENT);
for (my.alpha=0; my.alpha+=5*time_step; my.alpha<100) wait(1);
reset(my,TRANSLUCENT);


Last edited by Cowabanga; 03/05/09 08:50.
Re: alpha problem with sprites [Re: Cowabanga] #254756
03/05/09 08:54
03/05/09 08:54
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Try changing the line reset(e, INVISIBLE); to be reset(e, INVISIBLE|OVERLAY);
and see if it makes a difference.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: alpha problem with sprites [Re: EvilSOB] #254764
03/05/09 10:18
03/05/09 10:18
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Its just logical. You must only understand what transparency is.

Either you want overlay transparency that is invisible below 50% alpha, or you want alpha transparency that is still visible below 50% alpha. Naturally you cant have both at the same time.

Now you will ask "What is overlay transparency and what is alpha transparency"? Well thats why we have the Mighty Manual, just read the link that was posted as answer on your question.

In your case I would just use a transparent texture, TGA or DDS, and not an overlay texture.


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1