The online racing simulator
Share your modding tips and tricks
Recently I got a PM with a question about taillight shading of my Felicia mod, which inspired me to start a thread, where modders can share their techniques to learn from each other to make more high quality mods in the future. Therefore I will start with a few visual "tricks" which I have used and might be helpful Smile

A texture-based ambient occlusion
Sometimes dark points are not enough for a smooth ambient occlusion. In those cases a texture can be used. Professionals can bake it, beginners can draw it by hand (I personally prefer drawing). This texture can be combined using transparent layers.



A shaded roll-cage
A strange looking roll-cage shading is a common problem of many mods. To enthance shading approximations of a cage a simple texture can be used. For a better result, the alpha channel should correlate with black color which will remove unwanted gloss under the ceiling.



A Felicia tailight effects
I have used multiple "tricks" to build this one. First the "yellow light around a bulb" is done using a texture. The default color of the taillight is red which hides a white places in the texture. The color of a lit taillight is yellow, which overrides the red color.

Secondly, IRL the tailights reflects daylight from various angles. To approximate a distribution of light in a tailight I have tweaked normals using some additional triangles, which are not visible. If you turn the Škoda Felicia mod (using a 3rd person view) in the LFS, you can see, that tailights are shaded quite differently (despite not being fully 3D).



Edit: feel free to post your own tips and tricks in this thread Smile Anything about shading, topology, suspension approximations, realistic aerodynamics, engine sounds etc. could be helpful Smile
Attached images
felicia_tailights_shading.jpg
ambient_occlusion_example.jpg
rollcage_shading_example.jpg
Geometry-based toon shading

1. Copy the whole outer body (for example in Blender software) and merge it into a one "outline" object.
2. Scale the outline object according to vertex normals (alt + S in Blender edit mode) so it wraps the original body. The scaling will define width of the final outline.
3. Import the outline object into the LFS Editor.
4. Remove the windows from the outline object and attach outline window holes to the original windows
5. Remove unnecessary points by joining them (for example panel gaps) and ensure that the whole outline object has the same smoothing group to optimize number of points.
6. Flip the outline triangles.
7. Set a black color for the outline.

Attached images
toon_shading_in_LFS.jpg
This is how to make middle screen swap correctly with the driver left/right position:

1. Create an empty subobject -> select screen triangles (1st attached screenshot)
2. Break off
3. Merge into main object
4. Select screen triangles (2nd attached screenshot) -> make l.r.swap to swap
5. Now you need to edit the screen texture - you need to make a copy of the texture so you can have two versions of the same texture - one for the left side, the other for the right side (3rd screenshot)
6. Then you need to duplicate the screen cutout -> screen1 and set the flip function to [YES] - one for the left and one for the right side (4th screenshot)
7. Go to mappings and select screen mapping -> add screen1 cutout to the opposite side (5th screenshot)
8. You need to rotate/edit/adjust the 2nd screen texture so it can look correctly

You have to do the same for the rest of the flipped textures.

I have attached an example of how it should look the texture on the right side (last screenshots).

I know its not best explanation, but still better than none. Big grin
Attached images
Screenshot 2024-07-17 172017.jpg
Screenshot 2024-07-17 172538.jpg
Screenshot 2024-07-17 173301.jpg
Screenshot 2024-07-17 173939.jpg
Screenshot 2024-07-17 174109.jpg
Screenshot 2024-07-17 174821.jpg
22F543~D0DC1B8A.png
Screenshot 2024-07-17 175733.jpg
Screenshot 2024-07-17 175746.jpg
Shiny wooden material with an ambient occlusion using GIMP software

1. Take a photo of wood and colorize it according to your liking in the first layer.
2. Create the second layer by duplicating the first layer. Desaturate (Colors -> Desaturate -> Desaturate) it and adjust contrast (Colors -> Curves) so both completely white and black pixels are present.
3. Remove white from the second layer using (Colors -> Color to Alpha)
4. Change 'Mode' of the second layer from 'Normal' to 'Erase'.
5. Hide the second layer and create the third layer between the first and the hidden second. Draw an ambient light using a black 'Airbrush'.
6. Create the fourth layer by duplicating the third layer. Change 'Mode' of the fourth layer from 'Normal' to 'Erase'.
7. Show the second layer and export a final PNG texture using '8bpc RGBA pixel format' and tick the 'Save color values from transparent pixels' option.
8. Load the PNG texture in the LFS editor and use a 'Variable Shine' option in the material properties. Similar steps may be also applied on many other materials (for example leather and various plastics).

Attached images
wood.jpg
Quote from stuchlo :
A Felicia tailight effects
I have used multiple "tricks" to build this one. First the "yellow light around a bulb" is done using a texture. The default color of the taillight is red which hides a white places in the texture. The color of a lit taillight is yellow, which overrides the red color.




thx for
Attached images
lfs_00000122.jpg
lfs_00000123.jpg
Translucent window stickers

Translucent (but not transparent) materials are not supported in the LFS editor. However there is a way, how to approximate diffusion of sunlight in some cases (for example window stickers). In the picture can be seen a difference between sunshield of Škoda Felicia Kit Car mod and the original XFG GTR car. No post-processing shaders were used. The result is skinnable and its color can be defined by players.

