FAQ  •  Register  •  Login

sun light in DP

Moderator: Inside3D Admins

<<

toneddu2000

Posts: 321

Joined: Tue Feb 24, 2009 4:39 pm

Location: Italy

Post Sat Apr 14, 2012 9:59 pm

sun light in DP

Hi guys, do you know if there is the possibility to add a dynamic sun light in Darkplaces Engine? I know that is possible to use q3 shader q3map_sun key but I'd like to use a real dynamic sun, like far cry 2 engine. And, tied to the first question, is it possible to move dynamic lights in dp? For example, linked to an object, so when the object moves even the dynamic light moves and casts dynamic lights. Or linked to a swinging model, so when the model swings all the shadows are dynamically spread on the map (like a map in far cry 1 or doom 3)...groovy :)

thanks in advance
<<

Seven

Posts: 238

Joined: Sat Oct 06, 2007 8:49 pm

Location: Germany

Post Sun Apr 15, 2012 1:16 pm

Re: sun light in DP

Hello toneddu2000,

I have no answer for you, but I want to lead you to 2 very interesting threads with a quite similar topic.

Please look in here:
viewtopic.php?f=6&t=4355

And here (see youtube clip in 1st post and 2nd post):
viewtopic.php?f=2&t=4274

Good luck.
<<

toneddu2000

Posts: 321

Joined: Tue Feb 24, 2009 4:39 pm

Location: Italy

Post Sun Apr 15, 2012 5:05 pm

Re: sun light in DP

thank you for your input, Seven. I took a look even at Blood Ominicide code but, with no luck. I'm pretty sure DP can handle dynamic sun lights. Infact if you use r_editlights 1 and, pointing to a light, the light settings mask appears showing an "angles" value. I supposed tweaking angles I could transform a "spotlight" into a direct light, like sun, but altering those values it doesn't set any changes.
<<

Spike

Posts: 2084

Joined: Fri Nov 05, 2004 3:12 am

Location: UK

Post Sun Apr 15, 2012 7:45 pm

Re: sun light in DP

the problem with dp's lights is that you cannot configure the lights to cast shadows along parallel planes. That is, such a light will not be a near-infinite distance away from the ground. You might be able to have a high enough sky for it in rooms you make, but you'll see the shadows move weirdly on eg: start.

DP doesn't really do spotlights either. They're just cubemaps with all but one side masked out. They won't help you with realistic shadows.

You can use TENEBRAE_GFX_DLIGHTS to create a movable dynamic light.

self.light_lev = 3000; //really big light
self.color = '0.5 0.5 0.5'; //white light that won't wash out everything else
self.style = 0; //lightstyle, so it doesn't flicker
self.pflags = PFLAGS_FULLDYNAMIC; //so its visible even without a model
self.angles = vectoangles(lightdirection); //rotate the cubemap to face some spot
self.skin = 5; //cubemap number, cubemaps/%i%s.tga where %i is the skin and %s is some pos/neg etc thing.

then give it a think function and get it to move to some spot based upon the result of sin/cos.

like I say, I don't think cubemaps will be that useful to you, other than perhaps for simulating a cloud layer? so you probably want to set skin to 0.
<<

toneddu2000

Posts: 321

Joined: Tue Feb 24, 2009 4:39 pm

Location: Italy

Post Mon Apr 16, 2012 10:46 am

Re: sun light in DP

Thanks a lot Spike for the clarification about lights and cubemaps, infact I always asked myself what "angles" stands for.
So there's no possibility to create a sun in DarkPlaces, well ok.
I wonder how Blood Omnicide team did the dawn/sunset effect in real time, maybe with a very big light as you pointed.
I'll try with movable lights to do some tests. If I should discover something interesting I'll post it here.

I only didn't understand this
self.skin = 5; //cubemap number, cubemaps/%i%s.tga where %i is the skin and %s is some pos/neg etc thing.

can you please make an example, because I never used cubemaps
thanks
<<

Spike

Posts: 2084

Joined: Fri Nov 05, 2004 3:12 am

Location: UK

Post Mon Apr 16, 2012 12:04 pm

Re: sun light in DP

cubemaps on lights can be used for projective texturing. its basically to model a filter or some such around the bulb/lightsource.
the most obvious example is when the lightsource is on the other side of a stained-glass window. with a texture on one side with the rest pure black, you can make it look like the light is shining through the window, when in fact its actually on the near side.
Another use is to project light as if it came from a florescent tube, or 4.
They're really just for projective texturing effects.
<<

toneddu2000

Posts: 321

Joined: Tue Feb 24, 2009 4:39 pm

Location: Italy

Post Mon Apr 16, 2012 6:57 pm

Re: sun light in DP

ok now I understood. thanks Spike
<<

goldenboy

User avatar

Posts: 740

Joined: Fri Sep 05, 2008 11:04 pm

Location: Kiel

Post Fri Apr 20, 2012 3:06 pm

Re: sun light in DP

If it can use lightmaps at the same time as dynamic light, you can use static sunlight.
<<

toneddu2000

Posts: 321

Joined: Tue Feb 24, 2009 4:39 pm

Location: Italy

Post Fri Apr 20, 2012 10:32 pm

Re: sun light in DP

sorry but I didn't get your point, Do you mean by using q3map_sun in Radiant? Yes that would be the alternative. The only problem is that it's static light and doesn't dinamically lit monsters or dynamic objetcs
<<

goldenboy

User avatar

Posts: 740

Joined: Fri Sep 05, 2008 11:04 pm

Location: Kiel

Post Sat Apr 21, 2012 2:16 pm

Re: sun light in DP

Yes, true. It would be mixed lighting, static and dynamic.

TBH I don't think static vs. dynamic sunlight in outdoor areas would make such a huge difference. Static sunlight will still cast shadows on geometry.
<<

toneddu2000

Posts: 321

Joined: Tue Feb 24, 2009 4:39 pm

Location: Italy

Post Sat Apr 21, 2012 2:47 pm

Re: sun light in DP

Static sunlight will still cast shadows on geometry.

Are you sure? I always tought that static lights lit only mapping elements (brushes and misc_models) but not characters.
If that you said is true I don't need a dynamic sun!
I'll test it immediately!
<<

goldenboy

User avatar

Posts: 740

Joined: Fri Sep 05, 2008 11:04 pm

Location: Kiel

Post Sat Apr 21, 2012 6:23 pm

Re: sun light in DP

geometry = brushes etc.
<<

toneddu2000

Posts: 321

Joined: Tue Feb 24, 2009 4:39 pm

Location: Italy

Post Sat Apr 21, 2012 10:46 pm

Re: sun light in DP

tried. With r_shadows 1 sun casts shadows even on characters but honestly are ugly. I think I don't to use open space on dp, at least until LordHavoc won't create dynamic sun lights! :)
<<

toneddu2000

Posts: 321

Joined: Tue Feb 24, 2009 4:39 pm

Location: Italy

Post Tue May 15, 2012 12:22 pm

Re: sun light in DP

This is Darkplaces Engine. And this seems to be dynamic! How they did this?! :shock:
<<

frag.machine

User avatar

Posts: 1485

Joined: Sat Nov 25, 2006 1:49 pm

Post Wed May 16, 2012 2:30 am

Re: sun light in DP

toneddu2000 wrote:This is Darkplaces Engine. And this seems to be dynamic! How they did this?! :shock:


I'd be happy with just the smooth transition between day/night skyboxes. How can I get this in DP ? Shaders ?
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
Next

Return to Mapping

Who is online

Users browsing this forum: No registered users and 0 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.
Icons provided by Aha Soft