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
2 registered members (AndrewAMD, TipmyPip), 13,353 guests, and 5 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
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 | 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