1. Remove "double sided" option from sticker triangles.
2. Create the same triangles with flipped normals using "build mode". These must be done one-by-one. Do not use duplicate, because duplicated vertices will have their own normal vectors.
3. Select the created triangles and set their n.c. level to zero to remove bad normals. The triangles from the outside must have at least low n.c. level. This causes that the interior triangles use normals from the exterior ones without distorting the exterior shading.
4. Normals are fixed now, but the sticker is too bright.
5. Duplicate the original mapping (and cutout) and change the material to matt. Change its naming from C1_mapping to E1_mapping to darken it (otherwise it will be too bright).

Edit: One more thing - both outer and inner triangles (and the whole window) must have the same smoothing group. Otherwise the inner triangles will not use normals of the outer triangles

Attached images
translucent_sunshield.jpg
If you want a car to have day lights that also serve as turn signals, which is not that rare in modern cars, you can use a slider subobject to fake this (got the idea from the Protech mod, which however does not hide the side lights):
  1. Move the triangles to separate subobjects, e.g. DRL_R, find_R and same for left side.
  2. Make sure the origin of each subobject is on the correct side of the car (so it is properly detected as left/right indicator)
  3. Make the subobjects sliders, connect them to left/right indicator, and adjust their slide axis and distance to hide them somewhere.
  4. For the indicators, do the opposite: move the triangles to the hidden position, and make the slider show them.
Attached screenshots show the settings for one such slider object, and the result when combined with lights.

You can use the same trick to dim the DRL when the low beam is turned on, instead of keeping them as is or turning them off, but this will require a texture to properly dim them.
Attached images
LFSEditor_DRL_indicators.png
LFSEditor_Clio_DRL_indicators.gif
Fixing perpendicular chrome issues

There is a known issue, where perpendicular (especially chrome) parts are not glossy. It cannot be fixed properly, but in some cases it can be approximated using "tweaked" normal vectors.
  1. Perpendicular chrome mask
  2. Set proper groups
  3. Set zero n.c. level for tweaked areas
  4. For each tweaked vertex make two vertices inside of the model
  5. Make triangles hidden inside of the model using tweaked and newly created vertices. These triangles must have the same group as the tweaked area and n.c. level higher than zero. The triangles must be parallel with each other to prevent strange visual dents.
  6. Final tweaked glossy chrome
The same workaround can be used for headlight and taillight effects, police hazard light effects, glossy wooden dashboards etc.


Attached images
chrome_LFS_fix.jpg
Quote from stuchlo :Translucent window stickers

Translucent (but not transparent) materials are not supported in the LFS editor. However there is a way, how to approximate diffusion of sunlight in some cases (for example window stickers). In the picture can be seen a difference between sunshield of Škoda Felicia Kit Car mod and the original XFG GTR car. No post-processing shaders were used. The result is skinnable and its color can be defined by players.

Do you know if there is a way to achieve a similar effect with alpha textures? I tried it with a window glass texture but it only works in the editor Frown It would be cool to create a window glare / translucent glass effect.
Attached images
lfs_00000552.jpg
lfs_00001958.jpg
On the bright side, if it works in the editor, it should mean it will also work after the graphics update Big grin

Just a quick note on the subject of those translucent sunshields, since I added one to the Laurent Coil Cup, I can say you do not need to manually build each triangle, I did duplicate and flip them, then merged the vertices and assigned zero normal contribution to the inner side as well as the same smoothing group, and it works just as well. (almost pure white on the screenshot, not exactly the most interesting to see the effect, but it receives shadows just fine)
Attached images
sunshield.jpg
Quote from Flame CZE :Do you know if there is a way to achieve a similar effect with alpha textures? I...

I have tried it with dirty window texture on Hadimrška (not uploaded yet) and it worked for me. I have no idea, what happened on your screenshot.

Quote from Bokujishin :I can say you do not need to manually build each triangle, I did duplicate and flip them, then merged the vertices

Good find!
Quote from Flame CZE :Do you know if there is a way to achieve a similar effect with alpha textures? I...

Okay, I think I found out what happened in your screenshot, it looks like a deformed environment mapping. The "translucent workaround" can be used with transparent textures without problems, but cannot be used with specular materials, because it is just a hack to flip normal vectors, which will flip specular light and environment mapping as well. Changing the flipped triangles cutout to MATT should work Smile

If you want to have a specular translucent material, you have to add an additional completely transparent specular overlay layer over the result.
Rotary beacon light

  1. Create beacon light dome using a matt material.
  2. Flip dome triangles.
  3. Duplicate dome triangles, flip duplicates and apply constant shine transparent texture.
  4. The finished dome with glass effects.
  5. Add a spinner object consisting of a circle and a smaller inverted half dome. Apply matt l_extra mapping on both. The circle approximates a lightsource with rotating mirror, while the half-dome approximates reflected light from the inside of the dome.
  6. The final beacon light.
Attached images
LFS_beacon_light.jpg
police.gif

Share your modding tips and tricks
(13 posts, started )
FGED GREDG RDFGDR GSFDG