Help - Search - Members - Calendar
Full Version: Adventus L 2 S : Lighting & Shadow Engine
Game Maker Community > Games > Game Maker Creations > Tools & Applications
Pages: 1, 2, 3
Adventus
Adventus L2S: Lighting & Shadow Engine


^Click to Enlarge^

*18/7/06 Updated, Fixed shadow rendering problem


Introduction:

This engine is designed for complex Lighting and Shadows in topdown GM6.1 games. It makes extensive use of surfaces, blend modes and primitive casters inorder to realistically render shadows and lighting. The engine comes in two forms:
  • Full: All features Included but slightly slower (around 15%) than the Lite version.
  • Lite: A greater balance between speed and features.
Please note, A registered copy of Gamemaker 6.1 is required to run the edittable versions of this engine. An .exe version will be up soon as well as some more mirrors. Also if your looking to implement this within your game a basic knowledge of code and scripts is required, the readme should also be very helpful.

Features:
  • Full z-axis support, casts shadows realistically based off the relative z positions of the light and shadow casters.
  • True lighting; you can see on top of your shadow casters if their z position is less than the light.*
  • ‘Z-position ordered’ casting system, shadow casters with higher z positions go over the ones with lower z positions.*
  • Simple bump-mapping, Allows you to create differing surfaces ontop of your shadow casters. You can create dark areas and light area's on the top of you shadow casters to give the appearance of bumps or changes in z on the surface.*
  • Polygon shadows, create your own shapes. You can also have a different z for each vertex, so you could create a pyramid if you liked.
  • Fast optimised inbuilt shape shadow casters, including ellipses, boxes and barrels.
  • Full control, you can dynamically modify just about everything, including; Ambient light, light colour, light size, light casting direction, light z position, etc.
  • Pixel Perfect shadow and light casting.
  • Custom built deactivation method.
  • Possibly the only engine which doesn’t just cast linear shadows.
  • Faster than other engines, I used my own knowledge of mathematics to get the fastest possible means by not using the usual slow trig functions and point distances/directions methods.
NB: Features with the * symbol are only supported by the full version.

Next Version Features:
  • Pre-rendering system, so you could render all the static lights and their shadow casters at the beginning of the game to save a huge amount of CPU resources at the expense of RAM.
  • Different Shadow colours for each shadow caster.
  • Light bloom
  • Simple HDR
Download:

Type: .zip
Size: 941Kb
Includes: Both Edittable L2S Engines and Readme
Main: 64Digits
Mirror1: FreeWebTown
Mirror2: Host-a.net
Mirror3: weaponinhandgames Thanks zzyz for this mirror!

....More coming soon, Including .exe versions.... uploading is slow with dialup.....

Thank you for viewing my topic and hopefully trying my engine. Any Feedback will be greatly appreciated.... Especially FPS scores and Computer specs.

Cheers,
OpticalLiam
Very nice engine, got about 600 FPS in the first room, 330 in the second, 850 in the third.

This is on my:

AMD 3000+ 2.0ghz
1gb Crucial Ballistix (2-2-2-6)
Geforce 6800LE Unlocked (16p,6vp)

I may use it for a game I'm making.
Cobra Banshee
It went well the first 3 rooms, then my low VRAM showed what it couldn't do. Too bad, but I'll upgrade it (hopefully).

I was quiet amazed how smoothly the first 3 rooms ran on my computer. Not expected, due to experience with other light engines. Thumbs up for this one.
coolsmile
This is an amazing engine, ran very fast and smoothly on my computer, awesome job
monkeys
Awesome. Completely awesome. I got an average of about 40 for the high spec room, and 60 for the low spec room. GearGOD's work is gonna be cut out for him(/her?) to top this. This gets 4 dancing stars out of 5.
Shadow Yoshi
26 first room
18 second room
23 last room
What the heck is wrong with my computer? It's supposed to be good.

Anyway, for some of the lights (at least the flashlight in the last room) turn texture_set_interpolation(1) on so it doesn't look so pixely.
edmunn
And how many sleepless nights have you had whilst making this?
BEAUTIFULL!
thats all i can say.
8/8 green star thingys!
>Leroy222<
Very impressed. Musch better than the first release.

Looks like Gear God's got some competition smile.gif.

EDIT:
Is it possible to edit your engine to make shadow casters have a custom shadow color. This would be great for glass windows etc.
hermanshooltz
This thing rocks! Trully awesome.
Adventus
QUOTE
Very nice engine, got about 600 FPS in the first room, 330 in the second, 850 in the third.

This is on my:

AMD 3000+ 2.0ghz
1gb Crucial Ballistix (2-2-2-6)
Geforce 6800LE Unlocked (16p,6vp)

I may use it for a game I'm making.
Thats impressive, i Guess it shows you that this engine is more GPU than CPU intensive. I usually get around 400 fps for the first room on my 3.0ghz, 512mb, 6600GT.

QUOTE
I was quiet amazed how smoothly the first 3 rooms ran on my computer. Not expected, due to experience with other light engines. Thumbs up for this one.
Thanks, i put most of my effort into developing fast shadow rendering techniques. By the way if you already havent, you should try the 'Lite' version its a fair bit faster and less VRAM intensive.

QUOTE
What the heck is wrong with my computer? It's supposed to be good.

Anyway, for some of the lights (at least the flashlight in the last room) turn texture_set_interpolation(1) on so it doesn't look so pixely.
Yea thats really weird, maybe you could show us your specs, im guessing you've got a good CPU but an intergrated GFX card.... and this Engine depends hugely on the GPU, especially the Full version. Oh and thanks for pointing out that the Interlope-between-colours isnt on , I must have forgot.....

QUOTE
And how many sleepless nights have you had whilst making this?
BEAUTIFULL!
thats all i can say.
user posted imageuser posted image 8/8 green star thingys!
How may sleepless nights? Not many, i've only had GM for about 6 months now, and this lighting stuff really appealed to my mathematically oriented brain.

QUOTE
Very impressed. Musch better than the first release.

Looks like Gear God's got some competition
Yea i've been telling people for ages that GearGods was slow.... I decided to back up my claim.....

QUOTE
This thing rocks! Trully awesome.
Thanks man.

Thanks for your support all.

EDIT:
QUOTE
Sorry, did you read my edit?

Thanks.
Woops i posted before i saw your edit, Hmmm you can change the shadows colours by changing the ambient colour and if you wanted the ambient light to be a different colour to the shadows, you could draw a non-shadow casting light over the view, but i dont think thats what your after?

At the moment the shadow casters are just 'cut out' of the light sprite.... but you could modify the engine to do what you want. For instance if you look in the L2S_system_update script at the top, it says draw_set_color(c_black) if you changed that colour it would make your shadows different colours..... Next Version, ill incorporate your idea. Thanks.
>Leroy222<
Sorry, did you read my edit?

Thanks.
Tron323
This truly deserves more attention! It is good to finally have a shadow engine that runs better than GearGod's.

Thank you Pheonix101!
Adventus
QUOTE
This truly deserves more attention! It is good to finally have a shadow engine that runs better than GearGod's.

Yea thanks man, Its probably because nobody realises that most of this stuffs never been done in Game Maker before. I didnt just tack it onto previous methods, i've had to develope my own from scratch. Also most people for some unknown reason regard Luminare as unbeatable, yea sure when it was first released it was amazing, but nowdays things have moved on.....
J-Labs
QUOTE (Pheonix101 @ Jul 3 2006, 07:36 PM)
[*] Pre-rendering system, so you could render all the static lights and their shadow casters at the beginning of the game to save a huge amount of CPU resources at the expense of RAM.


With that, this will be my most favorite lighting engine because so far this is really good. And as someone previosly posted this definatly deserves more attention.
Tron323
Is it possible to have a light's shadow completely overlap all other lights/shadows? I'm trying to recreate the effect I had with my old engine.
Adventus
QUOTE
With that, this will be my most favorite lighting engine because so far this is really good. And as someone previosly posted this definatly deserves more attention.
Thanks man, although those 'next version features' are totally relative to if i can maintain my enthusiasm for the project.

QUOTE
Is it possible to have a light's shadow completely overlap all other lights/shadows? I'm trying to recreate the effect I had with my old engine.
In theory, if this was possible, it would be extremely unrealistic because a light source shouldn't be affected by shadow. Although in practice this can be achieved by turning the other lights on/off depending on whether they can be seen. Here's how i would do it:

Light Casters step:
if !collision_line(x,y,obj_player.x,obj_player.y,obj_wall,0,0)
{
image_xscale='my xscale'
image_yscale='my yscale'
}
else
{
image_xscale=0
image_yscale=0
}

This will make it so when there is an obstruction the light will be off and on where there isn't, i would probally put this in an alarm event. You could also do it by casting the main light first then checking the lightmap to see if there is still light at the new lights position and acting accordingly.
Tron323
Hmm, not exatcly going to work for my application. I might be able to pull it off by changing some of your code to draw the main light's shadow as black in normal blend mode, then setting it's draw depth above that of all other lights and shadows. I'll have to see...

As far as unrealistic goes, not really. My goal with my game is to simulate a first-person perspective from a top down view. I would want my FOV "light" to overlap all others since it would truly be unrealistic to be able to see lights that are on the other side of walls. happy.gif
Adventus
QUOTE
I might be able to pull it off by changing some of your code to draw the main light's shadow as black in normal blend mode, then setting it's draw depth above that of all other lights and shadows.
Yep thats another possibility, although you would need to dig a bit into my code. Here's some replacement code for doing it:

L2S_system_update:
CODE

//L2S_system_update(light master,shadow master)
//argument0=light drawing master
//argument1=shadow drawing master
//argument2=post render FOV object

draw_set_color(c_black)
surface_set_target(global.LS_lightmap);
draw_clear(global.LS_ambient);
with(argument0)
{
if self.bbox_right>view_xview if self.bbox_left<view_xview+view_wview if self.bbox_top<view_yview+view_hview if self.bbox_bottom>view_yview
{
if LS_shadow
{
surface_set_target(global.LS_light)
draw_clear(c_black)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y-view_yview,image_xscale,image_yscale,image_angle,i
mage_blend,image_alpha)
surface_set_target(global.LS_shadow)
draw_clear(c_white)
with(argument1)
{
if bbox_right>other.bbox_left if bbox_left<other.bbox_right if bbox_top<other.bbox_bottom if bbox_bottom>other.bbox_top
{ds_priority_add(global.LS_ds,self.id,self.LS_z)}
}
maxi=ds_priority_size(global.LS_ds)
for(i=0;i<=maxi;i+=1) {LS_shadow[i]=ds_priority_delete_min(global.LS_ds)
}
L2S_shadow_update()
surface_set_target(global.LS_shadow)
draw_set_blend_mode_ext(9,1)
draw_surface(global.LS_light,0,0)
surface_set_target(global.LS_lightmap)
draw_set_blend_mode(1)
draw_surface(global.LS_shadow,0,0)
}
else{
surface_set_target(global.LS_lightmap)
draw_set_blend_mode(1)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y-view_yview,image_xscale,image_yscale,image_angle,i
mage_blend,image_alpha)
}
draw_set_blend_mode(0)
}
}
with(argument2)
{
if self.bbox_right>view_xview if self.bbox_left<view_xview+view_wview if self.bbox_top<view_yview+view_hview if self.bbox_bottom>view_yview
{
if LS_shadow
{
surface_set_target(global.LS_light)
draw_clear(c_black)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y-view_yview,image_xscale,image_yscale,image_angle,i
mage_blend,image_alpha)
surface_set_target(global.LS_shadow)
draw_clear(c_white)
with(argument1)
{
if bbox_right>other.bbox_left if bbox_left<other.bbox_right if bbox_top<other.bbox_bottom if bbox_bottom>other.bbox_top
{ds_priority_add(global.LS_ds,self.id,self.LS_z)}
}
maxi=ds_priority_size(global.LS_ds)
for(i=0;i<=maxi;i+=1) {LS_shadow[i]=ds_priority_delete_min(global.LS_ds)
}
L2S_shadow_update()
surface_set_target(global.LS_shadow)
draw_set_blend_mode_ext(9,1)
draw_surface(global.LS_light,0,0)
surface_set_target(global.LS_lightmap)
draw_set_blend_mode(0)
draw_surface(global.LS_shadow,0,0)
}
else{
surface_set_target(global.LS_lightmap)
draw_set_blend_mode(0)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y-view_yview,image_xscale,image_yscale,image_angle,i
mage_blend,image_alpha)
}
draw_set_blend_mode(0)
}
}
//resetting
surface_reset_target()


