Jump to content

X-Plane 10 scenery Q & A


tkyler

Recommended Posts

No on the photometric data. X-Plane gets its light effects from a text file called "lights.txt" where light parameters are defined. It's not a file to be trifled with as one typo can bring x-plane down and it really wasn't designed to be tampered with by the layman...so it's definitely a "use at your own risk" thing. Anyhow, you can make light "presets" here and give them names, and the basic things you can control are light color, intensity, how far it "throws", width of beam and also the effect of the "halo"...that is it's angle range of visibility (as in the case of spotlights) and it's magnitude.

So you don't really define x-plane light parameters by the same type of terminology/parameters one would be used to if you are a lighting guru in the business; however, if you understand the terminology and subsequently, the effect, then you can probably adjust the parameters of the x-plane lights to get the generally desired effect; however, the convenience from the photometric data just isn't there. It could probably be put in a script though by an intrepid soul whose name ISN'T Tom though.

X-Plane provides generic, fully "parameterized" lights where, in blender, you can enter all the values and basically get any light you want. The downside is you have to enter all the parameters for the light (9 of em?) In such a case. A valid technique is to simply create a library of lights ready to go OR what I do sometimes, is my default blender template contains text blocks that have all the data in it so I can copy and paste the light data when I need to.

-Tom Kyler

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I'm trying to get accustomed to the new lights, the possibilities seem very promising!

To be on the safe side I figured I should start with the named lights. I read that I should give them a name in Blender like 'town_light_330' or some other name from the list and that I should look for 'LIGHT_NAMED town_light_330' in the obj. file after exporting.

The only thing that shows up in my obj. file however, is the number of lights I used, with no further information...

I'm using Blender 2.49/XPlane2Blender 3.09, could that be the reason? I didn't upgrade yet because Blender's interface changed so much that I felt I had to learn it all over again and I feel kind of 'at home' with 2.49.

So my hope is that I misunderstood something somewhere along the line, could anyone help me out? Thanks :)

Link to comment
Share on other sites

Blender 2.49 is certainly satisfactory, I still use it and all the "official" laminar scripts are written for it. Your success in exporting named lights rests in choosing the right light type and naming it in the correct place in blender. See screenshot. Create a lamp, make sure it's type lamp in the shading panel...then in the edit panel, make sure you name it the name of you named light. The default name there will be 'Lamp' when you create it. When you export out from Blender, the script will look for 1.) Type=Lamp (no spotlight, no sun, etc) and then the name. The exported OBJ with one lamp in it looks as shown below.

post-5-0-00564600-1328028160_thumb.jpg


A
800
OBJ

TEXTURE
POINT_COUNTS 0 0 0 0


LIGHT_NAMED NAME_HERE -3.2854 -5.4923 0.9187

This will get you started with named lights. The newer scripts that I use (not yet available) will allow you to add properties to the light to customize it, but NOT in the way that you think. You will not adjust Blender light properties to adjust the light but rather you will add a property field to a lamp and then type all the light parameters in this text field. I'll probably cover this when the time is right. In the meantime, you can study some of the light parameters of the lights I have included in the x-plane 10 library and cross-reference that with the lights.txt file. You can roll your own named lights if your careful with the lights.txt file. One typo can bring x-plane down.

-Tom Kyler

Edited by tkyler
Link to comment
Share on other sites

  • 3 months later...

Hi Tom,

I have a question regarding objects: I know it is possible to specify a part of an object to be draped on the ground, but so far I haven't been able to find out how... I baked an ambient occlusion shadow on a plane (as in quad, not aircraft) in blender that I want to put under my object... I read in the obj10 specifications that you have to use the commands ATTR_drape.... / ...ATTR_no_drape and that you can give the draped part its own texture.

I exported the plane as an obj, opened it in texteditor and then tried to copy it into my original object, using the _draped commands to separate it from the original object... I tried to watch the result in X-Plane, but X-Plane didn't like it much ;)

Since I only half (if even) know what I'm doing when it comes to objects, I assume my approach was not the most optimal one... also I don't know where in the object file to put it and what lines I should include; earlier on I only learned to how use draped polygons when I could copy from an existing one... I was hoping to do the same now, but I can't find any examples of them.

So my question is this: would it be possible for you to make a simple example object, e.g., a textured cube with a draped plane attached to it, so I can see what it should look like?

Link to comment
Share on other sites

Sorry for the late reply....just noticed your post. Let's take a look at a object in the default library called, "Cargo_container_6.obj". This is a group of 6 generic cargo containers with a draped polygon ambient occlusion shadow underneath. The cargo containers themselves use one texture and the draped polygon with the baked AO uses another texture. First...we start with the header"

TEXTURE		../textures/Common_Airport_Elements.png
TEXTURE_NORMAL ../textures/Common_Airport_Elements_NML.png
GLOBAL_specular 1.0
TEXTURE_LIT ../textures/Common_Airport_Elements_LIT.png
TEXTURE_DRAPED ../textures/Draped_Ground_Elements.png
TEXTURE_DRAPED_NORMAL 1.0 ../textures/Draped_Ground_Elements_NML.png
EXPORT lib/airport/Ramp_Equipment/Cargo_Container_6.obj Ramp_Equipment/Cargo_Container_6.obj
POINT_COUNTS 175 0 0 318

There is a lot going on there. But the pertinent stuff for draped polygon is "TEXTURE_DRAPED". That specifies the texture to be use for the draped polygon and "preps" the OBJ to use ATTR_draped. There is no reason it cannot be the same texture as the object itself......it just so happens I keep my draped texture separated for some optimiztion reasons that is too much detail to go into here. Now lets look at the commands at the bottom of the OBJ file:

ATTR_LOD    0 500
# Image: //../textures/Common_Airport_Elements.png
TRIS 0 312
####_group DP_1
ATTR_draped
# Image: //../textures/Draped_Ground_Elements.png
TRIS 312 6

Ignore the # sound lines as those are comments only. The key here is to note that there are two sets of TRIS commands. The first set are the polygons themselves for the cargo...THEN we execute a "ATTR_draped" command. All TRIS commands after this command (assuming no ATTR_no_draped) will be "squashed" onto the ground. If you are going to hand edit the OBJ files, the trick for you is somehow being able to isolate the triangles when you export them so that you can identify which "TRIS" line in the text OBJ represents the draped polygons If you use Blender to export, you can assign the draped polygon to a group...and name the group something like...."zDraped_Polys"...at least for Blender 2.49. The blender exporter (for version 2.49) exports groups in alphabetical order which is why I precede my own group names with a z. In the example above though, I happen to use the group name, "DP_1" and you can see the exporter writes the group name to the OBJ file so it can be identified easily for hand editing. Now if you are using something other than 2.49 and the original "blender2xplane" scripts...like say the scripts developed on the org for version 2.6+...then I really don't know what features that exporter provides.

TomK

Link to comment
Share on other sites

Hi Tom,

Thank you so much for your explanation, I think I'm getting it now... I had trouble at first to get the group to show up in the obj file, because I was thinking 'vertex groups'... then I found out that I had to create a group for the object itself, which seems more logical in retrospect :P

Link to comment
Share on other sites

  • 5 weeks later...

Hi Tom,

it's that time of the month again, so here i am with a new question:

When making ATC taxi layouts, is it possible to specify a direction in which a runway is used?

I made a layout that includes all taxiways and junctions, with the appropriate names for each segment;

I tried to trick the AI planes by only using onedirectional taxiway segments in the vicinity of that particular runway, but they ignore it if they feel like it... I'm also not completely sure how to use the 'runway/departure/arrival/ILS -tabs in WED for the situation when you have to cross a runway to get to another runway.

And is there a particular order in which the segments should stay in WED?

Because after drawing a few taxi routes I completely lose track of where the first one starts or another one ends, especially when all their nodes get joined where they meet.

OK, three questions in the end, I'll try to keep a low profile for the next two months ;)

kind regards,

Oscar

Link to comment
Share on other sites

