ETS2 Lightmask texture

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

Moderator: Oleg

womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

Oleg wrote:
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..
If you import any of the trailers Main lights are mapped 2.0 and 3.0. So my thought is that the indicators are lit up by position. Which is why the right lights are mapped further over than the left. I have not be able to test this theory, but I will as soon as I can.

edit:

Just did a simple test. Moved the right main lights mesh to the same position as the left. Tried it game and when the left turn indicator is on the right turn indicator mask flashes as well as the left one. So turn indicators are recognized by position. Also remember the turn indicators use the red in the main texture. If it does not have the red then it does not work as an turn indicator.
peterm95
Posts: 11
Joined: Sun Oct 28, 2012 12:50 am

Re: Lightmask...

Post by peterm95 »

Why does my lightbox look like this.. I can figure out what wrong.. Have been looking it through 100 times now. :)
Attachments
ets2_00260.png
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

you should probably post your material settings, your texture and texture alpha channel view.
peterm95
Posts: 11
Joined: Sun Oct 28, 2012 12:50 am

Re: Lightmask...

Post by peterm95 »

Here you go. :) i have tried everything. but it still dont work..
Attachments
lysskilt mask alpha.png
lysskilt mask.png
matrial settings.png
ets2_00262.png
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

your color texture should be black. your mask texture should contain mask (as shown on one of your screens) in one of channels (r/g/b I don't remember which exactly is for "overal light").
peterm95
Posts: 11
Joined: Sun Oct 28, 2012 12:50 am

Re: Lightmask...

Post by peterm95 »

I just wonder about. It works fine with light function. but I dont know why it dont light the texture up. If light the light mask up. The real texture is blue with white letters.
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

peterm95 wrote:I just wonder about. It works fine with light function. but I dont know why it dont light the texture up. If light the light mask up. The real texture is blue with white letters.
The alpha of the lightmask needs to have a mask image of the original texture. Your alpha is just black. To light your light box you will need to create a mask of the original image.

Like this

The main texture the one you see in the day time, or when the light is not illuminated - Detail
detail.jpg
detail.jpg (1.96 KiB) Viewed 45692 times
The the main texture of Detail 2 will be black since you do not want it to become brighter with main beam on, and it is not a brake light, indicator light or reversing light.
detail_2.jpg
detail_2.jpg (935 Bytes) Viewed 45692 times
For the game to light the light, it needs a mask of the original image. To do this I create a New Mask Layer in photoshop. This is then added as the alpha of the light mask - Detail 2
detail_2_alpha.jpg
detail_2_alpha.jpg (2.15 KiB) Viewed 45692 times
The alpha of detail 2 will be used by the game to light the light.
mvos97
Posts: 3
Joined: Tue May 07, 2013 9:30 pm

Re: Lightmask...

Post by mvos97 »

would anyone like to explain in steps how you can make light mask :?
mvos97
Posts: 3
Joined: Tue May 07, 2013 9:30 pm

Re: Lightmask...

Post by mvos97 »

Image

does anyone know how this is coming

If I turn the lights I get this
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

mvos97 wrote:http://static.afbeeldinguploaden.nl/130 ... xMcgLy.png

does anyone know how this is coming

If I turn the lights I get this
It could be that the dds files are incorrectly made. It could also be a problem with the mat file, but with out seeing your set up I do not know :?

Pictures of your light setup in zmod and pictures of the main dds files and the light mask alpha would be a big help in helping you to solve the problem.
boxcar
Posts: 35
Joined: Mon Mar 04, 2013 1:33 am

Re: Lightmask...

Post by boxcar »

Is it possible to change the Color of the lights?
I have made a lightsign for my scania. Texture on UV #1 and a lightmask an channel #2

The texture is yellow, but the sign shine always White.
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Lightmask...

Post by Oleg »

I suppose game uses a set of predefined colors that adds overlay with respect to mask. the white for the front/reverse lights, red for brake/taillights and orange for turn signals. You can pick which color you need among these and paint mask on respective channel of lightmask texture.

the channel for idle light is the same, so the game will use UV map "squares" to determine whether idle light should be red (tail lamps) or white (front lamps).
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: Lightmask...

Post by womble »

boxcar wrote:Is it possible to change the Color of the lights?
I have made a lightsign for my scania. Texture on UV #1 and a lightmask an channel #2

The texture is yellow, but the sign shine always White.
If you look further back on this thread you will see how you create different light colours. The only colours I have have got the game to display are white, red and orange.
Oleg wrote:I suppose game uses a set of predefined colors that adds overlay with respect to mask. the white for the front/reverse lights, red for brake/taillights and orange for turn signals. You can pick which color you need among these and paint mask on respective channel of lightmask texture.

the channel for idle light is the same, so the game will use UV map "squares" to determine whether idle light should be red (tail lamps) or white (front lamps).
Predefined colours added to the overlay only tell the game what the light is. Reversing lights, Brake light, headlight etcetera. It does not define what colour the light will shine. Adding a blue overlay to the mask for example will only tell the game that it is a reversing light when using a lamp_mask (trailers) and will increase the brightness of a headlight mask when used with a lightmask (trucks). Remove the blue from the mask overlay on a lightmask and the light will shine white, but will not shine brighter when main beam is used. Remove the blue from the mask overlay on a lamp_mask and the reversing light no longer shines when reverse gear is selected, but will shine a bright white when the light are turned on.

As I said above I have only managed to get the game to display three colours, and that is by moving the mesh to the number shown in the pictures I posted. Altering/adding different colours to the overlay does nothing to the colour of the light.
K-SHOE
Posts: 6
Joined: Mon Oct 29, 2012 11:16 am

Re: ETS2 Lightmask texture

Post by K-SHOE »

i get it work.but i have a other question:its possible to make it like in GTS via lights night folder???Can i make a lights.night folder in zmod3/ets2 that includes meshes that only work when i turn the parkinglight and lowbeam light to on.
baton15
Posts: 2
Joined: Sun Oct 21, 2012 4:44 am

Re: ETS2 Lightmask texture

Post by baton15 »

Ok could anyone write a guide step by step for light masking as in how to setup the material from the start to finish please as I watched the video but I can't make it work at all
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: ETS2 Lightmask texture

Post by womble »

baton15 wrote:Ok could anyone write a guide step by step for light masking as in how to setup the material from the start to finish please as I watched the video but I can't make it work at all
Easiest way is to import an original light_mask. So for example, for a trailer import the cool_liner, and then delete all the cool_liner mesh along with the materials, except the one for the lights. Once you have the material, it is just a case of replacing the original textures with your new textures and then uv-mapping your mesh to the new textures.

I hardly ever set up materials from scratch, as I can never seem to set them up the same as zmod3 imports them :?
youngbuck
Posts: 19
Joined: Sun Nov 04, 2012 7:41 am

Re: ETS2 Lightmask texture

Post by youngbuck »

Can someone please help me? I've tried time and time again and this is the closest i ever got to it, the part that i mapped lights up but it keeps going outside of that, what am I doing wrong? I've followed the tutorial right through
http://farm4.staticflickr.com/3714/9584 ... 0dd0_b.jpg
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: ETS2 Lightmask texture

Post by Oleg »

Seems like your lightmask texture does not match mapping on the model. The model should define mapping for UV channel #2. and this uv-mapping should match layout of your lightmask texture.

Consider a texture 256x256 pixles is a 2x2 tiles:
A B
C D

The A is 128x128. draw a soft-edge red spot there (so it does not go out of A boundaries)
Then draw red spot in B area; Then draw blue spot it C;
Then switch to alpha channel (it's all black) and draw white spot in D area.

This is a reference lightmask for your needs. Apply this texture as lightmask for your truck lights material.

Now, select polygons for a front-left headlight; reset UV mapping for channel #2 on them. Then edit UV for channel #2 on them (in front viewport: "Generate New", "From Viewport XY"). In uv-mapper, specify "UV#2: mylightmask.dds" and edit layout so the front headlight lays over the entire texture (resize and rescale, so A,B,C,D areas are all on a front headlight).
Then export and test in game. You should see light mask on a headlight, but it will be on some part of headlight only - the part that covered correct (A,B,C or D) area of lightmask. Toggle hazard lights, toggle other lights and check what's going on in game with the headlight.

Once you get used what the game does with respective mask areas on your headlight, you will know how (or which lamps/polygons) to map onto which areas (A,B,C or D). make your quick test with proper UV mapping to make sure you understand how it works and ensure the game does exactly what you need.

Then you can draw a proper lightmask for your truck. then refine mapping again (to match new texture).
youngbuck
Posts: 19
Joined: Sun Nov 04, 2012 7:41 am

Re: ETS2 Lightmask texture

Post by youngbuck »

Thanks Oleg I did what you said and now it shows up like this when I put the park lights on. How do I get it so that only the park lights show when I turn them on and then lowbeam and highbeams show only when I turn them on and such?
http://farm8.staticflickr.com/7281/9615 ... 9480_b.jpg
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: ETS2 Lightmask texture

Post by Oleg »

It doesn't look to me you quite understand what are you doing...

Run a set of tests and play with this mask:
testmask.jpg
testmask.jpg (22.85 KiB) Viewed 45189 times
(respective DDS texture file attached in testmask.zip)

Create a box/cube in front of the truck; apply a lightsmask material onto that box, but make sure to assign this test mask texture onto "DETAIL2" slot. Then edit UV mapping on box for UV channel #2 and use: Generate New, and Copy from: #1. So the second UV will copy UV from first channel (the first channel UV is automatically created when you create the box).

Then test in game different set of lights on/off, turn/brake etc.

just to get used HOW the masking work.
Attachments
testmask.zip
(19.63 KiB) Downloaded 798 times
womble
Beginner
Posts: 215
Joined: Wed Mar 16, 2011 11:04 am

Re: ETS2 Lightmask texture

Post by womble »

youngbuck wrote:Thanks Oleg I did what you said and now it shows up like this when I put the park lights on. How do I get it so that only the park lights show when I turn them on and then lowbeam and highbeams show only when I turn them on and such?
http://farm8.staticflickr.com/7281/9615 ... 9480_b.jpg
All controlled by the colours in the main texture of the light_mask. I will give you a little direction. Blue is used for high beam. If you do not want the light to show brighter when high beam is on, then make sure that the light is only mapped to a black section of the main texture, and is then mapped to a mask image of the light in the alpha.

As Oleg suggested, play about a bit and see what different things do, and then write them down. The only way I understood how these worked was playing about with different ideas, and then testing in game.
baton15
Posts: 2
Joined: Sun Oct 21, 2012 4:44 am

Re: ETS2 Lightmask texture

Post by baton15 »

Can anyone tell me how to lightmask the headlights so they are not bright as I tried the tutorial for it but that just explains the side flares please
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: ETS2 Lightmask texture

Post by Oleg »

Load original model (scania or any other you drive in game);
Create the box in front of the truck, apply original trucks lightmask material onto this box.
Open properties of this material and replace lightmask (DETAIL2) with the test lightmask attached above;
Move box into "chasis_base" group (or something like that, I don't remember the exact name of the group).
Export modified truck;

Pack the mod and make sure to put test lightmask DDS file there too.

then drive the truck in game and turn different lights and turn signals. You will see how the lightmask is actually applied in game.

The lightmasking of headlights is exactly the same as lightmasking the side flares as you see in tutorial. The only difference is that headlights and taillights will use only "square" #1 (front left), #2 (front right), #3 (rear left) and #4 (rear right).
FChriss
Posts: 10
Joined: Wed Oct 24, 2012 11:35 pm

Re: ETS2 Lightmask texture

Post by FChriss »

Doesn enyone know how to edit the sii file from game to change the color on block 4 or any block? For example, the yellow color, to be orange. I need orange tint on block 4

Code: Select all

SiiNunit
{
color_array  : _nameless.lamp_colors {

	# Red Green Blue (linear color space)
	# Use 'Sgfx presets' tool to grab them.
	#
	# See http://wiki.scs/cgi-bin/twiki/view/EuroTrucks2/LampEffect#Vehicle_Lamps

	color[]: (1.00, 1.00, 1.00)	# 0. front positional
	color[]: (0.20, 0.00, 0.00)	# 1. rear positional
	color[]: (0.50, 0.30, 0.00)	# 2. side positional
	color[]: (0.90, 0.90, 0.90)	# 3. low beam
	color[]: (1.00, 1.00, 1.00)	# 4. high beam
	color[]: (1.00, 0.31, 0.00)	# 5. front/rear turn signal
	color[]: (0.00, 0.00, 0.00)	# UNUSED
	color[]: (1.00, 0.05, 0.00)	# 7. brake
	color[]: (1.00, 1.00, 1.00)	# 8. reverse
}
}
Skoops
Posts: 33
Joined: Sat Jan 05, 2013 2:44 pm

Re: ETS2 Lightmask texture

Post by Skoops »

I tried FChriss, but nothing happend.. The numbers are RGB color code, but only goes from 0-1 meaning, 0 is 0 in RGB, and 1 is 255.. I think.. :)
Post Reply