Simply make argument2 your FOV casting object and it should work, although i havent tested it. This code only applies to the 'Full' version of the engine, but you should be able to port it over if need. The main changes that i made was: making the FOV object cast last, and with the FOV object drawing the surface "global.LS_shadow" with the bm_normal blendmode.

Cheers,
mikeb33
sweetness! gj! It's awesome

mikeb33
Tron323
Ahh, thank you Pheonix, that saved me a lot of trouble. The only problem now is that it doesn't show any other light, even when the light is in view.
Adventus
Woops sorry about that, accidentally used the wrong blend mode, drawing it with bm_normal will draw black over the rest of the screen.... so where gonna have to use the bm_dest_color,bm_zero blend mode. Here's a modified script:

CODE

//L2S_system_update(light master,shadow master)
//argument0=light drawing master
//argument1=shadow drawing master
//argument2=post render FOV object

draw_set_color(c_black)
surface_set_target(global.LS_lightmap);
draw_clear(global.LS_ambient);
with(argument0)
{
if self.bbox_right>view_xview if self.bbox_left<view_xview+view_wview if self.bbox_top<view_yview+view_hview if self.bbox_bottom>view_yview
{
if LS_shadow
{
surface_set_target(global.LS_light)
draw_clear(c_black)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y- view_yview,image_xscale,image_yscale,image_angle,i
mage_blend,image_alpha)
surface_set_target(global.LS_shadow)
draw_clear(c_white)
with(argument1)
{
if bbox_right>other.bbox_left if bbox_left<other.bbox_right if bbox_top<other.bbox_bottom if bbox_bottom>other.bbox_top
{ds_priority_add(global.LS_ds,self.id,self.LS_z)}
}
maxi=ds_priority_size(global.LS_ds)
for(i=0;i<=maxi;i+=1) {LS_shadow[i]=ds_priority_delete_min(global.LS_ds)
}
L2S_shadow_update()
surface_set_target(global.LS_shadow)
draw_set_blend_mode_ext(9,1)
draw_surface(global.LS_light,0,0)
surface_set_target(global.LS_lightmap)
draw_set_blend_mode(1)
draw_surface(global.LS_shadow,0,0)
}
else{
surface_set_target(global.LS_lightmap)
draw_set_blend_mode(1)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y- view_yview,image_xscale,image_yscale,image_angle,i
mage_blend,image_alpha)
}
draw_set_blend_mode(0)
}
}
with(argument2)
{
if self.bbox_right>view_xview if self.bbox_left<view_xview+view_wview if self.bbox_top<view_yview+view_hview if self.bbox_bottom>view_yview
{
if LS_shadow
{
surface_set_target(global.LS_light)
draw_clear(c_black)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y- view_yview,image_xscale,image_yscale,image_angle,i
mage_blend,image_alpha)
surface_set_target(global.LS_shadow)
draw_clear(c_white)
with(argument1)
{
if bbox_right>other.bbox_left if bbox_left<other.bbox_right if bbox_top<other.bbox_bottom if bbox_bottom>other.bbox_top
{ds_priority_add(global.LS_ds,self.id,self.LS_z)}
}
maxi=ds_priority_size(global.LS_ds)
for(i=0;i<=maxi;i+=1) {LS_shadow[i]=ds_priority_delete_min(global.LS_ds)
}
L2S_shadow_update()
surface_set_target(global.LS_shadow)
draw_set_blend_mode_ext(9,1)
draw_surface(global.LS_light,0,0)
surface_set_target(global.LS_lightmap)
draw_surface(global.LS_shadow,0,0)
}
else{
surface_set_target(global.LS_lightmap)
draw_set_blend_mode_ext(9,1)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y- view_yview,image_xscale,image_yscale,image_angle,i
mage_blend,image_alpha)
}
draw_set_blend_mode(0)
}
}
//resetting
surface_reset_target()

Once again, havent tested.... but i think it should work.
Tron323
Yep that did it. Thank you very much!

EDIT: I do hate to be a burden, but I realize now that this isn't exactly what I was looking for. Basically, I don't want the FOV light to overlap the other lights/shadows, I only want the FOV light's shadows to overlap.

I guess what I'm looking for is a shadowcasting FOV light, with no light... If that makes sense wacko.gif . Kind of an area type light the size of the view that casts black shadows but the light doesn't effect other lights or shadows...
Adventus
Unfortunately i dont have access to a gm6 capable computer right now, so im helping you blind.... oh well ill do my best. What i outlined before is the still the basic idea im building on, your simply applying another pass (bm_dest_color,bm_zero) over the light map to determine what proportions of the other lights can be seen. Unfortunately, what im failing to see is how what i posted before isnt achieving this? If your making the FOV light sprite completely white with black at the positions you dont want seen (ie behind you) .... hmmm i may have just solved it, forget the ramble above...

Try this:
CODE


//L2S_system_update(light master,shadow master)
//argument0=light drawing master
//argument1=shadow drawing master
//argument2=post render FOV object

draw_set_color(c_black)
surface_set_target(global.LS_lightmap);
draw_clear(global.LS_ambient);
with(argument0)
{
if self.bbox_right>view_xview if self.bbox_left<view_xview+view_wview if self.bbox_top<view_yview+view_hview if self.bbox_bottom>view_yview
{
if LS_shadow
{
surface_set_target(global.LS_light)
draw_clear(c_black)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y- view_yview,image_xscale,image_yscale,image_angle,i

mage_blend,image_alpha)
surface_set_target(global.LS_shadow)
draw_clear(c_white)
with(argument1)
{
if bbox_right>other.bbox_left if bbox_left<other.bbox_right if bbox_top<other.bbox_bottom if bbox_bottom>other.bbox_top
{ds_priority_add(global.LS_ds,self.id,self.LS_z)}
}
maxi=ds_priority_size(global.LS_ds)
for(i=0;i<=maxi;i+=1) {LS_shadow[i]=ds_priority_delete_min(global.LS_ds)
}
L2S_shadow_update()
surface_set_target(global.LS_shadow)
draw_set_blend_mode_ext(9,1)
draw_surface(global.LS_light,0,0)
surface_set_target(global.LS_lightmap)
draw_set_blend_mode(1)
draw_surface(global.LS_shadow,0,0)
}
else{
surface_set_target(global.LS_lightmap)
draw_set_blend_mode(1)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y- view_yview,image_xscale,image_yscale,image_angle,i

mage_blend,image_alpha)
}
draw_set_blend_mode(0)
}
}
with(argument2)
{
if self.bbox_right>view_xview if self.bbox_left<view_xview+view_wview if self.bbox_top<view_yview+view_hview if self.bbox_bottom>view_yview
{
if LS_shadow
{
surface_set_target(global.LS_light)
draw_clear(c_black)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y- view_yview,image_xscale,image_yscale,image_angle,i

mage_blend,image_alpha)
surface_set_target(global.LS_shadow)
draw_clear(c_white)
with(argument1)
{
if bbox_right>other.bbox_left if bbox_left<other.bbox_right if bbox_top<other.bbox_bottom if bbox_bottom>other.bbox_top
{ds_priority_add(global.LS_ds,self.id,self.LS_z)}
}
maxi=ds_priority_size(global.LS_ds)
for(i=0;i<=maxi;i+=1) {LS_shadow[i]=ds_priority_delete_min(global.LS_ds)
}
L2S_shadow_update()
surface_set_target(global.LS_shadow)
draw_set_blend_mode_ext(bm_zero,bm_src_color)
draw_surface(global.LS_light,0,0)
surface_set_target(global.LS_lightmap)
draw_surface(global.LS_shadow,0,0)
}
else{
surface_set_target(global.LS_lightmap)
draw_set_blend_mode_ext(bm_zero,bm_src_color)
draw_sprite_ext(sprite_index,image_index,x-view_xview,y- view_yview,image_xscale,image_yscale,image_angle,i

mage_blend,image_alpha)
}
draw_set_blend_mode(0)
}
}
//resetting
surface_reset_target()
The problem was that i was modifying the colour of the FOV sprite based on the destinations colour when i should have infact been doing the opposite. Interesting problem.
Tron323
For blind coding, you're doing an excellent job. Still not working the way I'm looking for yet though...

I can see where my problem might be a little confusing. let me try to clarify: My FOV "light" should cast black shadows, but not actually be a light itself. Leaving all actual lighting to the other light objects in the level. Let me post a couple concept shots...

This is what it currently is:



This is a general idea of what I'm looking for (edited with paint):

[img=http://img80.imageshack.us/img80/8464/demo25hu.th.jpg]

I know how to get the FOV width I want in the second one, but notice how the area light in the second one is producing shadows and the actual lighting.

Kinda get what I mean?
pyros_hotdog
this thing rocks! keep up the good work.
hope you develop it even further so it'll be better than it is now.
Newly Discovered
Lol...my computer is pretty bad. it looked nice and all, except sometimes the shadows didnt render or on the rotating stars, it didnt draw the shadow right, it left a pixel or two in between the shadow and the star itself.

nice job though.
Adventus
@tron323 I will continue to help you over the PM system, i dont think the Mods would appreciate us turning this forum into a Q&A... XD.

QUOTE
this thing rocks! keep up the good work.
hope you develop it even further so it'll be better than it is now.
Thanks man, although there not really any more developement i can put into this, every thing casts 100% accurately, all i could really think of is at the top of the page.... unless you've got any ideas?

QUOTE
Lol...my computer is pretty bad. it looked nice and all, except sometimes the shadows didnt render or on the rotating stars, it didnt draw the shadow right, it left a pixel or two in between the shadow and the star itself.

nice job though.
Thanks again, I've never had the shadows fail to render so im guessing your computer may be at fault, and the reason the stars shadows are slightly off is because i havent set up the vertices 100% correctly.... its casting is perfect, im just lazy!

If anybodys got any suggestions.... Im all ears/eyes.
caboose607
dude this rocks. excellent program
Tron323
I've had the shadows fail to render on a rare occasion myself. Restarting the program/room brings them back, and it seems to happen randomly...

As a side note to anyone following the topic: Pheonix101 and I were able to tweak the engine to produce the effect I was looking for. This engine is very easy to manipulate and modify to fit your game! I highly recommend it!
the bull
This is when I first start your example


This is a little after that


I don't know why this happen.
Anyway,a good engine,much better and faster than geargod but you should fix the shadow. 9/10.
Adventus
QUOTE
dude this rocks. excellent program
Thanks....

QUOTE
  I've had the shadows fail to render on a rare occasion myself. Restarting the program/room brings them back, and it seems to happen randomly...
QUOTE
I don't know why this happen.
Anyway,a good engine,much better and faster than geargod but you should fix the shadow. 9/10.
Yep just fixed that and uploaded the updated version. It was a really stupid mistake (as usual), I was using the same variable for 2 things..... If you want to fix it your self, just go to the L2S_system_update() script, change the name of the array "LS_shadow[]" to something else (but dont change the single variable "LS_shadow"), then goto L2S_shadow_update() and for all occurances of "LS_shadow[]" replace it with your new array name.
the bull
After 5 minutes,the shadow's still there.It works. 10/10 now. biggrin.gif
Vaporizer
I'm getting this error always when near a light source, and I have no idea what could cause it. Here's a screenshot:
The eleventh plague of Egypt
I can't believe it works because i wasn't able to believe there was something like this !

Great !
pyros_hotdog
ran pretty well in my comp btw...

system specs:

2.0 GHz
256 RAM
Directx 9.0c
NVIDIA Geforce FX 5500 with the latest drivers

low specs room:
around 117 fps

High specs:

went half all the way to around 55-60 fps

hope you update this lighting engine more, it rocks!

as for suggestions... hope this'll help

some of the articles here could help i guess....
Rendering (computer graphics) article on wikipedia

and this thing can't really be restricted to just topdown games, i think this could be also used for isometric-view games too and others
Vaporizer
It works just fine when I run it, but when merged to my game it starts showing these errors...
OpticalLiam
Phoenix, you mention this has bump mapping. I'm intriqued. Does it really? How is this implemented? Does it use propper bump maps? Is it those sprites in the overlay sprite folder?
Adventus
QUOTE
After 5 minutes,the shadow's still there.It works. 10/10 now. biggrin.gif
Thats good to hear, Thanks....

QUOTE
I'm getting this error always when near a light source, and I have no idea what could cause it. Here's a screenshot:
QUOTE
It works just fine when I run it, but when merged to my game it starts showing these errors...
hehe woops, just noticed that i was "var"-ing some of the needed variables, you got that error because you turned off "setting unitilised variables to zero", Ill upload a fixed version some time today....

QUOTE
I can't believe it works because i wasn't able to believe there was something like this !
Great !
Well its definitely not the first, but i like to think of it as a pretty big evolution in its field.....

QUOTE
ran pretty well in my comp btw...

system specs:

2.0 GHz
256 RAM
Directx 9.0c
NVIDIA Geforce FX 5500 with the latest drivers
low specs room:
around 117 fps
High specs:
went half all the way to around 55-60 fps
hope you update this lighting engine more, it rocks!
as for suggestions... hope this'll help
some of the articles here could help i guess....
Rendering (computer graphics) article on wikipedia
and this thing can't really be restricted to just topdown games, i think this could be also used for isometric-view games too and others
Hmmm an interesting article.... I'll definitely look into some of these techniques..... Although i have just discovered "Light-Bloom" which i may be able to implement in the near future. The problem is that with every thing i add the slower it gets..... but i guess thats what the "lite" versions for....

QUOTE
Phoenix, you mention this has bump mapping. I'm intriqued. Does it really? How is this implemented? Does it use propper bump maps? Is it those sprites in the overlay sprite folder?
Haha well, it is by no means proper bump-mapping, which is dynamic.... but i really couldn't think of anything else suitable to call them, They're best thought of static bump-maps. Heres an excerpt from the readme:

- Overlays/Bumpmapping:
The overlay/bump-mapping feature determines how much light is shown above the object and how it is arranged. It can be thought of a second light which changes itself based on how much light is being cast above it. Overlays are very useful for making graphical effects in games, for instance you could have a destructable box and as it slowly gets damaged you could just modify the overlay instead of the sprite

EDIT: Well i've uploaded the fixed version, it was actually a really strange error but i did fix it eventually after trying a few things at random.... I cant be bothered bumping for such a small update....

Any more suggestions?
pyros_hotdog
and this one too:

more stuff that could probably help.......
GearGOD
A very impressive piece of work. This far outclasses the currently released Luminaire and every other lighting library I know of. I think I will send future users of the current version over here instead.
Looking forward to your next version and seeing how it will compare to my own toy in the works (it does a little more than just blooms and pre-calculated shadows, beware wink1.gif)
Adventus
QUOTE
and this one too:

more stuff that could probably help.......
Yea I've been looking into HDR recently.... but without access to custom data stuctures It means that i might have to make another surface for each increase in the range or possibly use the other two colour channels. The "Simple HDR" i mention above is more just an increase in contrast, by redrawing either all or part of the light surface and using it as a contrast map.

QUOTE
A very impressive piece of work. This far outclasses the currently released Luminaire and every other lighting library I know of. I think I will send future users of the current version over here instead.
Looking forward to your next version and seeing how it will compare to my own toy in the works (it does a little more than just blooms and pre-calculated shadows, beware )
haha a little competition is always good, but im guessing you've managed to render HDR and i've only just finished making my bresenhams radial blurring algorithm for my light bloom (which is still painfully slow i might add, i might just go back to the old trusty box blur XD).... I look forward to your next Release.... Its been awhile.

Cheers,
OpticalLiam
QUOTE
ERROR in
action number 1
of Mouse Event for Glob Right Button
for object_player:

Error in code at line 1:
light.x=mouse_x

at position 1: Unknown variable light


Hmmm

"Treat all uninitialized variables as value 0" ticked in (global game options [errors])

Seemed to solve it though (to give you an idea...)

Great engine!
kickboxer89
hello, i think i've found a problem...
i maked one instance called lantern.
it position (in step event) is
QUOTE
[s]x=target.x;
y=target.y;
image_angle=target.image_angle;

where target can be the main character or a npc player.
in the player's create event:
QUOTE
a=instance_create(x,y,lantern);
a.target=id;

the same in the npc's create event..

but here the problem, i only saw one lantern. the other lantern isn't there..

i don't know why :S[/s]

problem done... my fault. srry tongue.gif
Richard90
Wow! This is the best Lighting & Shadow engine I've ever seen! Runs very smooth on my pc. I might use this, not now, but later on.
>Leroy222<
Glad to see you like my idea. Cant wait for thenext version, which i think ill use in my game.
relyt_123
I've been looking through your code for the past 10 minutes, but I can't seem to find out how you make it so it stay's dark the whole time and doesn't change.
the bull
Remove the last 2 lines in the endstep event of the object obj lightengine
CODE
global.LS_ambient=make_color_hsv(20,170,max(45,min(230,lengthdir_y(230,time))))
if fps {time+=6/fps}
relyt_123
Ahh, thankyou very much for the help.

By the way this is a very amazing engine, good work!
kickboxer89
Hello! ^^ One question!
What is faster, to use vertex o bouding box casters?
I was doing a test and I think that vertex are faster, but I am not sure...

By the way, what about the next version?
Ciao!
Adventus
QUOTE
Hello! ^^ One question!
What is faster, to use vertex o bouding box casters?
I was doing a test and I think that vertex are faster, but I am not sure...
Im pretty certain that the bounding box casters are faster than the polygon casters. It would have been pretty pointless making them if they weren't... XD.

QUOTE
By the way, what about the next version?
Good question, right now im concentrating on my game "condemned" but i have implemented (into L3S) a pretty good light bloom effect. I really have no idea when it will be finished, mainly because i cant justify a whole new release with the current minor improvements and im struggling to find lighting effects GM can realistically handle (except the light bloom, it works quite well).

cheers....
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.