Canīt get bloom shader ScreensizeIndependent

Posted By: EX Citer

Canīt get bloom shader ScreensizeIndependent - 11/13/06 13:18

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)
Posted By: Rhuarc

Re: Canīt get bloom shader ScreensizeIndependent - 11/27/06 16:53

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
Posted By: EX Citer

Re: Canīt get bloom shader ScreensizeIndependent - 11/27/06 18:44

ok, thank you. Thatīs better as nothing.
© 2024 lite-C Forums