Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +0€

Current balance: -195€
(last updated 03/2017)

Please make a donation if you want to help keeping The-Starport online:

Bitcoin address:
Thanks!
Collapse/Expand Random Image
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
31 user(s) are online (17 user(s) are browsing Forum)

Members: 0
Guests: 31

more...
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 43 users playing Freelancer on 49 servers.
March. 31, 2017

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



[LightSource] Direction?

Joined:
2013/3/16 7:49
Group:
Registered Users
Posts: 28
Offline
So a system has a LightSource (taken from Li01):

Code:
[LightSource]
nickname = System_LIGHT
pos = 642,0,198
color = 255,255,255
range = 120000
type = DIRECTIONAL
atten_curve = DYNAMIC_DIRECTION


Now this light is DIRECTIONAL, but a DX8 directional light needs.. well, a direction.

Does anyone know what direction Freelancer gives to these lights?

Posted on: 2/9 20:10
Top
Re: [LightSource] Direction?
Just can't stay away
Joined:
2010/2/17 20:45
From Germany
Group:
Registered Users
Senior Members
Posts: 461
Offline
As far as I know they are not really directional. Every light you encounter in FL are point lights. At least I haven't seen any "valid" directional light in any of the game's ini files.

In the Freelancer.exe, valid types are DIRECTIONAL, CONE, POINT and AMBIENT. How or if they are used should be experimented with.

Take a look into "igraph.ini" in the DATA directory. There those atten_curves are defined. They are nothing else than different kind of curves how the light magnitue is depending on the max range you set up in the system files.

Posted on: 2/9 22:22

Edited by Skotty. on 2017/2/9 22:28:17
How to create .SUR files - Tutorial
Top
Re: [LightSource] Direction?
Starport Admin
Joined:
2009/2/21 21:42
Group:
Webmasters
Registered Users
Posts: 3410
Offline
They are classified as directional lights (they use D3DLIGHT_DIRECTIONAL), but they are used as point lights. Their range is the range value indicated in the INIs and they use linear falloff with distance (not quadratic as a point light would).

Posted on: 2/9 22:48
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try."
-Peggy Noonan
Top
Re: [LightSource] Direction?

Joined:
2013/3/16 7:49
Group:
Registered Users
Posts: 28
Offline
I hooked into Direct3DDevice8:etLight while flying in the New York system, and it gave me some interesting values.

Code:

---------------
0D81C424: Directional light set! (frame 1000)
Color: 0.842580, 0.842580, 0.842580
Direction: 0.010173, -0.073497, 0.997244
Ambient: 0.000000, 0.000000, 0.000000
Specular: 0.000000, 0.000000, 0.000000,
Range: 120000.000000

---------------
0D81C424: Directional light set! (frame 1029)
Color: 0.842580, 0.842580, 0.842580
Direction: -0.731640, -0.073304, 0.677739
Ambient: 0.000000, 0.000000, 0.000000
Specular: 0.000000, 0.000000, 0.000000,
Range: 120000.000000


So the Direction (D3DLIGHT8.Direction) seems to change based on something? This is despite the docs saying Direction is - "Direction that the light is pointing in world space, specified by a D3DVECTOR structure. This member only has meaning for directional lights. This vector need not be normalized, but it should have a nonzero length."

The Color is also not the same as in the INI (I think this is an implementation of falloff since I'm pretty sure D3DLIGHT_DIRECTIONAL doesn't support attenuation).

I'd like to clarify I am looking for the direction of the light. Falloff and atten_curves I already know of

Posted on: 2/9 23:53

Edited by Ichiru on 2017/2/10 0:06:54
Top
Re: [LightSource] Direction?
Not too shy to talk
Joined:
2015/1/18 12:56
From The Hague, EU
Group:
Registered Users
Posts: 67
Offline
There is a direction parameter, for example in Bw02.ini:
Code:
[LightSource]
nickname = Bw02_walker_light
pos = 10828, 0, -226
color = 225, 100, 6
range = 100000
type = DIRECTIONAL
direction = -0.845085, 0.430582, 0.316907

Tested: it works, this is the direction for DIRECTIONAL type lights. When not included, 0,0,-1 seems to be used, unless some atten_curve is added, in which case it behaves like a POINT light (the Li01 example).

EDIT: oops made typo, fixed now

Posted on: 2/10 17:53

Edited by Gold_Sear on 2017/2/14 17:33:03
Pirate Nation mod -- under construction
Top