I'm sorry Oscar, you are way ahead of me on this one. Thus far, I've just been cranking out scenery and the ATC programmer has handled the ATC layouts for me (KSEA only so far). I am doing KATL now as an example of a "library only....no custom" airport and have yet to get to the ATC layout part; however, it is upcoming for me very soon and I will take your questions to the ATC programmer and see what I can dredge up...good questions all!

Tom

Link to comment
Share on other sites

Hi Tom,

it's that time of the month again, so here i am with a new question:

.....

OK, three questions in the end, I'll try to keep a low profile for the next two months ;)

kind regards,

Oscar

Oskar

Have you checked out the WED Manual? It was updated few days ago http://www.x-plane.c...rt/manuals/wed/

Also the APT doc was updated quite "recently" http://data.x-plane.com/file_specs/XP%20APT1000%20Spec.pdf

Cheers,

Premek

Edited by ptru
Link to comment
Share on other sites

Tom (et al),

Who is responsible for maintaining/updating the new WED manual (as of June 2012) which has been linked in the thread?

I've got a small suggestion for information that should be added to the document to help alleviate some confusion that I actually encountered when working through the "tutorial" style lessons it provides.

-Greg

(The suggestion is: The demonstration of features/tutorial jumps into creating and editing taxiways and runways on top of an orthophoto guide before explaining how to get a guide photo into the editor. I think it would be advantageous to either have the instructions on laying down an orthophoto for guide purposes first, or at least point the reader to the appropriate section of the manual where orthophotos are discussed so they can get their guide images in place.)

Link to comment
Share on other sites

Greg, I believe it is a young man named Tyler. I have yet to look at the docs but certainly will take a peak. I'm still slated to do tutorials and might be able to do that shortly. The library is getting a pretty hefty upgrade with V10.10 and KATL and that might be a good time for me to focus on the docs also.

Tom

Edited by tkyler
Link to comment
Share on other sites

  • 1 month later...
  • 7 months later...

Hello Tom, hello everybody.

I am wondering if is there a way in Tom's PARAMeterized light "LIGHT_PARAM sodium_flood_XYZBTSS" to hide the light billboard that appears at the top of the light ideal "cone". I am asking this since I have created an airport scenery (Florence Peretola LIRQ, Tuscany, Italy, available for free at X-Plane.org since 2010) that in XP10 with HDR during night time is illuminated by more or less standard aprons lamps that cast their light on every apron (in Peretola there are two) with their 6 arms and 6 bulbs each. Now, my problem is that I could not put a spill light in EVERY light bulb, otherwise I would kill the framerate (I mean, KILL it more than I just did!), but I need some 6 to 8 lit areas on every apron. So I thought i could use a single light cone with no visible structure and place every one of them in particular places around every apron in WED. And so I did! But I've noticed that little billboard lights appear right in the sky in the middle of nowhere. I could try to create these "cones" in a way that every cone top could more or less coincide with the apron lamps themselves (so if I had a billboard, they at least could be hidden by the apron lamps billboards that in fact are already in place), but I am having some troubles in determining the perfect allignment of the cone for the first three coordinates X, Y and Z, that some say are simple coordinates, but reading different people's different answers, they appeat as well to be calculations of some other kind.

I guess that I am having troubles with coordinates in the first place since I am not using my regular 3D software that is AC3D, because an updated plugin to export OBJv10 is still missing AFAIK, but I am tweaking the PARAMeterized lights directly inside the compiled OBJv8 using a text editor. 

S, to me, only two possibilities here seem to appear:

1 - as said, create a "cone" of sodium flood light so that its top coincide with already existent apron lamps bulbs (billboards), but I have to understand better the coordinates matter.

2 - create two different apron lamps, one with two PARAM floodlight, and one with one PARAM floodlight, and TRY to place them adjusting their heading so that the final result (in  terms of position of lit areas onto the aprons) are similar to what I have now.

I hope I have been clear enough and I apologize, since english ìs not my mothertongue.

If needed I could post some images, that may be much more self explanatory.

 

Thank you very much for any help that you may give me. I appreciate it deeply.

 

Cheers,

 

Cekko™

Link to comment
Share on other sites

Cekko,

 

Unfortunately, there is no way to disconnect the billboard from the sodium lights as they are permanent.  It was not this way in the beginning, but they were made permanent to be consistent with other lights.   What I would recommend is that in each of your "multi-lamp poles" , you put in one spill light, set where any of the normal 'bulbs' would be....and  5 billboard only lights at the other bulb locations.  The spill light would be a bit off-center in this case of course, but you can tilt it a bit and widen its light cone to conceal it.  If the light pole is tall enough, nobody will pick up on it anyhow.

 

Regarding the coordinates.   in X-Plane:   +x = east,  -x = west, +z = north,  -z = south, +y = up, -y = down.    In addition, when it comes to lights, there are two sets of coordinates.  The first is the lights physical location in cartesian space, and these numbers represent meters....and second are unitless "vector coordinates".   A vector coordinate for (x, y, z) of  (0, -1 0), given the above relation would represent a vector pointing straight down.   (0, 0, 1) would be a vector pointing directly south.  (1, 0, 1) represents a vector pointing to the South-East....(1, 0, -1) to the northeast....(0, -1, -1) would be a light pointing towards the north and at a 45 degree angle.  Internally, these vector values are normalized so (1, 0, 2) is the same as (50, 0, 100) or (0.5, 0, 1).

 

So as an example, let's use my tall sodium flood light with 3 bulbs  Here's the param lights lines from the object file.

 

LIGHT_PARAM sodium_flood_BB   -0.4755   22.6079   -0.0475 -0.20 -0.71 -0.67  8LIGHT_PARAM sodium_flood_XYZBTSS    0.0059   23.5864   -0.1224 0.0  -1  -1  1.0  50  0.57 8LIGHT_PARAM sodium_flood_BB    0.4797   22.6038   -0.0444 0.20 -0.71 -0.67  8 

Above, there are two billboard only lights and they cast no spill, they only have the lens flare billboard effect.....and also there is just one flood light which does cast a spill and also has the billboard lens flare.  The flood light and the billboard only lights all have the same size billboard so it looks like all three lights are on when viewed in sim, but only one is actually casting light in xplane.     The sodium_flood_BB lights have 7 parameters,  (X  Y  Z  dx  dy  dz  size).  The first 3 are the physical location of the "bulb" in meters....and these values are relative to the object origin.  Note that the big value, '22.6079' is in the Y parameter....so that means the bulb is 22.6079 meters 'up'.  The next 3 values are the vectors, dx, dy, dz....and the last value is the billboard size, but as I mentioned, these are now hardwired and the value of '8' doesn't do anything.  So looking at the dx, dy, dz values of the billboards, you'll note the dy value is negative...meaning the light is pointing down...BUT it also has a rather large z value of -0.67 which means the light is pointing towards the north almost as much.  This is a apron light that throws light out onto the apron away from the light pole so these values make sense.  There is also a small dx component on the billboards because for a 3 light pole, the side lights point a bit to the side as well as outward and down.  

 

Now when I say "north", that means the directionality of the light when it has no rotation value in WED.  If you were to click and place a light in WED and not rotate it, then these values in the object file could be considered, "default directions".  Of course you want to rotate the light if you need to point it into a particular direction.  I designed my directions so a user drags in WED in the direction they want the light to point so it would be somewhat natural.

 

For the flood light itself,  ..._XYZBTSS.  The first 3 values are the physical location of the bulb, X, Y, Z.  The next 3 are the direction this light points,  dx, dy, dz and the last four values  are the BRIGHT / THROWS / SPREAD / SIZE.   Ignore size...its that pesky billboard that you can't change.  The '50' is the distance the light reaches in meters...beyond that value there is no spill effect in sim.  You can up that to 100 or whatever you need.  The spread, '0.57' is how wide the beam is.  The lower the value, the wider the beam.  Acceptable range is between 0 and 1.    

 

So for your six bulb situation, I recommend your suggestion #1 above.....I could see something like:

 

LIGHT_PARAM sodium_flood_XYZBTSS   ...bunch of numbersLIGHT_PARAM sodium_flood_BB  ...bunch of numbersLIGHT_PARAM sodium_flood_BB  ...bunch of numbersLIGHT_PARAM sodium_flood_BB  ...bunch of numbersLIGHT_PARAM sodium_flood_BB  ...bunch of numbersLIGHT_PARAM sodium_flood_BB  ...bunch of numbers

