Jump to content


Photo

Adventus L 3 S: Lighting & Shadows


  • Please log in to reply
125 replies to this topic

#1 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 08 October 2006 - 04:19 AM

Adventus L3S: Lighting & Shadows

Posted ImagePosted ImagePosted Image

Introduction:
This engine is designed for complex Lighting and Shadows in GM6.1 games. It makes extensive use of surfaces, blend modes and primitives inorder to realistically render shadows and lighting. The engine comes in two forms:
  • Full: All features Included but slightly slower than the Lite version.
  • Lite: Faster and easier to mod.
Please note, A registered copy of Gamemaker 6.1 is required to run the edittable versions of this engine. Also if your looking to implement this within your game a basic knowledge of code and scripts is required. I would also like to thank GearGOD for letting me in on some of his secrets and helping play test the engine.

Features:
  • Light Bloom: Allows you simulate lights extending out of the monitors contrast ratio by specifying a threshold value at with light begins to glow and spread out. Includes 2 types of blurs, a guassian and a bloom specific guassian blur.
  • Soft Shadows: Allows you to cast shadows which soften at the edges. They are most useful for static casters due to the rendering cost involved with casting soft shadows.
  • Static Caster System: Three types, including mesh-based, surface based and dynamic surface based. Shadow casters can also be defined as “always dynamic” so they will never cast a static shadow, but will always cast one even with static light casters.
  • Emissive Objects/Tiles: Allows shadow casters and other objects to emit their own light and appear to glow.
  • Specular Highlights: Allows shadow casters and other objects to realistically reflect light, very useful for materials like metal or for wet surfaces.
  • Glow Filter: Allows emissive objects light to spread around obstructing objects.
  • Emboss Bump-mapping: Allows objects to appear to have deviations of their surface normal.
  • Full z-axis support: Allows shadows to realistically cast based off the relative z positions of the light and shadow casters. Also higher shadows will obscure lower bumpmaps.
  • 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.
  • Inbuilt Shapes: Optimised inbuilt shape shadow casters, including the commonly used boxes and barrels.
Download:
Type: .zip
Size: 1.24mb
Includes: both L3S engines, Readme & Script Reference.
Main: 64Digits.com
Mirror 1: http://www.mediafire...04e75f6e8ebb871
Mirror 2: http://www.2shared.c...ght_engine.html

Mirrors thanks to Dylijn. The main mirror appears to be down, I'm not sure if this is permanent or temporary... ask 64digits.

For All you speed freaks out there, heres a little comparison test i made between L3S full,L3S lite and L2S full:

Engine Comparison

Feel free to post your bug reports, FPS scores, likes/dislikes, questions,etc.
Cheers,
-Adventus

Edited by Adventus, 03 August 2009 - 03:58 AM.

  • 2

#2 gizzardsmack

gizzardsmack

    GMC Member

  • New Member
  • 142 posts

Posted 08 October 2006 - 04:32 AM

Wow. beautiful. i can't wait to use it in a game. i love how it was presented, with fully moveable objects, different sometimes moving light sources...

if it were music, i would have had an eargasm :ph34r:

fps either room with no effects on, moving or stationary- 27-29
all on- 8-12

:\

so much ability for power, yet also able to tone it down

Edited by gizzardsmack, 08 October 2006 - 04:36 AM.

  • 0

#3 Alex

Alex

    3lite Member

  • New Member
  • 3098 posts

Posted 08 October 2006 - 04:34 AM

Well done. Runs much faster than any of the previous lighting engines i've tried on this comp.
  • 0

#4 aeron

aeron

    GMC Member

  • New Member
  • 18 posts

Posted 08 October 2006 - 04:35 AM

Wow! This is amazing! I can't even begin to say how great this looks! It ran smooth on my computer, and let's just say I don't have the greatest graphics card in the world. I have been hearing about this from GearGOD for so long, and now it's finally here! Again, amazing. I would use it but I usually only use original stuff created by me in my games. 10/10!

Edited by aeron, 08 October 2006 - 04:37 AM.

  • 0

#5 bendodge

bendodge

    File Host

  • GMC Member
  • 1237 posts

Posted 08 October 2006 - 04:37 AM

Very nice. You and GearGOD should co-author something, but then again competition is always good. (GG's HD crash was really sad.) Those people who gripe about GM's graphics should look at this. :ph34r:
  • 0
The government can't save you.
Time does not negate impossibility.

#6 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 08 October 2006 - 05:07 AM

Wow. beautiful. i can't wait to use it in a game. i love how it was presented, with fully moveable objects, different sometimes moving light sources...
if it were music, i would have had an eargasm wink1.gif
fps either room with no effects on, moving or stationary- 27-29
all on- 8-12
so much ability for power, yet also able to tone it down

Haha yea, I really dont expect any game in the near future to use all these effects....it would be pretty suicidal for rendering speed... this is also why i included a cut down lite version.

Well done. Runs much faster than any of the previous lighting engines i've tried on this comp.

Thanks.... The "lite" version is probably a little be faster than the previous "full" version, but i havent tested.

Wow! This is amazing! I can't even begin to say how great this looks! It ran smooth on my computer, and let's just say I don't have the greatest graphics card in the world. I have been hearing about this from GearGOD for so long, and now it's finally here! Again, amazing. I would use it but I usually only use original stuff created by me in my games. 10/10!

Thanks, i guess if you cant use it then you should learn from it.

Very nice. You and GearGOD should co-author something, but then again competition is always good. (GG's HD crash was really sad.) Those people who gripe about GM's graphics should look at this. smile.gif

Well you could almost say were already co-authoring something. I beleive he's using (at least in spirit) this engine for his upcoming game Kill Catalyst.
  • 0

#7 Potnop

Potnop

    GMC Member

  • GMC Member
  • 3103 posts

Posted 08 October 2006 - 06:45 AM

wow l3s now. I havent gotten around to using l2s yet, but I was gonna use it in Colonial COmmando. Well now Im use l3s.
  • 0
Vegeta! What does the scouter say about his powerlevel?!? It's ovER 9000!!!!!
I ownt read da script, script reads me.


Link To The Super Crew Topic / Link To Colonial Commando Topic
Platform Pathfinding Example Download it here!
Editable Early Version Level Editor(Nice @$$ stuff, check it out) Download it here!

#8 Indecom4000

Indecom4000

    GMC Member

  • GMC Member
  • 1636 posts
  • Version:GM:Studio

Posted 08 October 2006 - 07:26 AM

This is really good, but runs kindo slow on my pc with all the fx on.
I noticed that the soft shadows aren't dynamic, can they be? Also they seem to be transparent, perhaps the alpha should be increased just a tad so they still block light correctly while still retaining the look of softedness (real word?). I love the lava metal thingymathing you added, very pretty!
  • 0

LD-Logo-sml.png


#9 Scotley

Scotley

    Scotleys Studios

  • New Member
  • 244 posts

Posted 08 October 2006 - 08:16 AM

Well, thats certainly an improvement, both graphically, and speed wise. I got an average of 280 fps, with a Nvidia 7900 card :ph34r:

Congrats,
- Scotley
  • 0

#10 Arkano

Arkano

    GMC Member

  • New Member
  • 447 posts

Posted 08 October 2006 - 09:49 AM

The best lightning engine i´ve seen :ph34r:

...but i got an error when changing from low-spec room to high-spec one:

"Tried to use non-existing surface"
  • 0

#11 ozakigames

ozakigames

    GMC Member

  • New Member
  • 119 posts

Posted 08 October 2006 - 10:06 AM

thats amazing!
it runs not faster than 10 fps on my pc but i have a pentium 3 500mhz machine with a intel grap card LOL.

but it looks great

only when i press 2 in the full version when in room 1 it gives a error.

8.5/10!

greets
  • 0

#12 biggoron

biggoron

    dura lex sed lex

  • New Member
  • 652 posts

Posted 08 October 2006 - 10:13 AM

The best lightning engine i´ve seen :ph34r:

...but i got an error when changing from low-spec room to high-spec one:

"Tried to use non-existing surface"

<{POST_SNAPBACK}>

I got that too. I assumed my PC had exhausted it's VRAM but maybe not...

Great engine. Those specular highlights are awesome. I tried switching on bloom and nothing happened. Same with the reflecto-wotcha-majiggets, emmisive thingy, that's it. Got 19-20 on my ****box. I don't want to give out specs cause it's embarrassing. Here they are anyway:

~3GHz celeron D
480 MB ram
32 MB vram
  • 0

#13 OpticalLiam

OpticalLiam

    GMC Member

  • New Member
  • 782 posts

Posted 08 October 2006 - 10:46 AM

Wow, this rocks.

Well, thats certainly an improvement, both graphically, and speed wise.  I got an average of 280 fps, with a Nvidia 7900 card :ph34r:

Congrats,
- Scotley

<{POST_SNAPBACK}>


I disagree. L2S was way faster than this (expectably as it wasn't as advanced).
On L2S I got about average 300 FPS on the demo, on L3S I got about 80 FPS average.

Anyway, extremely nice work!
  • 0

#14 BrainWare

BrainWare

    Adrenaline

  • GMC Member
  • 791 posts

Posted 08 October 2006 - 11:50 AM

It's so sweet.
I only got 40fps with the full version high spec with everything on.
So I got a question.
Can you scale down the surface (optional)?
So you don't need that high sys requirements for it.
You could run a test which decides to scale down or not.
This way, more people can play games that uses L3S.


Cheers

Edited by BrainWare, 08 October 2006 - 11:55 AM.

  • 0

#15 gml_josea

gml_josea

    Killing Noobs

  • New Member
  • 466 posts

Posted 08 October 2006 - 12:58 PM

Sounds cool and nice, but my pc simply didn't have the power to run it well, I guess.
I got 5 FPS with everything off, and 1 FPS with everything on.
Sweet to look at, but not useful for me =\.
Not everyone have pro computers.
  • 0

#16 Bowex

Bowex

    Digital-X

  • New Member
  • 462 posts

Posted 08 October 2006 - 01:30 PM

Great, this is very well done !
but true...it's a bit slow i've got 28 FPS with all the effects on.

Edited by Bowex, 08 October 2006 - 01:30 PM.

  • 0

#17 bendodge

bendodge

    File Host

  • GMC Member
  • 1237 posts

Posted 08 October 2006 - 01:46 PM

I got 10-15 FPS with the lite version, and ~6 with the full. I have a Pentium 3 733 MHz with an integrated graphics card.

Still very good for so many effects.
  • 0
The government can't save you.
Time does not negate impossibility.

#18 Jesper

Jesper

    GMC Member

  • New Member
  • 1789 posts

Posted 08 October 2006 - 02:32 PM

Very nice! Btw, I found something which was wrong:
Posted Image
Everything is good except that the place wehere usually the shadow was, nothing is now.
  • 0

The latest game news (Dutch): GameRSS game nieuws

#19 >Leroy222<

>Leroy222<

    GMC Member

  • New Member
  • 473 posts

Posted 08 October 2006 - 06:38 PM

Awesome. I have waited so long for this :ph34r:!!
  • 0

#20 omeguito

omeguito

    GMC Member

  • New Member
  • 64 posts

Posted 08 October 2006 - 08:56 PM

Wow, this rocks.

Well, thats certainly an improvement, both graphically, and speed wise.  I got an average of 280 fps, with a Nvidia 7900 card :ph34r:

Congrats,
- Scotley

<{POST_SNAPBACK}>


I disagree. L2S was way faster than this (expectably as it wasn't as advanced).
On L2S I got about average 300 FPS on the demo, on L3S I got about 80 FPS average.

Anyway, extremely nice work!

<{POST_SNAPBACK}>


same
  • 0

#21 arcooke

arcooke

    GMC Member

  • New Member
  • 1055 posts

Posted 08 October 2006 - 10:22 PM

Looking good Pheonix. My only complaint is how difficult it is to upgrade the lighting system in our games. Everything has changed... and it's quite a bit more complicated for the end user now. I actually had to completely remove all traces of lighting in my game and start over from scratch because the error messages I was getting were taller than my screen, so I physically couldn't find out what exactly the problems were.

That's completely understandable though considering how much the core lighting system has changed.

Great work as always. Keep it up!
  • 0

#22 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 09 October 2006 - 02:36 AM

This is really good, but runs kindo slow on my pc with all the fx on.
I noticed that the soft shadows aren't dynamic, can they be? Also they seem to be transparent, perhaps the alpha should be increased just a tad so they still block light correctly while still retaining the look of softedness (real word?). I love the lava metal thingymathing you added, very pretty!

Yep the soft shadows can be dynamic but its a major strain on the GPU. If you worried about the speed check out the engine comparison i made below.

I got that too. I assumed my PC had exhausted it's VRAM but maybe not...

Great engine. Those specular highlights are awesome. I tried switching on bloom and nothing happened. Same with the reflecto-wotcha-majiggets, emmisive thingy, that's it. Got 19-20 on my ****box. I don't want to give out specs cause it's embarrassing. Here they are anyway:

~3GHz celeron D
480 MB ram
32 MB vram

Yea your probably right about the vram overuse, at minimum(without glow or bloom.... but you can have spec on) this engine will require 3 screen sized surfaces.

Very nice! Btw, I found something which was wrong:
user posted image
Everything is good except that the place wehere usually the shadow was, nothing is now.

I dont think thats an error, its partly due to the nature of a bloom filter which is meant to spread light around obstacles, and partly because your holding the light directly above the shadow caster.

Looking good Pheonix. My only complaint is how difficult it is to upgrade the lighting system in our games. Everything has changed... and it's quite a bit more complicated for the end user now. I actually had to completely remove all traces of lighting in my game and start over from scratch because the error messages I was getting were taller than my screen, so I physically couldn't find out what exactly the problems were.
That's completely understandable though considering how much the core lighting system has changed.
Great work as always. Keep it up!

Unfortunately thats the price we pay for increasing comlexity, ever heard of the chaos theory. I decided to spread the defining and non realtime code over several scripts, just to make it easier for the end user.... but its always a compromise between features and usability.

It's so sweet.
I only got 40fps with the full version high spec with everything on.
So I got a question.
Can you scale down the surface (optional)?
So you don't need that high sys requirements for it.
You could run a test which decides to scale down or not.
This way, more people can play games that uses L3S
Cheers

I may make scaling own the surfaces an option in the future but its not supported right now.

Great, this is very well done !
but true...it's a bit slow i've got 28 FPS with all the effects on.

Sounds cool and nice, but my pc simply didn't have the power to run it well, I guess.
I got 5 FPS with everything off, and 1 FPS with everything on.
Sweet to look at, but not useful for me =\.
Not everyone have pro computers.

I disagree. L2S was way faster than this (expectably as it wasn't as advanced).
On L2S I got about average 300 FPS on the demo, on L3S I got about 80 FPS average.
Anyway, extremely nice work!

I think you guys may be a bit suprised at just how fast L3S is..... even when not making use of static casters, etc. I've created a little example comparing L3S full, L3S lite and L2S full in the exact same conditions (4 light casters & 16 shadow casters). Heres the link:

Engine Comparison

In my test i averaged pretty much the exact same Fps for all 3 engines, 145fps. The reason the examples are slow (well at least high vram users) is because even when the bloom and glow are off, i still have to keep there surfaces around and while i did hugely increase the complexity i still managed to make a few nifty optimisations.

Anyway thanks all for your support, and keep up with the bug reports it would be a minor miracle if i didnt make any mistakes in an engine this complex.

Cheers,
  • 0

#23 GearGOD

GearGOD

    Deus Verus

  • GMC Member
  • 2153 posts

Posted 09 October 2006 - 03:52 AM

You're counting the VRAM usage wrong. When you have a surface of 640x480 the actual dimensions are 1024x512

var i; i=1;
while i<argument0 i = i << 1;
return i;

There are quite possibly more efficient methods but the one I relied on when needing this used a precomputed table...I think.
  • 0
Engineers are not programmers. Stop thinking that you can save a few bucks by writing code yourself instead of hiring a programmer. Your code sucks.

#24 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 09 October 2006 - 03:58 AM

You're counting the VRAM usage wrong. When you have a surface of 640x480 the actual dimensions are 1024x512

var i; i=1;
while i<argument0 i = i << 1;
return i;

There are quite possibly more efficient methods but the one I relied on when needing this used a precomputed table...I think.

<{POST_SNAPBACK}>

Ahhh i see, it makes it to the nearest power of 2, ill fix that now. I think i will just use your script instead of a precomputed table since this is mainly a debig script and doesnt need to be blindingly fast.

EDIT: Actually ill just use power(2,ceil(log2(argument0)))

Edited by Pheonix101, 09 October 2006 - 04:07 AM.

  • 0

#25 GearGOD

GearGOD

    Deus Verus

  • GMC Member
  • 2153 posts

Posted 09 October 2006 - 04:07 AM

In that case it's power(2,ceil(log2 (argument0))). I suppose in the case of GM it may be faster but in a compiled enviroment, no - which is why I didn't think of mentioning that, silly me.
Edit: then again, 2 << ceil(log2(argument0))-1 would probably be on even ground.. In a compiled language.

Edited by GearGOD, 09 October 2006 - 04:10 AM.

  • 0
Engineers are not programmers. Stop thinking that you can save a few bucks by writing code yourself instead of hiring a programmer. Your code sucks.

#26 bendodge

bendodge

    File Host

  • GMC Member
  • 1237 posts

Posted 09 October 2006 - 05:20 AM

In that case it's power(2,ceil(log2 (argument0))). I suppose in the case of GM it may be faster but in a compiled enviroment, no - which is why I didn't think of mentioning that, silly me.
Edit: then again, 2 << ceil(log2(argument0))-1 would probably be on even ground.. In a compiled language.

(The sound you just heard was the heads of hundreds of GMC members exploding.) Could you comment that for peasants like me? :D
  • 0
The government can't save you.
Time does not negate impossibility.

#27 GearGOD

GearGOD

    Deus Verus

  • GMC Member
  • 2153 posts

Posted 09 October 2006 - 05:41 AM

Very simple. Video cards don't create textures of non n^2 sizes. When GM does it, it actually assigns a texture which is the nearest highest power (ie 100 to 128, 700 to 1024, 1000 to 1024). The functions in one way or another compute that size. The << symbol is for bitwise shift, which is equivalent to dividing or multiplying a number by 2.
  • 0
Engineers are not programmers. Stop thinking that you can save a few bucks by writing code yourself instead of hiring a programmer. Your code sucks.

#28 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 09 October 2006 - 05:47 AM

(The sound you just heard was the heads of hundreds of GMC members exploding.) Could you comment that for peasants like me? unsure.gif

Since im bored and its actually pretty simple, ill try and explain it to you. Although you might want to read up on bitwise operators, anyway but here how i would explain it:

i) 2 << X, will shift the byte that represent 2 , AKA (128 end) 00000010 (1 end), X places to the left.... so if X=3 then the result would be 00010000 which equals 16 or 2^4. From this we can say that: 2^X = 2 << X-1

ii) log2(argument0) will find what power of 2 which equals argument0, so this will finding X in the above statement.

iii) Since video memory must make textures with dimensions of 2^X (eg 128, 256, 512,etc) we need to find the upper limit of the power using ceil.

So once we sub everthing in we get: R=2 << ceil(log2(argument0)-1).... it obviously will not work with textures with a width of 0 since nothing X^Y =0 except when X=0, which is a special case.

EDIT: Damn you GearGOD you just did that to spite me! XD.

Edited by Pheonix101, 09 October 2006 - 05:51 AM.

  • 0

#29 bendodge

bendodge

    File Host

  • GMC Member
  • 1237 posts

Posted 09 October 2006 - 07:03 AM

That is nicely explained, but I can't count binary. I am learning though. I'll reread after I am done...Thanks
  • 0
The government can't save you.
Time does not negate impossibility.

#30 The eleventh plague of Egypt

The eleventh plague of Egypt

    GMC Member

  • GMC Member
  • 1045 posts
  • Version:Unknown

Posted 10 October 2006 - 02:32 PM

(The sound you just heard was the heads of hundreds of GMC members exploding.) Could you comment that for peasants like me? unsure.gif

Since im bored and its actually pretty simple, ill try and explain it to you. Although you might want to read up on bitwise operators, anyway but here how i would explain it:

i) 2 << X, will shift the byte that represent 2 , AKA (128 end) 00000010 (1 end), X places to the left.... so if X=3 then the result would be 00010000 which equals 16 or 2^4. From this we can say that: 2^X = 2 << X-1

ii) log2(argument0) will find what power of 2 which equals argument0, so this will finding X in the above statement.

iii) Since video memory must make textures with dimensions of 2^X (eg 128, 256, 512,etc) we need to find the upper limit of the power using ceil.

So once we sub everthing in we get: R=2 << ceil(log2(argument0)-1).... it obviously will not work with textures with a width of 0 since nothing X^Y =0 except when X=0, which is a special case.

EDIT: Damn you GearGOD you just did that to spite me! XD.

<{POST_SNAPBACK}>



I'm not sure I understood: is it a bug, or it's our duty to find appropriate textures ?
And, if it's a bug, are you going to fix it ?

Edited by The eleventh plague of Egypt, 10 October 2006 - 02:36 PM.

  • 0

#31 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1458 posts
  • Version:Unknown

Posted 10 October 2006 - 03:21 PM

Apparently you completely misunderstood. It's not a bug, neither something to worry much about.

Pheonix, this is quite a nice engine, I'm surprised you've finished it quite fast... I got about 60 FPS with all enabled. I though wonder if you cannot "recycle" surfaces during steps in some way, to decrease VRAM usage.

About your calculations in surface size, hmm, does this mean that even though I have a 640x480 surface, it takes up the same memory as a 1024x768? Wow... I have to reconsider some things with surfaces in my game... those that are screen replacements especially.

Edited by Schreib, 10 October 2006 - 03:25 PM.

  • 0
~ Tiefling | DeviantART gallery See my spacescapes!
GM Obfuscator | Protect your games from prying eyes. Get it now!
Motto: Noli turbare axiomates meos!

#32 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 12 October 2006 - 01:23 AM

I'm not sure I understood: is it a bug, or it's our duty to find appropriate textures ?
And, if it's a bug, are you going to fix it ?

It just a little screw up on my part, my video memory calculation isnt correct because textures are stored in memory with lengths and widths which are the power of 2. I have fixed it but i dont think it warrents an update, im waiting for more bugs to come trickling through.

Apparently you completely misunderstood. It's not a bug, neither something to worry much about.

Pheonix, this is quite a nice engine, I'm surprised you've finished it quite fast... I got about 60 FPS with all enabled. I though wonder if you cannot "recycle" surfaces during steps in some way, to decrease VRAM usage.

Yea thats a good idea, But im pretty sure im doing all the recycling i can, both the global.LS_light and global.LS_shadow are recycled in the specular highlight pass. Only the Light Bloom and Glow Filter require additional surfaces, but the minimum is three screensized surfaces.

About your calculations in surface size, hmm, does this mean that even though I have a 640x480 surface, it takes up the same memory as a 1024x768? Wow... I have to reconsider some things with surfaces in my game... those that are screen replacements especially.

Actually a 640x480 surface would take up 1024x512 (which is exactly 2mb) since 768 isnt an integer power of 2. Yea but still, its pretty standard for video cards nowdays to have at least 64mb of memory, which discounted all the other junk could fit 32 640x480 surfaces. One thing im interested in is whether, due to there increased dimensions they require more fill rate? Although i've got a feeling that the graphics card would be smart enough to not calculate the null regions.

Cheers, and thanks all for your support.
  • 0

#33 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 12 October 2006 - 01:24 AM

--woops wierd double post---

Edited by Pheonix101, 12 October 2006 - 01:26 AM.

  • 0

#34 kakemot

kakemot

    GMC Member

  • New Member
  • 461 posts

Posted 12 October 2006 - 02:14 AM

This was very nice... Although I wouldn't use such a lighting engine.
Amazing quality like that don't fit into my projects. :GM5:
  • 0

#35 GearGOD

GearGOD

    Deus Verus

  • GMC Member
  • 2153 posts

Posted 22 October 2006 - 02:39 PM

One feature I would like to see is the ability to calculate lighting for an arbitrary segment of the room that may be out of view, without interfering with the main view's lighting. Perhaps a function that is given x,y,width,height of a region, and returns a surface containing it's lighting data. If it could handle scaling down, would be even better.
  • 0
Engineers are not programmers. Stop thinking that you can save a few bucks by writing code yourself instead of hiring a programmer. Your code sucks.

#36 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 23 October 2006 - 08:42 AM

This was very nice... Although I wouldn't use such a lighting engine.
Amazing quality like that don't fit into my projects.

Haha, thanks. Unfortunately i think this is true of many GM games, apart from a few notable exceptions nobody seems willing enough to invest in high quality graphics, effects, etc.

One feature I would like to see is the ability to calculate lighting for an arbitrary segment of the room that may be out of view, without interfering with the main view's lighting. Perhaps a function that is given x,y,width,height of a region, and returns a surface containing it's lighting data. If it could handle scaling down, would be even better.

Ahhh another good idea, especially since its fairly easy to implement. The scaling down thing might take me a little while to figure out since i'll try to use d3d_transform_set_scaling() with the shadow casters to save fillrate and im not entirely sure of the algorithm it uses to make this transformation.... although im guessing it merely gets the vector to the translation position and multiplies it by the scaling factor. I'll also probably add scaling to the surface based static casters.

Anyway i guess ill be uploading a new version with a few bug fixes and extra features some time soon.

Cheers,
  • 0

#37 havoc

havoc

    GMC Member

  • New Member
  • 127 posts

Posted 24 October 2006 - 09:12 AM

This was very nice... Although I wouldn't use such a lighting engine.
Amazing quality like that don't fit into my projects.

Haha, thanks. Unfortunately i think this is true of many GM games, apart from a few notable exceptions nobody seems willing enough to invest in high quality graphics, effects, etc.

One feature I would like to see is the ability to calculate lighting for an arbitrary segment of the room that may be out of view, without interfering with the main view's lighting. Perhaps a function that is given x,y,width,height of a region, and returns a surface containing it's lighting data. If it could handle scaling down, would be even better.

Ahhh another good idea, especially since its fairly easy to implement. The scaling down thing might take me a little while to figure out since i'll try to use d3d_transform_set_scaling() with the shadow casters to save fillrate and im not entirely sure of the algorithm it uses to make this transformation.... although im guessing it merely gets the vector to the translation position and multiplies it by the scaling factor. I'll also probably add scaling to the surface based static casters.

