1

GML Lighting System. HELP FPS INCREASE?

H40pOMG's Avatar H40pOMG1/18/14 10:39 pm
1 emeralds 369 6
1/23/2014 11:05 am
H40pOMG's Avatar H40pOMG
I am making a game called Dungeon Rush, and I am using a lighting system that I've made. It is grid based and it looks pretty cool, I was wondering how I could increase my fps with it.

LIGHTING SYSTEM CODE -

obj=instance_nearest(x,y,obj_player);
if (distance_to_object(obj)<160)&&!collision_line(x+16,y+16,obj.x,obj.y,obj_wall,1,1){
temp_alpha=distance_to_object(obj)/160;
};else
{temp_alpha=1};

alpha2=1;
if temp_alpha<alpha2
alpha2=temp_alpha
{
draw_sprite(sprite_index,image_index,x,y);
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,c_black,alpha2);
};

Posted by H40pOMG's Avatar
H40pOMG
Level 32 : Artisan Artist
27

Create an account or sign in to comment.

6

1
01/22/2014 11:19 pm
Level 88 : Elite Scapegoat
Paril
Paril's Avatar
Cache the results and only re-calculate it on affected tiles when they or nearby tiles change.
1
01/23/2014 11:05 am
Level 32 : Artisan Artist
H40pOMG
H40pOMG's Avatar
I'll try to do that, thanks for the advise!
1
01/22/2014 10:58 pm
Level 37 : Artisan Architect
Schwerpunkt_
Schwerpunkt_'s Avatar
Could you provide a picture of what the lighting looks like? As if it were in the world
1
01/23/2014 11:04 am
Level 32 : Artisan Artist
H40pOMG
H40pOMG's Avatar
I added a picture in my first post.
1
01/22/2014 10:46 pm
Level 32 : Artisan Artist
H40pOMG
H40pOMG's Avatar
bump... =\
1
01/19/2014 4:45 pm
Level 32 : Artisan Artist
H40pOMG
H40pOMG's Avatar
BUMP...
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome