ETS2 Lightmask texture

SCS Software ATS and ETS2 editing using ZModeler3 filter. Models, Materials, Animation.

Moderator: Oleg

Skoops
Posts: 33
Joined: Sat Jan 05, 2013 2:44 pm

ETS2 Lightmask texture

Post by Skoops »

Hey again..

Now Im modding a backbumper for my truck....

Im using the lightmask for the backlights, like SCS did... But when I put the left indicator on they both blink and none on the right.. But only on the back.. When I turn on the full light the reverse light turns on.. What have I done wrong?? This is only happening for the mapped lights with lightmask, not the flare points.. :)


Best Regards,
Spooks.
Skoops
Posts: 33
Joined: Sat Jan 05, 2013 2:44 pm

Re: Lightmask...

Post by Skoops »

... and when I get in to the game, the bumper (and my new tank) is way bright (I made the models in Sketchup) ..???

And my backlights, witch should be red, orange and white are black...


Image

Image
SamTHMillar
Beginner
Posts: 137
Joined: Sun Nov 11, 2012 9:23 am

Re: Lightmask...

Post by SamTHMillar »

I imagine you have created flares for the indicators and lights at the back? Also you may need to paint the vertices, and then create a low poly model of your back panel to get shading, that's why it's too bright.
Skoops
Posts: 33
Joined: Sat Jan 05, 2013 2:44 pm

Re: Lightmask...

Post by Skoops »

Yeah, I have moved the old ones around, havent made them complete yet... Hmm, the vertices is the same color as the rest... A dark grey.. And nah, I dont think I need a shading model, I dont got it on the truck atm.. :)
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

the masked lights should be imported/exported with the latest filter version. make sure no errors/warnings prompted on import or export. also, check the respective material file after export, it should contain proper shader name and both texture references - the texture_base and texture_mask.
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

Posted this on trucksimforum.de, but have posted here so it might help others as well.

Light masks are controlled by the colours in the lightmask.dds and the alpha of the lightmask.dds in uvchannel 2

I have not done much testing on this, but here is how I mapped the bumper lights of the scania

In uv channel 1 the lights where already mapped to a texture.

I then had to make a new light image in the lightmask.dds alpha for the new lights.

My lightmask.dds alpha now look like this

Image

The new light source is the rounded one

I then added a new image to the texture in the same place as the alpha image. I guessed blue as it was a front light.

Image

Once this was done all I had to do was map uvchannel2 mesh to the new light source image on the lightmask.dds

This worked, but even though I used the flare for the parking light, when main beam was used the bumper lights got brighter. Looking at the textures again, I noticed that the orange lights used for the side panels had a image in the alpha, but not in the texture. I then deleted the image in the main texture so it was now black, this then stopped the light become brighter when main beam was used.

@Spooks You need to uvmap the whole thing by the looks of your pictures.
Skoops
Posts: 33
Joined: Sat Jan 05, 2013 2:44 pm

Re: Lightmask...

Post by Skoops »

Hmm.. Im beginning to understand the layout of the lightmask.. Oleg, theres no errors but how do I know about the filters?? I mean, it works in game, but it just dont work properbly.. But its still blinking ALL my blinkers (in the lightmask way) when I turn left and noone when I turn right, only the flares are blinking then.. Should I try to remove the "old" mapping completely and start over again? Instead of just make a new mapping. But the blue in the backlights are the rev. lights and the red one is the blinkers?? :) How do I seperate the blinkers? Mapping right and left side seperate?
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

you should create an UV for channel #2. Notice the image above - it's simmetrical; the left part is for the left-side lights, the right part is for the right-side lights. So, the game will lit up the left part of the image-mask when you turn left and will lit up right side lights when you turn right.
Skoops
Posts: 33
Joined: Sat Jan 05, 2013 2:44 pm

Re: Lightmask...

Post by Skoops »

Im using uv channel 2.. I made my own lightmask now, but still blinking wrong.. Should I seperate the lights so I have a left and a right side and then map them seperate and attach them afterwards??
Arc_Angel
Posts: 8
Joined: Mon Dec 17, 2012 11:09 am

Re: Lightmask...

Post by Arc_Angel »

Oleg wrote:you should create an UV for channel #2. Notice the image above - it's simmetrical; the left part is for the left-side lights, the right part is for the right-side lights. So, the game will lit up the left part of the image-mask when you turn left and will lit up right side lights when you turn right.
I tested this on the default trucks and trailers, strip channel #2 and remapped both front and back blinkers and it does the same thing as Skoops described.
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

the left-side lights should be mapped on the left half of the mask image; the right-side lights should be on the right half of mask image. it's all upto UV#2, while UV#1 and generic texture mapping could be any you like.
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

This is just a thought, but does the right side mesh need to be mirrored ?

SCS mirror everything and looking at the lightmasks the right side is a perfect mirror image of the left.

edit:

Just thought I would take a look at the lightmask for the scania back lights and when I edit uv and then keep old mapping it looks like this

:shock:
scania_lightmask.jpg
edit2:

Ok, I get the same. Using original mapping I correctly placed them on the texture, they look just as they did before, but they do not work the same in the game. I put the left indicator on I get flashing tail lights. Right indicator I get nothing, except the flare. Headlight on and the tail lights and indicator lights all display a brilliant white. Main beam, or I flash main beam, the brake light position, flashes a brilliant white.
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

The left-side indicators should be mapped onto texture; the right-side indicators should be moved out of texture to the right; they still will get correct mapping, but the fact they are "aside of original texture" will let the game determine whether this is left or right turn signal.
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

The following note was added to Filter guide thread:
Note, the front-left headlight should be mapped to UV texture square (name it first square), the front-right headlight should be mapped to the one square to the right side of original texture beyond the right bound of texture square (name it second square), the rear-left taillight should be in the "third" square on the right and the rear-right taillight should be on the "fourth" square. Note, you can map them all onto main (first) square and then move respective mapping objects to the right on 1.0 unit, 2.0 unit and 3.0 unit. Use Modify\Move tool with "Y" axes constrain off - start moving and press Tab key to bump input box; type there 1.0 and press enter to move onto "1.0" distance.
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

Oleg

I have come across a problem :)

My trailer now needs to be mapped to use lights mask. Looking at the original profi_liner, the mapping is slightly different to the trucks. Instead of the textures images being mirrored on the light_mask textures they are above and below.

Reverse engineering the profi_liner texture and mapping, From the back view the left light is the top, and the right the bottom. Like the trucks the orange lights only requires an alpha and like the trucks, right and left do not need to be mapped differently. Green is used for the brake light. Blue for the reversing light and red for indicators.

With this information I have made my light_mask.

Main texture on the right, alpha on the left.
light_mask+alpha.jpg
light_mask+alpha.jpg (4.73 KiB) Viewed 52033 times
I then map my rear trailer lights to the texture. On the profi_liner the top mapping (left light) is two squares to the right after mapping. So I move it two squares to the right. The bottom light (right light) is four squares to the right on the profi_liner, so after positioning it on my texture I move it four squares to the right.

My mapping looks like this (Ignore the three lower rectangles, I will come to them in a minute)
light_mask_mapping.jpg
I am impatient, so I test the mapping in game and too my surprise it works. Brake lights, indicators, rear lights (tail lights) all work.

Now I will come to my problem. My trailer has orange side lights, red light on the rear and white on the front. If you look at the alpha, you will see I have three positions to map them. I then uv-map the white light to the first, the orange lights to the second and the red one to the third. I test in game and all are a brilliant white. Moved the mapping two squares to the left and the light mask is working , but the white front light shines red :shock:
white_light.jpg
To try fix this I have mapped it differently, fipped it, mirrored it, tried a different texture, tried mapping all lights to the same texture and it still lights red :x

Any idea's :?:
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

You should probably examine the UV#1 on original models. May be placing mapping in different squares aside the texture does some trick in game too? (considering you've got the red front light shining, it make some sence).
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

Oleg wrote:You should probably examine the UV#1 on original models. May be placing mapping in different squares aside the texture does some trick in game too? (considering you've got the red front light shining, it make some sence).
I did check that, but the texture displayed correctly until the lights where turn on, then it changed to red.

After looking at some of the other trailers I noticed that they where indeed uv-mapped left side, right side. Realizing this I changed my alpha. It now looks like this.
lamp_mask_alpha.jpg
lamp_mask_alpha.jpg (2.18 KiB) Viewed 52025 times
I will try not to make this too long :)

I uv-mapped the red lights left and right. Left the top one and right the bottom. As 2.0 for the left one and 3.0 for the right one was working I used the same positions again.

The orange lights (side lights) where uv-mapped left and right. These where then re-mapped to the same alpha position and both moved to 3.0. After testing in game this still made the lights use the red shade. I decied then to move them 1.0 to the right (now 4.0) tested in game and they where now using orange :D

The white front ones, where uv_mapped the same, but moved 1.0 after positioning them. To my surprise this works.

I know have a trailer fully lamp_masked :D (just have to finished the rest of it now)

My finished mapping
finished_mapping.jpg
front_lights.jpg
rear_lights.jpg
Hopefully this will help other who are having problems with lamp masks, because mapping these is like trying to find a fat woman's fanny in the dark, you think you have the position correct, but in truth you are miles out :)
Last edited by womble on Fri Mar 15, 2013 12:22 pm, edited 3 times in total.
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

so, do you have a specific print out guide on light mask mapping? was it an issue with uv#2 only? does the game use 1.0, 2.0, 3.0 etc. for "glow color" only? or it's used for specific lights (front/rear and left/right) mapping?
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

Oleg wrote:so, do you have a specific print out guide on light mask mapping? was it an issue with uv#2 only? does the game use 1.0, 2.0, 3.0 etc. for "glow color" only? or it's used for specific lights (front/rear and left/right) mapping?
I do now yes. Works for front, rear, left and right lights. And yes it was only a problem with uv#2.

The rear combined lights (brake lights, indicators, rear lights) are always mapped 2.0 for the left and 4.0 for the right. The left side is always the top one and the right one the bottom. The other lights like the side lights are then mapped as per colour. From tests 1.0 gives you a white light. 2.0 gives you a red light. 3.0 also gives you a red light. 4.0 gives you a orange light. 5.0 give you a purple shade/light. Whether this is the maximum point of the mapping, or whether this is another shade colour I can not say as 5.0 is the furthest I have tested.

Just for reference, when I uv-mapped the lights, I uv-mapped as you would see them. So when uv-mapping was made, I mapped the left side lights from the left view, right from the right view, rear lights from the back view and the front from the front view. Not sure if this is how it has to be done or whether you could for instance uv map the left and right lights together from one view. I would guess you can, but of course one side would be a mirrored image.

I have some more ideas I would like to try, so will give them a try and add more to this thread if I can. For the time being this is the limit to my knowledge. I guess you will understand better than me, why this is mapped this way, due to your superior knowledge of how the .pmg files work.
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

ok. may be you will draw an explanation image later too? since I'm a bit confused why do you mention "2.0" and "4.0" in different context with different result effect...
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

Oleg wrote:ok. may be you will draw an explanation image later too? since I'm a bit confused why do you mention "2.0" and "4.0" in different context with different result effect...
First I will start with an apology. The main cluster lights are not 4.0 from the original position. 4 squares, yes, but 3.0 using the move tool :oops:

I have put some pictures together so hopefully this will unconfuse you.

Ok first I uv mapped the main lights. If you look at my in game pictures you will see I have two hamburger lights and then a big reversing light on each side.

I uv map them from the back view and then position them on the texture. Top one left side, Bottom right side.
light_mask_1.jpg
If I was to test this in game now, the light would not work. You would get the sort of problems described in the earlier posts.

I now move the top mesh 2.0 from the original position.
light_mask_2.jpg
The right one is then moved 3.0
light_mask_3.jpg
The final mapping looks like this.
light_mask_4.jpg
This now will work perfectly in the game.

The smaller lights are a little different. They all start from the same position, but need to be moved to different places to display the right colour. The picture below shows the start position.
light_mask_5.jpg
See next post, Can not add another attachment.
Last edited by womble on Fri Mar 15, 2013 12:15 pm, edited 1 time in total.
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

This picture shows the final mapping for the mesh, along with number moved by.
light_mask_6.jpg
I hope this helps.

Even with this information I am confused. Why they have to be mapped this way, I do not know. All I know is it took a lot of head scratching to finally come up with an way of doing it so it worked, but it works, so I am happy :D
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

Ok, that's what I needed. The headlight/taillight/reverselight/turn signal masks are as follows: first (0, no move) is the front-left; second (1.0 move) is the front-right, third (2.0 move) is the rear-left and fourth (3.0 move) is the rear-right.

The R, G, B masks are Turn signal (orange), Brake signal (red) and Headlight/Reverse light (white).
The game will determine which lights should be rendered using the square index (0,1,2,3). So, it will render white headlight for blue-channel-mapped fragments on squares #0 and #1, but it will not render blue-channel-mapped light areas for squares #2 and #3 unless reverse is toggled. The same for left/right turn indicators.

The alpha channel mask is an "Idle light" mask which shines all the time all around. So, even thought squares 0,1,2,3 are still used to determine front-left/front-right/rear-left/rear-light "placement", they are used to apply the proper "usage" color. The white is for front idle lights (squares 0, 1), the red is for rear idle lights (squares 2, 3), and the orange for side idle lights (square 4, the one with "move 4.0"). I guess they might reserved even more squares for extra color effects.

Correct me if I'm wrong somewhere. If not, I'll pin this in top post as a "solution".
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

Ok there just a few things I want to clarify.
Ok, that's what I needed. The headlight/taillight/reverselight/turn signal masks are as follows: first (0, no move) is the front-left; second (1.0 move) is the front-right, third (2.0 move) is the rear-left and fourth (3.0 move) is the rear-right.
0, no move can be both front lights or any light which needs to be white. Move 1.0 is also white. Move 2.0 or 3.0 is red and 4.0 is orange. There does not need to be a difference in the left and right meshes moved position, although they do need to be top and bottom for left and right.

Original position or Original position + 1.0 = White lights
Original position + 2.0 = Red lights
Original position + 3.0 = Red Lights
Original position + 4.0 = Orange lights.
The R, G, B masks are Turn signal (orange), Brake signal (red) and Headlight/Reverse light (white).
The game will determine which lights should be rendered using the square index (0,1,2,3). So, it will render white headlight for blue-channel-mapped fragments on squares #0 and #1, but it will not render blue-channel-mapped light areas for squares #2 and #3 unless reverse is toggled. The same for left/right turn indicators.
Ok lets take the main texture. Green is the brake light (red light in game), red is the the indicator(turn signal)(orange light in game) below that is the rear light (headlight but red) this does not have a colour texture and uses the alpha to display the light. The reverse light is blue.

The alpha shows the rear light (headlight but red) and the small lights used for the side, rear and front lights.
The alpha channel mask is an "Idle light" mask which shines all the time all around. So, even thought squares 0,1,2,3 are still used to determine front-left/front-right/rear-left/rear-light "placement", they are used to apply the proper "usage" color. The white is for front idle lights (squares 0, 1), the red is for rear idle lights (squares 2, 3), and the orange for side idle lights (square 4, the one with "move 4.0"). I guess they might reserved even more squares for extra color effects.]
That sounds fine. Regarding more squares, I tried 5.0 and all I get is black, so am guessing that after 4.0 the colour stops. Unless the when used with a different colour flares the position display different colours again. Not tested so it is just a guess :)
User avatar
Oleg
Site Admin
Posts: 14044
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

womble wrote:There does not need to be a difference in the left and right meshes moved position, although they do need to be top and bottom for left and right.
how will the game light up the left-only turn indicators or right-only turn indicators then? I guess left/right for 0/1 and 2/3 squares is important..
Post Reply