Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood), 1,268 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
tga file rendering and memory using #396477
03/07/12 10:35
03/07/12 10:35
Joined: Jan 2012
Posts: 39
B
BySharDe Offline OP
Newbie
BySharDe  Offline OP
Newbie
B

Joined: Jan 2012
Posts: 39
My last thread is here and thanks to the friendly guys.
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=395912#Post395912

I still have two problems and I think it is better to talk in new thread.
1. How to render a sequence of tga(32bit) with alpha channel in runtime on a PANEL?

ent_create("001.tga",vector(1000,0,0),move_pos);

this works well and shows a transparent outlooking.
----------------------------------------------------
Quote:
BMAP* myresource[amount_images]; // tga sequence
// preload image resource
for(i=0;i<amount_images;i++)
{
myresource[i] = bmap_create(SPRITE_str[i]); // one by one
wait(1);
}
while(1)
{
for(i=0;i<amount_images;i++)
{
P.bmap = myresource[i]; // target PANEL
wait(1);
}
wait(1);
}

this can show like a movie, but does not support the mask area with alpha channel.
ENTIRY* myresource[500] seems not to be a good way laugh

2. Engine seems to preload images into video memory, so I failed to render 500 sequence tga images in runtime. When loading at about the 120st image, it gets an error: Error E2005 - Can't create D3D texture. My video memory is 1GB, RAM is 12GB.
The limit is: 3 seconds content costs 5 seconds on loading. so dynamic loading may not solve this problem.

Re: tga file rendering and memory using [Re: BySharDe] #396486
03/07/12 13:30
03/07/12 13:30
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
E2005 has nothing to do with the amount of memory you have.
Originally Posted By: Manual
E2005 - The texture format is invalid or unsupported by your video card.

Anyway I'd recommend using .dds textures instead. This saves a lot of memory. Why do you wait one frame between loading two images? No wonder it takes so long.

Panels of cause use alpha channels as well.


Always learn from history, to be sure you make the same mistakes again...
Re: tga file rendering and memory using [Re: BySharDe] #396568
03/07/12 22:47
03/07/12 22:47
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
DDS is nice because if it's superior loading time and size (others may be smaller, but not in memory!), but whatch out if you have gradients in your image (either in the rgb or the alpha part), DDS makes this a bit worse. You can fiddle with the color key involved in the compression but basically gradients break the advantages in my oppinion. I also don't use them for texts. But for general textures they are good.

Other than that, - does somebody know if I put a movie stream on a bitmap, if I can access the contents in the pixel shader via tex2D? If so, you can actually do what you suggested: Just export the movie twice: Once regular and once just the mask. Then, you play the RGB movie on skin1 of an entity and the alpha-movie on skin2 and in a pixelshader you lookup RGB on skin1 and use the R part of skin2 as alpha in the output RGBA tupel of the pixel shader.

But thats just theory and is only possible if you can access the stream media in the pixelshader - which I don't know, as I said smile

Last edited by HeelX; 03/07/12 22:47.
Re: tga file rendering and memory using [Re: Uhrwerk] #396583
03/08/12 01:57
03/08/12 01:57
Joined: Jan 2012
Posts: 39
B
BySharDe Offline OP
Newbie
BySharDe  Offline OP
Newbie
B

Joined: Jan 2012
Posts: 39
Quote:
Panels of cause use alpha channels as well.

Yes, I try to use level_load(""); in main function,and it finally gets transparent. OMG. I feel a little weird on such issues.

Re: tga file rendering and memory using [Re: Uhrwerk] #396589
03/08/12 06:36
03/08/12 06:36
Joined: Jan 2012
Posts: 39
B
BySharDe Offline OP
Newbie
BySharDe  Offline OP
Newbie
B

Joined: Jan 2012
Posts: 39
Quote:
Why do you wait one frame between loading two images? No wonder it takes so long.

Yes, removing the "wait(1)" make it very fast to load images.
Therefore, dynamic loading becomes possible.

Re: tga file rendering and memory using [Re: BySharDe] #396611
03/08/12 14:10
03/08/12 14:10
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Als long as no level is loaded the background is not painted. Once a level is loaded the background is painted in the sky_color. You can force the background to be drawn withouht loading an empty level by setting screen_color to another value than total black. e.g.:
Code:
vec_set(&screen_color,vector(0,0,1));




Always learn from history, to be sure you make the same mistakes again...

Gamestudio download | chip programmers | 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