This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] How do lights work?  (Read 4623 times)

PainSavior

  • Contributors
  • LUA Script Tinker
  • *****
  • Posts: 40
    • View Profile
[QUESTION] How do lights work?
« on: October 21, 2013, 02:54:57 am »
I can't seem to find a tutorial on this...

But.. I'm wondering.
How do the lights work on WoW?....

Are they're actually "Light Objects" that are combined into the WMO?
Or is there a Lightmap file for every adt?

I'm trying to make the insides of my building bright, and I thought that was done by adding a M2 (Torch), but it didn't brighten it up at all.

Can some one explain how to add light to the inside of a building?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #1 on: October 21, 2013, 11:06:52 am »
There are dbc entrys and light spots for outsidem inside light is part of the model.  And i would also need some hints how to handle them.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

PainSavior

  • Contributors
  • LUA Script Tinker
  • *****
  • Posts: 40
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #2 on: October 21, 2013, 10:04:41 pm »
That's what I'm trying to figure out.. Inside WMO lights.
Gamh said it has something to do with vertex colors of the model... which aren't currently editable as of right now..


So.. is there a cheap fix to adding light to the inside of a WMO?
That's my question to the modcraft community
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

PhilipTNG

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 709
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #3 on: October 21, 2013, 11:28:48 pm »
This seems to be uncharted territory, so if you really do want an answer, you may be alone in this endeavor, but if you find anything out or get a working concept going, then feel free to enlighten us(the community) if you so wish it. ^_^
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

phucko1

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 523
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #4 on: October 22, 2013, 12:25:36 am »
I am unusure about lights in WMOS, but I think they're caused by lights in a m2 that is later placed inside the WMO, but you can probably set a flag to give the whole wmo the same lit.

But for m2s you can give it lights with the Lightadder program or with MDLVIS/War3ModelEditor + MDXTOM2.

I suggest you try the first program mentioned.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #5 on: October 22, 2013, 06:02:45 am »
Cool.  Thank you.

We should collet a List of m2 that are useable as light source.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

TheBuG

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 469
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #6 on: October 22, 2013, 01:06:41 pm »
Not all lightning in WMOs is handled by M2s.

But you can still add lights to your M2s yourself and place them in the WMO in question.

viewtopic.php?f=12&t=706
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #7 on: October 22, 2013, 04:02:58 pm »
QUestion is , is there also animated light possible. To get a fire flickering effect?
Or do particles also give light and are there light particels.

Questions about questions :)

I was once on Bastis server and he did the lighting with m2s. It looked very nice, but if you get the model out of view, the light alos dissaperas. Is this possible to rfix?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

PainSavior

  • Contributors
  • LUA Script Tinker
  • *****
  • Posts: 40
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #8 on: October 22, 2013, 05:48:53 pm »
I guess that's the way to go for now. I'll give that a try.
Cause' it doesn't look like WMO's lights are understood yet, and I'm really not into hexing. I'm sure I'll make a mess of things.

I can say this, that the WMO's if written as "Indoors" usually bugs the world, if you get close to them. And I'm pretty sure it needs to be set as indoors to get the M2 lighting. IDK though I haven't actually been able to get a light to work well.

On the subject:
Quote from: "Gamh"
Unfortunately no, OBJ has no clue about lighting (but anyway, so does this converter).

Setting your WMO indoor is likely to crash as the converter can't generate portals from nothing, and portals are mandatory to link indoor to outdoor parts. I thought about a system for this.

So maybe if the entire model is indoor.
Or even if you made a seperate WMO, ligned up on the outside that might be a way around it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #9 on: October 22, 2013, 06:18:27 pm »
Quote from: "PainSavior"
Cause' it doesn't look like WMO's lights are understood yet, and I'm really not into hexing. I'm sure I'll make a mess of things.
They are. MOLT are just the same as M2 lights. The more performant, more commonly used MOCV is just the output of 3dsmax / some renderer, equivalent to light maps, applied to the 3d structure, coloring each vertex individually.

Quote from: "Steff"
QUestion is , is there also animated light possible. To get a fire flickering effect?
Yes. Next to all values are animated.
Quote from: "Steff"
Or do particles also give light and are there light particels.
No.
Quote from: "Steff"
Is this possible to rfix?
Increase the model view bounding box until light will have no influence anymore. If you would still see light, but the model disappears, the model is actually broken, not the rendering.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

PainSavior

  • Contributors
  • LUA Script Tinker
  • *****
  • Posts: 40
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #10 on: October 22, 2013, 09:46:08 pm »
I wanted to start out saying :
This is kind of a major thing... If you want WMO's (Larger objects, buildings and such) to have lights, then their should be a tutorial on this, No?...

I mean, really. If you'd want to make ANY custom WMO then you would want to know how to light it up just like the building's in WOW?
I don't know if this subject is relatively new.. cause I've never seen a tutorial on WMO Lighting.
I'll be sure to write one for the community if we can come to a solution.

Quote from: "schlumpf"
Quote from: "slhumpf"
They are. MOLT are just the same as M2 lights. The more performant, more commonly used MOCV is just the output of 3dsmax / some renderer, equivalent to light maps, applied to the 3d structure, coloring each vertex individually.

