Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, OptimusPrime, AndrewAMD), 14,882 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Light oriented shadows #32473
08/30/04 08:17
08/30/04 08:17
Joined: Feb 2004
Posts: 58
In space
A
Al Offline OP
Junior Member
Al  Offline OP
Junior Member
A

Joined: Feb 2004
Posts: 58
In space
Hi guys,

I've been wondering when will we have light oriented shadows instead of the sun. Sun orientation really messes shadows up in indoor ( no sun ) areas, which is what I mostly work with. :/

Re: Light oriented shadows [Re: Al] #32474
08/30/04 08:25
08/30/04 08:25
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
They're already possible in 6.3 beta. Set "my.cast = on;" in the dynamic light's action and the shadow will be affected by it as long as the model is within the light's range.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Light oriented shadows [Re: Orange Brat] #32475
08/31/04 10:50
08/31/04 10:50
Joined: Feb 2004
Posts: 58
In space
A
Al Offline OP
Junior Member
Al  Offline OP
Junior Member
A

Joined: Feb 2004
Posts: 58
In space
Thank you Orange

How about static lights, will that ever be possible?



Last edited by Al; 08/31/04 10:52.
Re: Light oriented shadows [Re: Al] #32476
08/31/04 11:00
08/31/04 11:00
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Here's the easy one. Just place a dynamic light object where the static light is at(or around it...whatever works once you get this up and running) and instead of defining a color for it, simply make 0,0,0. Make your lightrange whatever you wish(should be consistent with the static light's range so the shadow is affected while the model is within the lit up area). This way, you will have a nice static light that affects the model's shadow and the dynamic light, itself, won't "mix" with it.

In my own project, I combine two dynamic lights with my static. One is as I described above...0,0,0 and a range. The other has a color and that color affects the highlight that shines on the model. I have my.cast turned off on this light, so it does not affect the shadow. I do this to eliminate the bright spotlight effect on level geometry. That doesn't look so good unless you are using fixed point cameras and can hide it.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Light oriented shadows [Re: Orange Brat] #32477
09/22/04 13:57
09/22/04 13:57
Joined: Feb 2004
Posts: 58
In space
A
Al Offline OP
Junior Member
Al  Offline OP
Junior Member
A

Joined: Feb 2004
Posts: 58
In space
Hi Orange, sorry for not replying sooner, I have been too busy to make anything in 3DGS for the past few weeks. :/ Thank you for the answer, sounds great and I'll try it tonight. You mentioned a second light. What color ( and perhaps what range ) do you usually give it. Do you make it darker than static light?

Last edited by Al; 09/22/04 13:59.
Re: Light oriented shadows [Re: Al] #32478
09/25/04 03:59
09/25/04 03:59
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
The first dynamic light...the one with a color of 0,0,0 and a range that matches or is close to the range of the static light, is what will effect the shadow of the player model. The reason I make it 0,0,0 is so its light will not "mix" with the static lightmap.

The 2nd light should be a smaller range that doesn't touch any surrounding geometry(if there is any). I usually crank the color so that there is a nice stark highlight on my player as they approach and pass under the light. There's actually going to be a little mixing with the static since there is a falloff area but it won't be noticeable if done right.

The reason I use two lights is simply to get more control. If I were to use a single light that affected both the shadow and the desired highlight, there would be a lot of mixing of the two types of light and it wouldn't look very good.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Light oriented shadows [Re: Orange Brat] #32479
09/25/04 10:50
09/25/04 10:50
Joined: Feb 2004
Posts: 58
In space
A
Al Offline OP
Junior Member
Al  Offline OP
Junior Member
A

Joined: Feb 2004
Posts: 58
In space
Hi Orange,
hmm it doesn't seem to work, I put a Shadow caster model next to the static light, gave it the following action:

action ShadowCaster
{
my.lightrange = 300; my.red = 0; my.green = 0; my.blue = 0;
}
and the shadow is still oriented by the sun. What could be wrong? I tried both stencil and normal shadow modes :/

Yeah when a model gets close to the static light it gets way too bright highlight from it, so I see your point with second dynamic light. I assume you made it project a darker color, than the static light?

Last edited by Al; 09/25/04 10:52.
Re: Light oriented shadows [Re: Al] #32480
09/25/04 11:00
09/25/04 11:00
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Put this at the beginning of your dynamic light's action:

Code:

if(my.flag7 == on)
{
my.cast = on;
}
else
{
my.cast = off;
}



Change the "flag7" to whatever best suits your code. Make sure the one with color 0,0,0 has its flag set.

If your light action has a loop, place that code before the loop. No sense in checking that each frame. Also, make sure the player's origin actually enters the light's range. Try giving it a huge one for testing purposes. When I first started out, it would never work since I wasn't making the range large enough.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Light oriented shadows [Re: Orange Brat] #32481
09/25/04 11:10
09/25/04 11:10
Joined: Feb 2004
Posts: 58
In space
A
Al Offline OP
Junior Member
Al  Offline OP
Junior Member
A

Joined: Feb 2004
Posts: 58
In space
Thank you very much, it works! Let me play with the second light now ( the one that fixes the bright static light's highlight ). You mentioned you crank it way up, but I'm thinking - wouldnt that make it even more bright ? I'd think you'd use a darker color?

Last edited by Al; 09/25/04 12:19.
Re: Light oriented shadows [Re: Al] #32482
09/25/04 14:47
09/25/04 14:47
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
I crank the color(between 150 and 255 on the RGB..remember I use neutral light since my game is b&w), but keep a smaller range. My project uses a Noir light and shadow scheme, and really bright highlights are the name of the game.

Like I said, even if the actual light area(the range) doesn't touch any geometry, the falloff area will influence it a tad. You can control this falloff via script(I think it's one of the d3d_ instructions), but I've found the default is best.

You can make the shadow influencer have a range as large as you want. It doesn't actually emit light, so you can get away with it.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1