G
Gad
Guest
So I've decided I want to use shaders. I can either apply shader over each drawn object, or draw them all on surface and then apply shader on the surface.
I've been through various surface tutorials and I don't think I'm doing something wrong, but it's really bothering me.
As I keep regular draw with no surfaces, no shaders the fps are flying around ~2000. When i initalize surface (single surface for now) the fps drops to around 60 and sometimes drop to ~40.
My current graphic card is really weak (geforce 405), but I don't think that really explains the significant drop with usage of just one surface used and it's size for now is 1024x768. If i make it bigger it jams even more...
This is how I handle the surface:
So i've got an object called SurfaceHolder, that holds the surface and draws it.
Initialize surface at Create event:
Draw objects on surface and print surface on Draw event:
Free surface on Game End event:
Am I doing something wrong, or surfaces are just that badly optimalized?
I've been through various surface tutorials and I don't think I'm doing something wrong, but it's really bothering me.
As I keep regular draw with no surfaces, no shaders the fps are flying around ~2000. When i initalize surface (single surface for now) the fps drops to around 60 and sometimes drop to ~40.
My current graphic card is really weak (geforce 405), but I don't think that really explains the significant drop with usage of just one surface used and it's size for now is 1024x768. If i make it bigger it jams even more...
This is how I handle the surface:
So i've got an object called SurfaceHolder, that holds the surface and draws it.
Initialize surface at Create event:
Code:
specialsurface = surface_create(view_wport,view_hport);
surface_set_target(specialsurface);
draw_clear_alpha(c_white,0);
surface_reset_target()
Draw objects on surface and print surface on Draw event:
Code:
if surface_exists(specialsurface)
{
surface_set_target(specialsurface)
draw_clear_alpha(c_white,0);
with(oHurt)
{
draw_sprite(sprite_index, image_index, x, y);
}
}
else
{
specialsurface = surface_create(view_wport,view_hport);
surface_set_target(specialsurface);
draw_clear_alpha(c_white,0);
surface_reset_target()
}
surface_reset_target();
draw_surface(specialsurface,0,0);
Code:
if surface_exists(specialsurface)
{
surface_free(specialsurface);
}
Am I doing something wrong, or surfaces are just that badly optimalized?
Last edited by a moderator: