Last time I found some rf issue when working with cars. It push me to write some notes/tips and share it with you.
especialy in area of emmiting light objects. There are a few in this category
-headlights (hlglo_) - HlightDS and HlightPS instances
-stoplights (blglo_) - BLIGHTDS and BLIGHTPS instances
-taillights (hlglo_) - HlightDS and HlightPS instances
-rainlight/pitlight - RAINLIGHT instance
-warning/information lights on dashboard
-render targets for telemetry data on dashboard (speed, rpm, position etc)
-other lit elements like background of LCD display
First issue I found in a lot of mods is that shadows are dropped on light sources. Source light shouldn't be dimmed by shadow! It still emitting the same amount of energy. Of course in real some amount of light comes from evn reflected from the objects. But in case of leds or stop/head lights we may ignore it.
There are two methods to avoid this:
- disable receiving shadow in gen file for object
- set Glass attribute for lit material.
I think both methods are good enough. To better organize objects, it may be even better to extrude all lit objects into separate gmt file and disable shadow for this.
You will see, that effect is very impressive, while going under shadows, whole cockpit but lights gets darken. Or cars goes darker but headlights are still powerful.
Second thing (related to lights but not only) is an animation. Lights like stop lights, rain lights, headlights use animation fired by Event. There are situations when you may want to use the same texture for different objects. For example some cars uses 3rd stop light to be also rain-light. So why to not use the same texture?
No - you may not. Using the same texture, it will cause conflicts and only anim of first loaded material will be used. For example stop light will work but rain-light wont. It is enough to duplicate texture, make rain-light to use new one, and everything will start working as expected.
So, do not use the same texture for animated materials fired by different events.
In car windows
There are two issues with windows. Both may be solved at once. In first case some objects may be rendered inside a car. It is because materials of those objects are set to blend (blend multiply in 3dsimed) as well as windshield is. Such materials are not sorted when rendering scene, that's why sometimes other objects appear between camera and glass.
The solution to this is set Glass attribute. It will give infor for engine to render this object at the end.
Second issue I saw in some mods (usually conversions) is shadow dropped onto glass when sitting incar. Again, what human sees is the light. Light going through an object (windshield) cannot be affected by shadow casting onto this object. in short, make sure windshield (and other windows) has not set to receiving shadows. But even better is to set glass attribute.
Hope it will help beginners at least.