So..... In human terms.
How would I go about coloring vertexes?
What you said above... Is that all done in hex editing?...

Like step by step?
1.) Open the WMO (Switch to Indoor for Indoor objects(But what about Gamh wrote:Unfortunately no, OBJ has no clue about lighting (but anyway, so does this converter).

Setting your WMO indoor is likely to crash as the converter can't generate portals from nothing, and portals are mandatory to link indoor to outdoor parts. I thought about a system for this.))

2.) Find nLight and change value to one?
3.) MOCV / MOLT chunk?

4.) Change what values?

I have so many questions for you, if you truly know how to light up the WMO's.
Does it have to be an Inside wmo as well? (No Outdoor check)

(I'm pretty sure OBJ format doesn't allow for vertex colors..... and if not that, I'm pretty sure Gamh's converter doesn't convert vertex colors?)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #11 on: October 22, 2013, 10:08:41 pm »
Quote from: "PainSavior"
I wanted to start out saying :
This is kind of a major thing... If you want WMO's (Larger objects, buildings and such) to have lights, then their should be a tutorial on this, No?...

I mean, really. If you'd want to make ANY custom WMO then you would want to know how to light it up just like the building's in WOW?
I don't know if this subject is relatively new.. cause I've never seen a tutorial on WMO Lighting.
I'll be sure to write one for the community if we can come to a solution.

Quote from: "schlumpf"
Quote from: "slhumpf"
They are. MOLT are just the same as M2 lights. The more performant, more commonly used MOCV is just the output of 3dsmax / some renderer, equivalent to light maps, applied to the 3d structure, coloring each vertex individually.

So..... In human terms.
How would I go about coloring vertexes?
What you said above... Is that all done in hex editing?...

Like step by step?
1.) Open the WMO (Switch to Indoor for Indoor objects(But what about Gamh wrote:Unfortunately no, OBJ has no clue about lighting (but anyway, so does this converter).

Setting your WMO indoor is likely to crash as the converter can't generate portals from nothing, and portals are mandatory to link indoor to outdoor parts. I thought about a system for this.))

2.) Find nLight and change value to one?
3.) MOCV / MOLT chunk?

4.) Change what values?

I have so many questions for you, if you truly know how to light up the WMO's.
Does it have to be an Inside wmo as well? (No Outdoor check)

(I'm pretty sure OBJ format doesn't allow for vertex colors..... and if not that, I'm pretty sure Gamh's converter doesn't convert vertex colors?)


That's why .WMO is not based on .obj.. Doing it by hand would be a horrible pain in the ass, though. I'd advice against that.

Also, see http://wowdev.wiki/index.php?title=WMO.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Waveworms

  • Registred Member
  • MWCS Enthusiast
  • *****
  • Posts: 2
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #12 on: October 22, 2013, 10:34:20 pm »
I haven't been around WoW for a bit ,so I might've forgotten something.
From what I remember to get vertex lighting you have to enable the flag in the MOGP chunk (optionally the indoor flag too if it's indoor) if you leave it outdoors the light will just blend with it like it normally would.
You then need to add a MOCV chunk yourself, (The MOGP and MOCV are in the group file, I think I edited MOGI in root file when testing indoor/outdoor ,but you couldn't see the inside unless you moved into it because of  no portals) After that I used "4 bytes per vertex"(quoted from wowdev) and trial and errored it.  That's how I got light in my .wmos .-.
Old examples attatched -edited
« Last Edit: October 22, 2013, 10:55:40 pm by Admin »

Gamh

  • Contributors
  • Loreweaver
  • *****
  • Posts: 81
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #13 on: October 22, 2013, 10:42:28 pm »
There is no real way to do this by now, if that's what you mean PainSavior.

It is possible to do the following to add lights, both indoor and outdoor I guess, with the help of the wiki link above :
- Open root WMO
- Increment nLight
- In MOLT, add a new light entry with your parameters
- Open the WMO group where you need a light
- In MOLR, add your light entry
- In both root WMO and group WMO, toggle the MOLR flag on.

But as said,
 
Quote from: "schlumpf"
Doing it by hand would be a horrible pain in the ass, though. I'd advice against that.
That's why there aren't explicit tutorials about this.

What you most probably want to do for "indoor lights" is using vertex colors, which are colors applied on each vertex of the model, used exclusively indoor in WoW. But nor OBJ or 3DS support vertex colors ; a good candidate is the FBX format, and I'm already working on this.

You can do all of this by hex, but it would be a whimsical time loss.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

PainSavior

  • Contributors
  • LUA Script Tinker
  • *****
  • Posts: 40
    • View Profile
Re: [QUESTION] How do lights work?
« Reply #14 on: October 23, 2013, 01:10:04 am »
Okay, okay. So it is possible VIA hex editing... I get it. But this would one vertex at a time which would be a giant waste of time I guess.

So, in the mean time of waiting for us to be able to convert something that allows vertex colors to WMO format.

What would be the best rigged-fix? In terms of managable, simplicity, and times-sake.
The idea of using m2s (With a larger light span)?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »