Light values in .cx

Everything related to creation of new sceneries for Condor...

Moderators: Uros, OXO, GR, ASH33M

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Light values in .cx

Postby GregHart1965 » Mon Oct 17, 2016 4:20 pm

What are the meanings of the numerical values for light in a .cx. How can they be adjusted? Is there a table that we can refer to.? I already know tbe transparency settings but am interested in how to adjust ambience etc. Writing different values in Wings makes zero difference to the values in the .cx, surely this is defect?

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Wed Oct 19, 2016 3:47 pm

Had some success. I had two hangars which after placing with AptCndrX displayed very darkly and grey. Ive changed these values

"Material Texture_001 {
0000017.0, 0000017.0, 0000017.0, 0000017.0;;
0000516.0;
0000017.0, 0000017.0, 0000017.0;;
000528.0, 000528.0, 000528.0;;
TextureFileName {"

(Apparently the specular values) from 000008 t0 000528 - presumably this mean 25% intesity?? Changing them to 000018 or 000017 makes them appear as bright as if they were placed with LE. They now have a base colour brightness and appear to reflect the sunlight in game albeit a very blue looking light.

I would very much like to know what exactly these numbers represent - my assumption that its a percentage is probably not correct. Setting null values for shininess (for a shadow) produces a number value of 536 as apposed to 516 for full shininess. Values in between this produce a string of numbers with seemingly no relation to this - confusing.

User avatar
Capricorne
Posts: 211
Joined: Wed Jul 08, 2009 6:34 pm
Location: Strasbourg (France)
Contact:

Re: Light values in .cx

Postby Capricorne » Wed Oct 19, 2016 4:43 pm

Here are the corresponding values published by Xavier:
Image
I have not tested these values, but the differences between ApnCdrx and LE are know .

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Wed Oct 19, 2016 8:40 pm

Yes Thanks Patrice - I did study this pic quite a lot :) ! Clearly the numbers in the first row indicate values for RVB as he has set a colour for the material whereas 000017.0 would indicate full brightness and show only the colours of the texture picture at full intensity.

The only problem with AptCndrX is that returns 000008.0 values which is zero intensity. LE seems to make all values 000017.0 or full intensity.

What I would like to establish is a set of values that can offset the problems created by both LE and AptCndrX - in other words have a greater undertstanding of what is really happening with all those numbers. They obviously relate to a set of fomulae - but what exactly? Perhaps only Uros knows or maybe Cafdael? The .cx format does not seem to be exactly the same as any other object file format - and yet it is the same thing - just how it is what Im interested in. Is it just a 3ds translated into plain language? hmmm...The learning curve continues. Thanks as always for your input.

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Wed Oct 19, 2016 9:29 pm

Some pictures to illustrate:

The original wings model - as you can see this was before I knew anything about all this (oh happy days of innocence :lol: ) and have left all the values at full intensity.

hangar.jpg
You do not have the required permissions to view the files attached to this post.

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Wed Oct 19, 2016 9:29 pm

The textures image

HangarG3.JPG
You do not have the required permissions to view the files attached to this post.

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Wed Oct 19, 2016 9:41 pm

I placed four hangars, two on the left (1&2) with LE, the two on the right (3&4) were placed with AptCndrX. Hangars 2 and 4 have unaltered values in the .cx - the same as set in wings. Hangars 1 and 3 have altered values.

Hangars 2 and 4 are written:
Material x3ds_mat_Cube1_auv {
000017.0, 000017.0, 000017.0, 000017.0;;
000516.0;
000017.0, 000017.0, 000017.0;;
000008.0, 000008.0, 000008.0;;

Hangars 1 and 3 are written with altered values:
Material x3ds_mat_Cube1_auv {
000017.0, 000017.0, 000017.0, 000017.0;;
000516.0;
000057.0, 000057.0, 000057.0;;
000528.0, 000528.0, 000528.0;;

As you can see there is no difference with LE the values all appear full. Apt CndrX on the other hand makes the building very grey and dark in the unaltered version (4). The altered version (3) is closer to the texture image.

Shot286.jpg
You do not have the required permissions to view the files attached to this post.

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Wed Oct 19, 2016 9:47 pm

At sunset we have the usual yellow brown on the LE hangars and the AptCndrX hangars dull as expected - but the altered version is still a bit bright. Also the colour is a bit blueish. Soooo what Id like is to be able to correct this but without a fulll understanding of the file integer format its hard to do.

Interestingly these hangar textures and some industrial buildings I made are the only ones to exhibit the very dark grey seen here. Other buildings appear ok - its seems the off-white colours are a problem.

Footnote: The numbers marked in Red are the ones that have the most influence in AptCndrX placed buildings. Adjusting only the row above this (presumably ambient) and not the final row appeared to have no effect at all.

Shot287.jpg
You do not have the required permissions to view the files attached to this post.

Xavier
Posts: 424
Joined: Fri Jun 20, 2008 2:22 pm
Location: France

Re: Light values in .cx

Postby Xavier » Wed Oct 19, 2016 11:55 pm

Hi Greg, Hi Patrice,

First of all, I must confess what I wrote in 2012 was not exact.

Since 2012, I make some progress to understand that things are not so clear!

The first line of the material list, is clearlly the RGB and Transparence, but it not a linear transformation which is messed with other parameters.

My photo up there shows value of 746758,293068,308988, for RVB, and a blue cube will show 17,8,8 for a RGB of 255,0,0 in Wings 3D 1,0,0.
Transparency is 17 for 1 in Wings, 498 for 0.94, and 58 for 0.5.

The second line is shininess from 536 to 516, but sometime I also obtain value out of this range.

After, I am in the full darkness and what I called Ambient and Specular is not really true.

But Greg, I have the same problem. Look at the photo in Condor of my DC3

Shot2573R.jpg


The first photo shows the DC3 in the O file of the airport. I only Merge, Move and rotate the DC3 with the airport's buildings O file. Then I convert to cx file.

Shot2582R.jpg

The second photo shows a second DC3 placed with LE.

The 2 DC3 have exactly the same texture and the same converted material in cx file.
DC3Materials.JPG

Notice that when you reduce to one material per object you get a normalized material. That is the DC3 material is also exactly the same that the Kargil material for buildings.

So, as I cannot find the real meaning of the material description of a cx file, I suggest to use Photoshop to darken for me or lighten for Greg and/or some thing else to obtain the same appearance.

My 2 pence
*****- Xavier - (XDL * F-DELX) -*****

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Thu Oct 20, 2016 12:06 am

Ok (more on this sorry but Ive got a bee in my bonnet!) I ran some basic tests generating .cx files for different settings in Wings.

Two things are very obvious:
1. Xaviers drawing is incorrect the ambient( also emmision?) chunk and the specular lines should be swopped. Specular is definitely the second last line and ambient / emmision (is probably) the last line of integers.
2. Settings for Ambient and Emission do not reflect at all in the values of a .cx file. This is something that is happening with object converter as all of these values (and a lot more) are recorded in a 3ds file. Luckily we can just edit the this last line of values - but exactly how remains the question!

Below are the results.
Notes:
1. I did not test opaqueness (transparency) which was left at 100% opaque throughout. I say 'all others = zero' but its all others except opaqueness.
2.As you can see shininess (actually hardness of reflexivity) is indicated by the middle number 536=0, 526=0.5, 516=1.0. Further testing would reveal more about this line of integers.
3.Specular (second last line) is indicated by 000008=0%, 333358=50%, 000017=100%. The 33335 is an exact reflection of the wings 3d setting - about 50% or 0.53333.
4.Values less than 1.0 (100%) are appended by 8. Values of 1.0 are appended by 7.

50% diffuse, all others = zero
945258.0, 945258.0, 945258.0, 000017.0;;
000536.0;
000008.0, 000008.0, 000008.0;;
000008.0, 000008.0, 000008.0;;

100% diffuse, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000536.0;
000008.0, 000008.0, 000008.0;;
000008.0, 000008.0, 000008.0;;

100% diffuse, 50% ambient, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000536.0;
000008.0, 000008.0, 000008.0;;
000008.0, 000008.0, 000008.0;;
note no change

100% diffuse, 100% ambient, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000536.0;
000008.0, 000008.0, 000008.0;;
000008.0, 000008.0, 000008.0;;
note no change

100% diffuse, 50% specular, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000536.0;
333358.0, 333358.0, 333358.0;;
000008.0, 000008.0, 000008.0;;

100% diffuse, 100% specular, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000536.0;
000017.0, 000017.0, 000017.0;;
000008.0, 000008.0, 000008.0;;

100% diffuse, 50% [0.5] shininess, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000526.0;
000008.0, 000008.0, 000008.0;;
000008.0, 000008.0, 000008.0;;

100% diffuse, 100% [1.0] shininess, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000516.0;
000008.0, 000008.0, 000008.0;;
000008.0, 000008.0, 000008.0;;

100% diffuse, 50% emission, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000536.0;
000008.0, 000008.0, 000008.0;;
000008.0, 000008.0, 000008.0;;
note no change

100% diffuse, 100% emission, all others = zero
000017.0, 000017.0, 000017.0, 000017.0;;
000536.0;
000008.0, 000008.0, 000008.0;;
000008.0, 000008.0, 000008.0;;
note no change
Last edited by GregHart1965 on Thu Oct 20, 2016 12:33 am, edited 1 time in total.

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Thu Oct 20, 2016 12:17 am

Hi Xavier first we must ammend your drawing to correctly reflect what is happening. Here is the corrected image:

Screenshot_2016-10-17-16-14-24.png


Next is to figure what values will work in the last line which is surely ambient or emitted light (they are the same thing really - ambient is usually a minimum amount of colour that the object shows - otherwise it would be black. Emission is an extreme version of this where the intensity of light or colour displayed is very high). Object converter does nothing to record the information for this value as shown above. So we need to figure out how to manipulate this without getting strange colour results.

Adjusting brightness or levels in photoshop did nothing to solve the problem. As you can see the walls in the hangar texture are almost white so adjusting the levels just blows the definition out - it becomes too white to see the lines.
You do not have the required permissions to view the files attached to this post.
Last edited by GregHart1965 on Thu Oct 20, 2016 12:34 am, edited 1 time in total.

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Thu Oct 20, 2016 12:30 am

Xavier try changing all of the last line of integers to 000017 - it will make the image as bright as if placed with LE. I think that line is the ambient or emission value - Object converter is failing us here by not producing a value (note: I did nothing with .cx's I generated above so the values are straight from the converter). Doing this to my hangar made it look exactly like an LE placed object even though it was done through AptCndrX.

Its values below 000017 (ie: 1.0 or 100%) that are hard to do as the colour changes from what it should be.

Oops wait you want it darker :oops: . One way to do that would be to make the diffuse setting in wings lower - this gives the object less colour and so making more grey or dark. Photoshop would also probably work to fix your plane - but its irritating to have to draw something that is not the way things are - just to make it look right.

I dont add any clour to the materials in wings using only the colour of the texture image. Adding colour to the material in wings will produce RVB values which will definitely make things very confusing when trying to figure what is going on in the lines of values.

Xavier
Posts: 424
Joined: Fri Jun 20, 2008 2:22 pm
Location: France

Re: Light values in .cx

Postby Xavier » Thu Oct 20, 2016 12:47 am

Hi Greg

Your trick is working !

Shot2583r.jpg


Thanks
*****- Xavier - (XDL * F-DELX) -*****

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Thu Oct 20, 2016 2:02 am

You also up late? Haha! :D
More insight - the last line is definitely an emmission channel so beware of placing it at fully 000017 as it will stay fully bright when the sun goes down! A slightly lower value may be better - just experiment until you find the right one.

But what values are correct? - well noticing that 50% specular produced a value of 333358 made me think - those are the same fractions as shown on the shininess slider - so just look at those numbers (they work in thirds of even numbers) and enter those as your values - yes even though the line is not a shininess value. The steps are quite small so you may need to make big changes in the integer to see a result.

What worked for my hangar was to use about 0.26667 - or 766626 in the .cx for emmission / ambient (last line) and to let it be quite specular (second last line) at 0.44 or 0000448 in the .cx. The low emission value stopped it from glowing like a light bulb at sunset - which it did with full emmission (000017) :P ! 8) .

From what I can gather from Blender- an emission intensity of 1 (0.53333 in wings or 333358 in .cx) is a maximum for normal ambient light. Higher factors up to 2 (or 1.0 in wings or 0000017 in .cx) are used for objects that emit light - hence my glowing hangar at sunset.

Its quite tricky to get it all balanced and looking right as we are just painting colour pixels - not really dealing with real light.

GregHart1965
Posts: 388
Joined: Sun Apr 12, 2015 7:21 am

Re: Light values in .cx

Postby GregHart1965 » Thu Oct 20, 2016 2:22 am

When colours appear off try altering the RGB channels to fix it - havent had too much success so far but still trying it out. Here is a colour wheel for additive mixing:

color_wheel.jpg
You do not have the required permissions to view the files attached to this post.


Return to “Scenery”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 guests