| 03-16-2003, 02:40 AM | #1 |
OK, here's the results of my research on making lights by screwing with the mdl parameters. Hopefully, somebody else can fill in the gaps I'm leaving in this: first off, though you can simply cut and paste in from the torch model, you'll run into two problems. The first is that a light may have an object ID. If it does have one, and it's already being used by something else in your new model (a bone, for example) you're going to have problems. The other thing is that while we think of "light" as a single thing, there's at least 4 somewhat different things wc3 does to create the appearance of light. Keeping this in mind while mdl editing will help you choose exactly the kind of effect you're looking for. The first two have nothing to do with "light" - by making a "halo" on a model or making a "flame" emitter, some units have the illusion of being light sources even if they're not. The farseer's missile and the brazier doodad are examples of both of those tricks respectively. Second, actual light sources can create "pools" of light below them. The lantern is an example of this. This is done by making a geoset at ground level. Even if the geoset itself is invisible, it will still act illuminated (by *ambient* light) and create the "pool" of light below the source. Finally, there's the conventional light that illuminates nearby models. PS - this light is totally different than a hero glow, which is created totally differently, and which behaves completely differently in-game. OK, now that you have a light, you have parameters: Omnidirectional, //doesn't seem to actually do anything static AttenuationStart 20, // seems to indicate a zone of lesser static AttenuationEnd 200, // shading static Intensity 10, // the diameter of the light radius, it seems static Color { 1, 1, 1 }, // color static AmbIntensity 0, // this seems to have something to do with light effects when the unit is selected. static AmbColor { 1, 1, 1 }, //color of above The difference between intensity and AmbIntensity *seems* to be that intensity refers to light shining on other models, while ambintensity refers to light shining on the this model. It seems to be quite possible to have one without the other. A note about values, btw - ambintensity values don't need to be very large to illuminate the model - even a value of "1" may do the trick. Intensity, on the other hand needs values significantly higher to be noticed on nearby models. Values of at least 10 are needed for a *bright* light. One thing to consider is that anything marked "static" need not be static. I've created a "flickering" light by varying intensity and AmbIntensity with time . You could possibly create expanding lights by altering attenuation with intensity. And I suspect you could make "disco" lights that gradually changed colors by varying the color parameters. Also: in my limited experiments, ambient values of "blended" colors produce a white "pool" of light regardless of the values. So {1, 0, 0} will give a blue pool, while {1, .1, .1} doesn't give the lighter blue pool I'd expect, but rather a white pool. Something to think about. Feel free to respond to confirm all of this, or provide additional parameters that the basic lights don't have |
| 07-11-2003, 06:31 AM | #2 |
I just updated this to reflect the new things I've learned. This probably ought to be stickied in "Modeling & Animation" (by my "Particle Emitters - all the info I can gather" thread), if a moderator would be so kind. |
| 07-14-2003, 04:31 AM | #3 |
i think you missed on quite a few things there ari :) Omnidirectional, //im guessing there is also the option to make it a directional light or a spotlight, dunno how you would aim it though. static AttenuationStart 20, // defines the beginning of the point at which the light begins to lose its effect static AttenuationEnd 200, // the furthest distance that will be effected by the light. intensity values(see below) are constant from 0 to AttenuationStart and probably linearly interpolated between AttenuationStart and AttenuationEnd(0 at AttenuationEnd). static Intensity 10, // the strength of the light. will have more effect on faces that are facing towards the light and less as they turn away until the normal vector of the face has turned 90 degrees or more away from the directional vector to the light at which point the face will recieve no effect from this value. static Color { 1, 1, 1 }, // color, yay ari! static AmbIntensity 0, // this is an intensity(also interpolated from AttenuationStart to AttenuationEnd) that effects all faces the same, regaurdless of the direction that they are facing. The final amount of light for each face that is added to the global light of the game is the sum of this value and the other intensity value(after the other one is adjusted for the direction of face). static AmbColor { 1, 1, 1 }, //color of above thats it. |
| 07-15-2003, 11:49 AM | #4 |
Wonderful, I'm guessing you can change the light color to make a wisp into a disco ball... *runs off* |
| 07-23-2003, 06:30 AM | #5 | |
Quote:
|
| 08-07-2003, 09:35 AM | #6 |
I have never seen Directional in an MDL, but another type is Ambient. A model with this type can be found in war3.mpq: Environment\Sky\Sky\skyLight.mdx. I have also seen this type of light in ArthasFightsIllidan.mdx, the pseudo-cinematic before the final cg sequence in the TFT campaign. I have not experimented much with this type of light, but it seems like it is for some sort of global lighting. The attenuation start and stop distances are present in these lights, but I doubt they have any affect. Also, for 3dsmax and gmax users, 'DeX will now export omni lights, so you will not have to fiddle with lights in the MDL. Join the 'DeX channel on IRC (irc://irc.irchighway.net/dex) if you would like to get the latest version of the script (which is still in testing at this time). |
| 10-21-2003, 08:09 AM | #7 |
Many of the Sky models have directional lighting. An example of a non-sky model with directional lighting is Alliance_Exp.mdl from TFT. ... Light "FDirect01" { ObjectId 58, Directional, static AttenuationStart 80, static AttenuationEnd 200, static Intensity 0.1, static Color { 1, 1, 1 }, static AmbIntensity 0, static AmbColor { 1, 1, 1 }, } ... The other files (all of the following from Reign of Chaos): Alliance_Exp.mdl DalaranSky.mdl DNCAshenValeTerrain.mdl DNCAshenValeUnit.mdl DNCDalaranTerrain.mdl DNCDalaranUnit.mdl DNCDungeonTerrain.mdl DNCDungeonUnit.mdl DNCFelWoodTerrain.mdl DNCFelWoodUnit.mdl DNCLordaeronTarget.mdl DNCLordaeronTerrain.mdl DNCLordaeronUnit.mdl DNCUndergroundTerrain.mdl DNCUndergroundUnit.mdl FelwoodSky.mdl FoggedSky.mdl LordaeronFallSky.mdl LordaeronSummerSky.mdl LordaeronWinterSky.mdl LordaeronWinterSkyBrightGreen.mdl LordaeronWinterSkyPink.mdl LordaeronWinterSkyPurple.mdl LordaeronWinterSkyRed.mdl LordaeronWinterSkyYellow.mdl I'm sorry I don't have paths, but the filenames should do. |
| 10-21-2003, 07:10 PM | #8 |
i dont get where the targeting in the directional lighting is... i must be missing something. |
| 10-21-2003, 07:29 PM | #9 |
Also, the only MDL that has Ambient lighting in War3.mpq is skyLight.mdl. ArthasIllidanFight.mdl also has one (From skyLight.mdl) Light "FDirect01" { ObjectId 5, Ambient, static AttenuationStart 80, static AttenuationEnd 200, static Intensity 0, static Color { 1, 1, 1 }, static AmbIntensity 1, AmbColor 13 { Bezier, 0: { 1, 0.862745, 0.776471 }, InTan { 0, 0, 0 }, OutTan { 0.754385, 0.410708, 0.381918 }, 30000: { 0.631373, 0.184314, 0.184314 }, InTan { 0.754248, 0.410457, 0.381699 }, OutTan { 0.631373, 0.184314, 0.184314 }, 30033: { 0.631373, 0.184314, 0.184314 }, InTan { 0.631373, 0.184314, 0.184314 }, OutTan { 0.628758, 0.168627, 0.181671 }, 40033: { 0.623529, 0.137255, 0.176385 }, InTan { 0.626144, 0.152941, 0.179028 }, OutTan { 0.563399, 0.218301, 0.158084 }, 43333: { 0.443137, 0.380392, 0.121483 }, InTan { 0.503268, 0.299346, 0.139783 }, OutTan { 0.528105, 0.520262, 0.32674 }, 46667: { 0.698039, 0.8, 0.737255 }, InTan { 0.613072, 0.660131, 0.531998 }, OutTan { 0.798693, 0.820915, 0.750327 }, 50000: { 1, 0.862745, 0.776471 }, InTan { 0.899346, 0.84183, 0.763399 }, OutTan { 1, 0.862745, 0.776471 }, 71667: { 1, 0.862745, 0.776471 }, InTan { 1, 0.862745, 0.776471 }, OutTan { 0.899898, 0.844081, 0.817238 }, 75100: { 0.699694, 0.806751, 0.898772 }, InTan { 0.799796, 0.825416, 0.858005 }, OutTan { 0.594897, 0.749344, 0.931046 }, 76900: { 0.385304, 0.634531, 0.995594 }, InTan { 0.4901, 0.691938, 0.96332 }, OutTan { 0.448573, 0.52362, 0.803608 }, 84000: { 0.575113, 0.301797, 0.419635 }, InTan { 0.511843, 0.412708, 0.611622 }, OutTan { 0.586546, 0.26525, 0.343809 }, 87300: { 0.609412, 0.192157, 0.192157 }, InTan { 0.597979, 0.228703, 0.267983 }, OutTan { 0.616732, 0.189542, 0.189543 }, 90000: { 0.631373, 0.184314, 0.184314 }, InTan { 0.624052, 0.186928, 0.186928 }, OutTan { 0.368627, 0.678431, 0.592157 }, } } (From ArthasIllidanFight.mdl) Light "FDirect01" { ObjectId 141, Ambient, static AttenuationStart 80, static AttenuationEnd 200, static Intensity 0, static Color { 1, 1, 1 }, static AmbIntensity 0.2, static AmbColor { 1, 1, 0.811765 }, } Light "Omni03" { ObjectId 142, Omnidirectional, static AttenuationStart 80, static AttenuationEnd 200, static Intensity 200, static Color { 1, 0.847059, 0.847059 }, static AmbIntensity 0, static AmbColor { 1, 1, 1 }, } |
