Gamestudio Links
Zorro Links
Newest Posts
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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
bmap_process effect on movie problem #404795
07/16/12 04:01
07/16/12 04:01
Joined: Jan 2012
Posts: 39
B
BySharDe Offline OP
Newbie
BySharDe  Offline OP
Newbie
B

Joined: Jan 2012
Posts: 39
As we know,
1, media_play function can play a movie on a sprite
2, bmap_process can add a effect on a sprite
Here is the problem, when I want to apply a effect on a movie sprite, the outlooking is always a black sprite.

I also tested uncompressed movie clips, since bmap_process could not work on compressed texture.

Anyone has some idea?

Re: bmap_process effect on movie problem [Re: BySharDe] #404796
07/16/12 04:13
07/16/12 04:13
Joined: Jan 2012
Posts: 39
B
BySharDe Offline OP
Newbie
BySharDe  Offline OP
Newbie
B

Joined: Jan 2012
Posts: 39
Here is my testing demo
Code:
#include <acknex.h>
#include <default.c>

STRING* file1 = "testing.avi"; //720*576

action myplay()
{
	my.ambient = 100;
	media_loop(file1, bmap_for_entity (my, 0), 100);
}

MATERIAL* mysunglass = 
{ 
	effect = "
	  	Texture TargetMap; // source bitmap
	 	sampler2D smpSrc = sampler_state { texture = <TargetMap>; };   
	  	
	  	float4 process_sepia(float2 Tex: TEXCOORD0): COLOR 
	  	{
		    float4 Color = tex2D( smpSrc, Tex.xy);
			
			if(Tex.x < 0.2)
			{
				Color.a = 0.7;
			}else
				Color.a = 0.4;
		    return Color;
	    }  
	    
	    technique Sepia {
		    pass p1 {      
		    	AlphaBlendEnable = True;
		      	PixelShader = compile ps_3_0 process_sepia(); 
		    }
	    }     
    ";    
}

void main()
{
	fps_max = 25;
	video_set(1280,960,24,0);
	level_load("");
	wait(1);
	
	BMAP* origin = ent_create("black.bmp",vector(800,0,0),myplay);
	
	PANEL* video_panel = pan_create(NULL,5);
	video_panel.bmap = bmap_createblack(720,576,32);
	set(video_panel,SHOW | OVERLAY);
	
	while(1)
	{
		bmap_process(video_panel.bmap,origin,mysunglass);
		wait(1);
	}
	
}



Re: bmap_process effect on movie problem [Re: BySharDe] #404798
07/16/12 06:49
07/16/12 06:49
Joined: Jan 2012
Posts: 39
B
BySharDe Offline OP
Newbie
BySharDe  Offline OP
Newbie
B

Joined: Jan 2012
Posts: 39
Alright!
after several test, I now solve it.
Code:
bmap_process(video_panel.bmap,origin,mysunglass);


to
Code:
bmap_process(video_panel.bmap,bmap_for_entity(origin,0),mysunglass);




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