Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
anwserman
15
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 25th Jul 2011 10:15 Edited at: 25th Jul 2011 10:38
I have a quick question regarding hardware lights. Let's say I have two objects in my scene and a hardware light.

Object A is in-between Object B and the hardware light. Object A is completely blocking Object B. However, Object A is not lit by the light, and is not casting shadows, whereas Object B is on both accounts.

Will Object B receive any light from the light?

Assume this is true for the X/Y planes:


My assumption would be that B would NOT receive any light from the light, as Object A - although not casting any shadows - is directly in-front of it, blocking the line-of-sight. Is this true, or does an object have to cast shadows in order to block another object from being influenced by a light?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Jul 2011 12:12
I'm no expert on this area, but from experience I know that the built in light commands in DBP don't cast shadows, so object B would be lit just as if object A weren't there. Though I think there is a plugin (DarkLights?) that does take care of that factor. Requires some immense amount of processing though...

My advice to you is to use lightmaps where ever possible. If you have lights that never move, and objects that never move (like a level or something), it's much easier to use lightmaps than real-time lighting. The only reason you'd ever have to use real-time lightning would be something like a flashlight on your sniper, or maybe a flashing red light in a hallway? Though even those have their work-arounds. Flashlights can be simulated with a shader from Evolve, and flashing red lights can be done with a lightmap which is lightened and darkened to simulate the flashing.

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Jul 2011 14:19
I'm confused. If as you say object A is not lit how can it block light - or, in other words, if light cannot reach object A then how could it reach object B? At least that is the real world situation.

There is, however, one situation in DBPro where, without shadows, object B would be lit and object A wouldn't. That can happen, for example, as follows. Suppose object A is a very large plain, e.g. 2000x2000, positioned 100 units from the light and object B is a much smaller object, e.g. a sphere radius 10, positioned 200 units from the light. If the light's range is 400 then object B will be lit since all of its vertices will be within range of the light. Object A on the other hand might not be lit because all its vertices (the corners) could be further than 400 units away even though it's centre is only 100 units away. The default lighting used by DBPro uses the light reaching each vertex to calculate the intermediate parts of the object. So in this extreme case the whole object would be unlit even though it is infront of object B.

Is that your situation?
anwserman
15
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 25th Jul 2011 20:42
Green Gandalf -

Object A is lit by its own accord, via ambience or something along those lines. It does not respond to hardware lights because I am disabling the object's ability to respond to hardware lights. Object B on the other hand, will respond to hardware lights because I am enabling it to do so.

But from what you said, it sounds like there's a distance test done from the light to each vertex to see how it's lit. So, assuming both A and B are within range of the light, B will still probably be lit as well (even if there isn't direct line-of-sight between the light and object B)
anwserman
15
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 25th Jul 2011 20:48
@TheComet, your post didn't show up until just now for some reason, but I am using mostly lightmaps - but there are some objects in the maps that will need to be dynamically lighted. Not too many, but for 'dynamic' objects this will be a necessity, people in the map, so on and so forth.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Jul 2011 21:49
It is posible to use lightmaps and check with a second camera the color pixel under the objects to udjust its colour with set blend maping on.
Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Jul 2011 22:33
Quote: "B will still probably be lit as well (even if there isn't direct line-of-sight between the light and object B)"


Yes it will unless you enable shadows. Here's some demo code posted by Spooky. For some reason I can't find the original thread but I think this is Spooky's original code apart possibly from some minor changes by me.



Quote: "It is posible to use lightmaps and check with a second camera the color pixel under the objects to udjust its colour with set blend maping on."


Yes, I'd forgotten that. A neat demo of that idea was posted a while back. Was it you?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Jul 2011 23:08
Quote: "Yes, I'd forgotten that. A neat demo of that idea was posted a while back. Was it you? "



No it wasn`t me...now I don“t remember exactly who was, but it was a great piece of code...I`v got it lost somewhere in my PC

Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Jul 2011 23:13 Edited at: 25th Jul 2011 23:19
Quote: "I`v got it lost somewhere in my PC"


Same here. I'll see if I can find it.

Edit Found it. It was posted by the nerd. Here it is without the exe - you'll need Sparky's Collision dll to compile it.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Jul 2011 23:29
Tnx Green Gandalf. I found aswell the code, but I didn`d remember that it was the nerd ... sometimes I do not remember if I had breakfast I think his idea is the best solution for this purpose.

Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Jul 2011 23:36
Quote: "sometimes I do not remember if I had breakfast"


I know the feeling. I discovered the other day that I had posted complaints/queries about DBPro's specular lighting on at least three separate occasions. Each time someone had offered the solution.

Will I forget again for a fourth time? I have a horrible feeling I know the answer.
anwserman
15
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 26th Jul 2011 03:01
Yeah, thanks for posting that demo! I've found it before and it's quite informative.
Anyway, thinking about it, is it possible to prevent an object from having a shadow being cast onto it?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Jul 2011 02:13
Quote: "Anyway, thinking about it, is it possible to prevent an object from having a shadow being cast onto it?"


Good question.

Login to post a reply

Server time is: 2026-07-10 15:31:42
Your offset time is: 2026-07-10 15:31:42