Anyway i guess ill be uploading a new version with a few bug fixes and extra features some time soon.

Cheers,

<{POST_SNAPBACK}>


Can't wait. Hope you can find some way of decreasing the size of the surface. Then it might run on my computer ! :medieval:

EDIT: when i was playing round with it, i noticed that the when you moved the crates near the static light the shadows don't reform. Is there a way to redraw shadows when something moves. For most games it, it would prove useful since most of the time, most objects don't move around, only when a bullet is fired or when a character moves are shadows required to be re-drawn. Hope you get my terrible english lol

Edited by havoc, 24 October 2006 - 09:22 AM.

  • 0

#38 >Leroy222<

>Leroy222<

    GMC Member

  • New Member
  • 473 posts

Posted 24 October 2006 - 10:42 AM

Tested it out a lot more now. the spec highlghts are great, but the bloom is kinda ugly.

Keep up the good work!
  • 0

#39 GearGOD

GearGOD

    Deus Verus

  • GMC Member
  • 2153 posts

Posted 24 October 2006 - 10:52 AM

Can't wait. Hope you can find some way of decreasing the size of the surface.

There's no way to decrease the size of the surface because at anything below pixel-perfect, shadows look like crap. Reduce the size of the view and it'll run on your computer.
  • 0
Engineers are not programmers. Stop thinking that you can save a few bucks by writing code yourself instead of hiring a programmer. Your code sucks.

#40 low_energy_cycle

low_energy_cycle

    GMC Member

  • New Member
  • 6 posts

Posted 24 October 2006 - 11:05 PM

Gack!
Call me a total moron if you like, but whenever I try to run your engine i get the following error:

Unknown function or script: surface_set_target

Any ideas? I wanna see the pretty lights too...
  • 0

#41 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 25 October 2006 - 07:55 AM

Can't wait. Hope you can find some way of decreasing the size of the surface. Then it might run on my computer ! happy.gif

Apart from reducing the view to 512x512, use L3S lite since it doesnt require any of the post processing extra surfaces.

EDIT: when i was playing round with it, i noticed that the when you moved the crates near the static light the shadows don't reform. Is there a way to redraw shadows when something moves. For most games it, it would prove useful since most of the time, most objects don't move around, only when a bullet is fired or when a character moves are shadows required to be re-drawn. Hope you get my terrible english lol

An automated version of this idea was considered, but the sheer number of variable checks (all shadow object vertices, all light caster variables, etc) required each step would make it a whole lot of overhead for little to no gain.... only a compiled language would benefit from a similar system. Although.... this idea can be fairly easily implemented into the system, since the surface & mesh static casters can call their updates when ever you like. Also i should note that there is a class for "always dynamic" shadow casters that will always be dynamically cast when they enter a static light. For instance, if you tried the star instead of the box it would have cast as normal.

Tested it out a lot more now. the spec highlghts are great, but the bloom is kinda ugly.

Keep up the good work!

Thanks, unfortunately i dont think its my fault that the bloom is so crap, its simply because that effect doesnt translate well to a top down 2d environment. Try fiddling with the Bloom options to see if you can get the desired effect. If any ones got a real bloom i would be interested to see what the effect should look like.

Gack!
Call me a total moron if you like, but whenever I try to run your engine i get the following error:

Unknown function or script: surface_set_target

Any ideas? I wanna see the pretty lights too...

haha, unfortunately this is an error which occurs when you dont have enough video ram. Your best bet is to follow what i outlined in the first part of this post.

Cheers,
  • 0

#42 GearGOD

GearGOD

    Deus Verus

  • GMC Member
  • 2153 posts

Posted 25 October 2006 - 08:01 AM

QUOTE
Gack!
Call me a total moron if you like, but whenever I try to run your engine i get the following error:

Unknown function or script: surface_set_target

Any ideas? I wanna see the pretty lights too...
haha, unfortunately this is an error which occurs when you dont have enough video ram. Your best bet is to follow what i outlined in the first part of this post

haha, unfortunately this is an error which occurs when you dont have enough video ram. Your best bet is to follow what i outlined in the first part of this post.

That error happens when you don't use GM6.1 reg
  • 0
Engineers are not programmers. Stop thinking that you can save a few bucks by writing code yourself instead of hiring a programmer. Your code sucks.

#43 low_energy_cycle

low_energy_cycle

    GMC Member

  • New Member
  • 6 posts

Posted 25 October 2006 - 08:20 AM

haha, unfortunately this is an error which occurs when you dont have enough video ram. Your best bet is to follow what i outlined in the first part of this post.


Thanks. I'll try all that when I get home from work, though I've got a 64mb graphics card.

That error happens when you don't use GM6.1 reg


Well thats funny since I've been using registered versions of GM for the last two years. Don't you think that was the FIRST thing I checked?
  • 0

#44 StopThatGuy

StopThatGuy

    GMC Member

  • GMC Member
  • 641 posts

Posted 25 October 2006 - 10:12 AM

Absolutely brilliant
10/10
Im using it for my new TDS Horror :medieval:
  • 0

#45 pyros_hotdog

pyros_hotdog

    GMC Member

  • New Member
  • 27 posts

Posted 25 October 2006 - 10:55 AM

well, it ran way faster than it did before in my system.

but if you're gonna make anothher version, what are you gonna add, how about reflections or radiosity(the lighting/reflected light of other objects affect the overall lighting of another object) but wether or not you decide to make an L4S, this thing totally rocks(you really have the skillz man)
  • 0

#46 >Leroy222<

>Leroy222<

    GMC Member

  • New Member
  • 473 posts

Posted 25 October 2006 - 02:23 PM

The bloom would benefit from softer edges, it is too sharp atm.
  • 0

#47 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 26 October 2006 - 08:29 AM

Thanks. I'll try all that when I get home from work, though I've got a 64mb graphics card.

Hmmm, you should probably have enough vram then. I use a 128mb card, and it runs fine. If the problem persists and your not misusing it in anyway, then i guess i may have a bug....

well, it ran way faster than it did before in my system.

but if you're gonna make anothher version, what are you gonna add, how about reflections or radiosity(the lighting/reflected light of other objects affect the overall lighting of another object) but wether or not you decide to make an L4S, this thing totally rocks(you really have the skillz man)

Woah thats a bit far ahead at the moment, L4S hasnt even entered my mind. I think this engine, as it is, is pushing the boundaries for fast-enough lighting in GM. At the moment. Im mainly just looking to modify the current engine to make it more user friendly. As far as integrating radiosity, i dont think it is very likely.... all the methods i've seen require multiple passes but thanks for the suggestion.

The bloom would benefit from softer edges, it is too sharp atm.

If you turn the blur up, it will become softer. I didnt do this initially because its just about the easiest way to eat up fill rate.

Cheers,
  • 0

#48 >Leroy222<

>Leroy222<

    GMC Member

  • New Member
  • 473 posts

Posted 26 October 2006 - 09:04 AM

I see. Ill fiddle with it and tell you what works best.
  • 0

#49 Consoft

Consoft

    GMC Member

  • GMC Member
  • 449 posts

Posted 26 October 2006 - 10:15 AM

I'm having much difficulty trying to get my polygon's vertexes. It just doesn't work! Is it possible to create something that writes vertexes to a file for this? Like gm physics if you will. I desperately need this by like 2 days, cos i'm doing a school project and wanna ace the topdown section ;)

I tryed to get the x and y from the gm sprite window. I asked the same question in L2S and u answered it for me, but when I try using the script you gave me it comes up with an error unknown variable LS_shadow_1. Here is the script you gave me to use.

L3S_vertex_add2
//argument0= x position on sprite
//argument1= y position on sprite
//argument2= relative z

var xx,yy;
xx=sprite_get_xoffset(sprite_index)
yy=sprite_get_yoffset(sprite_index)
ds_list_add(LS_shadow_1,point_distance(xx,yy,argument0,argument1))
ds_list_add(LS_shadow_2,point_direction(xx,yy,argument0,argument1))
ds_list_add(LS_shadow_z,argument2)

Edited by Consoft, 26 October 2006 - 10:27 AM.

  • 0
19 / Australia. [GML/Java/C++] Known as kkg, HeXeN and elimzke as well.
Make games in GML, compile them in C++! http://www.enigma-dev.org [Windows/Linux/Mac]

KUICS Australia PTY LTD

#50 low_energy_cycle

low_energy_cycle

    GMC Member

  • New Member
  • 6 posts

Posted 26 October 2006 - 08:02 PM

Hmmm, you should probably have enough vram then. I use a 128mb card, and it runs fine. If the problem persists and your not misusing it in anyway, then i guess i may have a bug....


Don't worry yourself mate. I downloaded another copy and it worked just fine. God knows why...

Great work btw! This is stunning! I shouldn't have too much trouble implementing it either.
  • 0