where each lights dx, dy, dz value is (0, -1, 0) as I assume they all point down; however,  if each bulb points "outward" at all, then you have some trig to do!  Below is a little reference I kept handy in my blender files early on.   I do NOT know if the coordinate system in AC3D maps to x-plane in the same way as blenders and you might have to experiment a bit, BUT I believe that BenS made it so when you look at your 3D model in a top down view, that "screen up" is  "object north" AC3D users correct me if I'm wrong please.

 

TomK

 

post-5-0-57736200-1366165876_thumb.jpg

 

 

 

 

 

 

Edited by tkyler
Link to comment
Share on other sites

Ooohh, I am so honoured to receive a direct answer from an X-Plane developer, like Tom Kyle, noless...!!

 

Ok, then, billboards are not hide-able, I was fearing such an answer. Now I will get deeper inside your kind explanation and try your suggestions.

Will report back here in a while if I will find something unclear in your answer, or later on if I will be able to proceed in testing new light poles that in fact cast spill light.

Thank you so very much Tom!!

Link to comment
Share on other sites

Ooohh, I am so honoured to receive a direct answer from an X-Plane developer, like Tom Kyle, noless

 

Thank you Cekko.

 

I have always been around here at x-pilot and barring some medical issue, always will be more than likely. Feel free to ask anytime.  I am banned from participation at the org, which is why you see no posts from me there anymore.  I would that I could answer a lot of questions for users over that I know the answer to but unfortunately can not.

 

You can replace my sodium flood with another named light called a "full_custom_halo" where you have no billboard, it takes nine parameters.   I'm heading out the door, but will elaborate on this more in a few hours.

 

TomK

Edited by tkyler
  • Upvote 2
Link to comment
Share on other sites

Thank you Cekko.

 

I have always been around here at x-pilot and barring some medical issue, always will be more than likely. Feel free to ask anytime.  I am banned from participation at the org, which is why you see no posts from me there anymore.  I would that I could answer a lot of questions for users over that I know the answer to but unfortunately can not.

 

You can replace my sodium flood with another named light called a "full_custom_halo" where you have no billboard, it takes nine parameters.   I'm heading out the door, but will elaborate on this more in a few hours.

 

TomK

Hmmm, I am still trying to find some time to look deeper into your kind answer, and I will do it most certainly in the week end most likely (although I am hoping that it would be earlier), but my firts question regarding this "named light" is: will it cast a spill on my aprons? if so, it would be GREAT (since it would solve my billboard matter), otherwise I'll try to better understand the matter of vector coordinates. If I could be able to fully understand that matter, I might become more easily in control of the "slopeness" of the light cone, so that I really could try to put the cone top right inside the bulb. This way I wouldn't be able to recognize the billboard, but if I could see it, most likely I simply would mix the two billboards appearing and the result would be obtained this way as well, although, i guess, with less energy expense...  ;)

Anyway, if in the mean time you will write more info about the new named light "FULL_CUSTOM HALO" I will look forward to use it.

 

Thank you so much, your help is simply invaluable!!

Link to comment
Share on other sites

Hmmm, I've found a light "full_custom_halo" inside the document "lights.txt" in X-Plane 10.20 folder. It is listed under "Sergios' and Kriss's lights for buildings" more or less.

The document reports:

#                       Name                            R       G       B       A       Size            Dx      Dy      Dz      Width#-------------------------------------------------------------------------------------------------------------------------------------#LIGHT_PARAM_DEF	full_custom_halo		R	G	B	A	S		X	Y	Z	F

 

Is this the one you were referring to?

If you could take the time to explain a bit better to my weak mind the meanings of all the parameters, I'd appreciate it very much (although I guess I could try to figure it out by myself...)

 

I am sorry to bother, but it would be better that I understand the whole matter before I started creating lights with trial and error, that means dozens of scenery reloadings every time when not getting some good crashes.

 

Thank you very much.

 

Cheers.

Link to comment
Share on other sites

Cekko,

 

that particular line from the lights.txt file DEFINES a named light.  The actual line written into an object file would be slightly different.   In an object file you would have the following format:

 

LIGHT_PARAM  full_custom_halo   X  Y  Z    R  G  B  A  S   dx   dy  dz  F

 

The first 3 values, X, Y,  Z is the physical coordinates of the "bulb" in meters relative to the origin of the object.   The next 3 values,  R  G  B  represents the color of the light in Red/Green/Blue format.  a white light is (1, 1, 1), a red light is (1, 0, 0),  a green light is (0, 1, 0) and so on.   These values are also normalized so you may also use the format (255, 255, 255)....which is a very common way among "color pickers" to represent RGB values....which numbers you use depends on the color picker tool you use.  The following site:

 

http://www.colorpicker.com/

 

Uses the values 0 -  255 for rgb color values....I myself use the 0-1 range because the color picker I use gives me those values.

 

Ok, onto the next value, the 'A'.  This is the alpha value which basically causes a "dimming" of the light and goes between 0 and 1.  Most of the time, there is no reason to dim a light, so generally leaving it at 1 for "full brightness" is OK.

 

The next 3 values, dx, dy, and dz  represents the direction the light points.  I cover this in a post above.

 

The final value is the width of the light and should be a value between 0 and 1.  0 is a special case and represents a "omni bulb" or "point light" that shines 360 degrees.  The number 1 represents a "zero width beam" or no beam at all...so you never use a 1.   What this number actually represents is  "cos (0.5 * light_beam_angle)"   So a light beam 110 degrees wide would use a 'F' value of (0.574).     When all is said and done, it would probably look like this in your object file:

 

LIGHT_PARAM  full_custom_halo   0  20  0   1 0.463    0.176  1   30 0  -1  0  0.71

 

The above light is 20 meters above the ground.  It is the same color as my sodium floods (R:255,  G:118,  B:45) OR (R:1, G:0.463, B: 0.175).  It shines for a distance of 30 meters.  It shines straight down and it is a beam 90 degrees wide.

 

TomK

Edited by tkyler
Link to comment
Share on other sites

Oh God, with your help I finally did it! Is it possible that you could be mistaken in writing the "kind" of light? I am asking (and please excuse me: I certainly don'twant to appear rude), because you used a light of type "named" instead a light of type "param" in your example (and I guess is a typo) as I instead did, but after some tries the result was:

 

LIGHT_PARAM full_custom_halo 0.000000 26.866600 0.000000 255  170 130   0.015 220 0.0 -0.6 -0.6 0.000

while before they were:

LIGHT_PARAM sodium_flood_XYZBTSS	0.000000 26.866600 0.000000	0.0	-0.6	-0.6	2.5	300	0.6	0.0

as they appeared here (from a thread at X-Plane.it):

 

LIRQv3a-XP10HDR_Light_01.jpg

 

LIRQv3a-XP10HDR_Light_02.jpg

 

LIRQv3a-XP10HDR_Light_03.jpg

 

LIRQv3a-XP10HDR_Light_09.jpg

 

(I hope not to exceed the maximum image dimension and size and resolution and quality admitted buy this forum; if so, I apologize. Please feel free to reduce them or delete them as rules state)

 

Now instead they look astonishingly good! The result is incredible!!! I'll look forward to do some tweaking into their parameters tomorrow (now I am so tired and a bit drunk... You know, going out with some firends and drinking red tuscan wine and vodka after the meal, well... ehm ehm, it doesn't help too much!  :wacko: ) but the result seems beautiful...! Tomorrow I'll fine tune it! And I'll report my improvements along with some screenshots, possibly. Now Florence Peretola LIRQ appears to be looking finer and finer, and that wouldnt' have been accomplished without your incredible help. Help for with I am grateful. Thank you, Tom, from the bottom of my heart.  ;)

 

Be well.

 

PS: Hmmm... are we absolutely SURE that those kind of lights are switching OFF during daytime...? I continued in my tests and it seems that they are ON even under plain sunlight... Am I wrong (I hope so)?

Edited by MacCekko
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...