• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Get your art tools and paintbrushes ready and enter Hive's 34th Texturing Contest: Void! Click here to enter!

Dealing with map lightning

Status
Not open for further replies.
Level 23
Joined
Feb 6, 2014
Messages
2,466
A lightning is like an effect (Chain Lightning, Finger of Death, Aerial Shackles). It is NOT a model. You can create a lightning using triggers through specifying where the two ends of the lightning are located.
If you want to create a "custom"/"new" lightning, you need to edit LightningSplat.slk (not sure about the name) and input the "string code" and texture path for your new lightning. You can also just edit the texture of an existing lightning e.g. replace the texture of Life Drain.
 
Level 11
Joined
Sep 12, 2015
Messages
649
If that's the case...

full


The option above shows the effect Lightning and in the picture it is turned on, pictures with effect below:


Map With Lightning Effect:

full


Map Without Lightning Effect:

full


So, overall the Lightning Effect keeps the map darker.
 
Map lighting is located in Environment\DNC\

It's a model file with it's own directional light nodes.

Here are some paths to Lordaeron lighting:

Environment\DNC\DNCLordaeron\DNCLordaeronTerrain\DNCLordaeronTerrain.mdx
Environment\DNC\DNCLordaeron\DNCLordaeronUnit\DNCLordaeronUnit.mdx

You can change your map's lighting type to one of the presets in World Editor > Map Options. Creating a new lighting is possible but it's probably beyond your understanding.
 
Last edited:
Level 28
Joined
Nov 12, 2007
Messages
2,340
People already tried to create their own light models but they behaved weirdly.

You can also change the DNC model via triggers, or set the current model to none using this custom script SetDayNightModels("",""), which will make the map dark. This is particularly useful for night terrains.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,296
People already tried to create their own light models but they behaved weirdly.
No they behave fine...
You can also change the DNC model via triggers, or set the current model to none using this custom script SetDayNightModels("",""), which will make the map dark. This is particularly useful for night terrains.
Or load lighting models like that as well.

Since lighting models are generally not edited that often, most model editors and MDX<->MDL converters will not work properly on them due to improper implementation of the standards. During my experimentation with them, part of discovering how WC3 colour management is trash, I used MdlxConv to convert an existing lighting model, edit it and convert it back. I then used SetDayNightModels to change the lighting model in game, and it worked.

Lightning and lighting are two completely different nouns describing totally unrelated objects (except maybe lightning causes a flash of light, probably where the word came from).

Lightning is high voltage electrical discharge, usually caused when the electric potential of water high up in the atmosphere becomes largely different from the electric potential of the ground. Eventually the isolation capabilities of air are insufficient to prevent a flash over and a bolt of lightning is created from which ever side is least charged towards which ever side is most charged. Usually this is from the sky towards the ground however the opposite can occasionally happen as well as lightning between clouds or layers of the atmosphere. What we perceive as lightning is actually a plasma arc that the current is using to travel between the potential levels. Due to millions of volts being involved lightning is extremely dangerous, can travel dozens of kilometres and survival chances within a few meters of the impact sight is not good. Recently (last year or so) many people died due to a lightning impact at a childs party.

Lighting describes the illumination model used to view a scene. This includes how many lights, their intensities, their colours, their projection shapes and even the light behaviour. Lighting can be dangerous as too little light might mean safe completion of some tasks is not possible, too much light can cause injuries such as sun burn, blindness or in extreme cases burning and certain lighting patterns can trigger fits in susceptible individuals. Film sets often have several big, powerful lights they use and turn on/off to control the lighting environment during production.

WC3 lighting model is very basic, and actually wrong. Each piece of geometry can be illuminated by at most 8 lights at once, as defined by the fixed function pipelines of old, which are selected automatically based on proximity by some algorithm that is not always 100% accurate. As far as I am aware it is not possible to change properties such as cutoff polynomial for these lights as well, only the intensity. WC3 has no HDR shader so maximum illumination is reached and clammed at a calculated light factor of 1.0. The default environment lights are usually much brighter than 1.0, probably to prevent significant brightness degradation by the light cutoff polynomial as they will be clamped at 1.0. A bug in the light selection algorithm means that lights contained within displayed portrait models bleed over at the map origin, (0, 0) which can ruin some lighting effects such as total darkness as can be seen with the Crypt Lord model among many. The values and mechanics of lights do not act realistically as the computed linear results are displayed directly on a non linear sRGB display without first being corrected. StarCraft II lighting is much more accurate and advanced as it does feature realistic shadow casting and a HDR shader that performs sRGB like correction however it suffers from texture discolouration due the sRGB textures being interpreted as linear RGB ones.

WC3 lightning is a model that is stretched in the game world between 2 coordinates with the texture UV coordinates animated. There really is nothing else too it next to that lightning is highly bug prone as it has been known to cause crashes if used improperly.
 
Status
Not open for further replies.
Top