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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 1 invisible), 620 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Canīt get bloom shader ScreensizeIndependent #98648
11/13/06 13:18
11/13/06 13:18
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline OP
Expert
EX Citer  Offline OP
Expert

Joined: May 2002
Posts: 2,541
Berlin
Hi all,

I tried all the morning today. But I donīt get it. I am using this bloom shader:
http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/691334/page/0/fpart/all/vc/1

THE PROBLEM: The bloom shader works very well at the resolution of 640x480.

I tried to implement the shader my games, and with the default resolution 640x480 everything works perfect. But if I switch the resolution the shader view looks different as the camera view. Itīs not totally different but somehow itīs not working right.
To correct that I changed that in the wdl:
starter map_glow()
{
glow_quad_view.ambient=100;
glow_quad_view.transparent=on;
glow_quad_view.visible=on;
glow_quad_view.alpha=100;

glow_quad_view.material=screen_glow;
GlowCamera.bmap=bmap_for_entity(glow_quad_view,0);
while(1)
{
proc_late();
// if(game_state){glow_quad_view.visible=on;}else{glow_quad_view.visible=off;}
if(myflags&mflg1)
{
vec_set(GlowCamera.x,camera.x);
vec_set(GlowCamera.pan,camera.pan);
} else {
GlowCamera.size_x=screen_size.x;
GlowCamera.size_y=screen_size.y;
if(video_mode == 6)
{
glow_quad_view.scale_x = 1;
glow_quad_view.scale_y = 1;
glow_quad_view.x = 550; // for 128
glow_quad_view.y = 0; // for 128
glow_quad_view.z = 0; // for 128
}
if(video_mode == 7)
{
glow_quad_view.scale_x = 1.25;
glow_quad_view.scale_y = 1.25;
glow_quad_view.x = 550; // for 128
glow_quad_view.y = 0; // for 128
glow_quad_view.z = 0; // for 128
}
if(video_mode == 8)
{
glow_quad_view.scale_x = 1.6;
glow_quad_view.scale_y = 1.6;
glow_quad_view.x = 2550; // for 128
glow_quad_view.y = 0; // for 128
glow_quad_view.z = 0; // for 128
}
if(video_mode == 9)
{
glow_quad_view.scale_x = 2;
glow_quad_view.scale_y = 2.133;
glow_quad_view.x = 550; // for 128
glow_quad_view.y = 0; // for 128
glow_quad_view.z = 0; // for 128
}
myflags &= ~mflg1;
}
wait(1);
}
}

But that doesnt help. And I donīt know why. Thanks for help.

Remarks: The lfag gets set in the main function when I change the rsolution. You donīt realy need that flag, but I used it, so this is done only once instead of every frame)


:L
Re: Canīt get bloom shader ScreensizeIndependent [Re: EX Citer] #98649
11/27/06 16:53
11/27/06 16:53
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Quote:

Hi all,

I tried all the morning today. But I donīt get it. I am using this bloom shader:
http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/691334/page/0/fpart/all/vc/1

THE PROBLEM: The bloom shader works very well at the resolution of 640x480.

I tried to implement the shader my games, and with the default resolution 640x480 everything works perfect. But if I switch the resolution the shader view looks different as the camera view. Itīs not totally different but somehow itīs not working right.
To correct that I changed that in the wdl:

// code omitted

But that doesnt help. And I donīt know why. Thanks for help.

Remarks: The lfag gets set in the main function when I change the rsolution. You donīt realy need that flag, but I used it, so this is done only once instead of every frame)




I've seen this problem occur, and the only workaround I've found is to use a new bitmap after the screen resolution changes. A6 doesn't recreate the render targets after a resolution change, which makes it render to the target as if the screen were the former size, making it offset improperly.

If you start the game in the resolution intended and set things up right for that, it should work properly. I'm not sure if there is any sure workaround to switching resolution in-game.

I'd reccommend making the rendertarget texture 1024x1024 and adjusting your screen object X coordinate accordingly. This has worked before on most cards.

-Rhuarc


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog
Re: Canīt get bloom shader ScreensizeIndependent [Re: Rhuarc] #98650
11/27/06 18:44
11/27/06 18:44
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline OP
Expert
EX Citer  Offline OP
Expert

Joined: May 2002
Posts: 2,541
Berlin
ok, thank you. Thatīs better as nothing.


:L

Moderated by  Blink, Hummel, Superku 

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