Screenshot for reference, note the red light on the trooper but not the walls:
Specular not working [Solved]
Moderator: Moderators
- Oceans14
- Command Sergeant Major
- Posts: 296
- Joined: Mon Apr 27, 2015 7:09 pm
- Projects :: Athenova Campaign
- Location: Planet 4546b
Specular not working [Solved]
I made a hallway mesh and lit it with attached odf lights. However, they are not illuminating the hall itself, just player models. My textures have an alpha channel (hence the glow), I checked the specular box in ZE tools, and I set the rendertype to 4. This is my first time doing this sort of thing, so if anyone could help me figure out what's wrong that would be great.
Screenshot for reference, note the red light on the trooper but not the walls:
Screenshot for reference, note the red light on the trooper but not the walls:
Hidden/Spoiler:
Last edited by Oceans14 on Wed Nov 30, 2016 7:12 pm, edited 1 time in total.
-
- Gametoast Staff
- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Specular not working
Adding an alpha channel to your textures should not have enabled glow on its own.Oceans14 wrote:My textures have an alpha channel (hence the glow)
Is the entire hallway using glow, which is why you are using alpha channels to control the strength of the glow? If so, that could be your problem. No matter how strong the glow is, any surface using glow will not be affected by any kind of lighting.
Also, a material cannot use both glow and specular at the same time, as glow would take precedence.
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Specular not working
The lights aren't affecting your mesh probably because there are too many (although it could easily be what AQT said too). According to BF2_lighting.doc, a single mesh can only be affected by at most 4 omni lights (which is what ODF lights are) simultaneously. https://sites.google.com/site/swbf2modt ... 2_lighting
Either way, what you should do instead of lighting your mesh dynamically is light it statically with vertex lighting.
viewtopic.php?p=526882#p526882
viewtopic.php?p=526899#p526899
That's not to say that you would remove the ODF lights if you do light the mesh statically, you'd want to put Static = "1" in the lights' ODFs.
Either way, what you should do instead of lighting your mesh dynamically is light it statically with vertex lighting.
viewtopic.php?p=526882#p526882
viewtopic.php?p=526899#p526899
That's not to say that you would remove the ODF lights if you do light the mesh statically, you'd want to put Static = "1" in the lights' ODFs.
I've actually found that surfaces with glow can in fact be subtly affected by lighting, but I think only by the top and bottom ambient lights. To get around this you also enable emissive lighting.AQT wrote:No matter how strong the glow is, any surface using glow will not be affected by any kind of lighting.
- Oceans14
- Command Sergeant Major
- Posts: 296
- Joined: Mon Apr 27, 2015 7:09 pm
- Projects :: Athenova Campaign
- Location: Planet 4546b
Re: Specular not working
Ohh. I'm using 18. Gonna have to change that.Marth8880 wrote:According to BF2_lighting.doc, a single mesh can only be affected by at most 4 omni lights (which is what ODF lights are) simultaneously
Right, right. Should've mentioned that I enabled glow in ZETools. I had to make an alpha layer and color it gray (though it didn't dim nearly as much as I thought.)AQT wrote:Adding an alpha channel to your textures should not have enabled glow on its own.
Yeah, I was actually wondering what the difference between emissive and glow was. By definition they seem to be the same.Marth8880 wrote:I've actually found that surfaces with glow can in fact be subtly affected by lighting, but I think only by the top and bottom ambient lights. To get around this you also enable emissive lighting.
The effect I'm going for is something like this:
Hidden/Spoiler:
-
- Gametoast Staff
- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Specular not working
Instead of applying glow to the entire model (can you confirm whether you originally did this or not?), have the parts you want to glow use their own material cluster separate from the rest of your model and only apply glow to that cluster.Oceans14 wrote:Notice how the dots are white while the light around them is red.
- Oceans14
- Command Sergeant Major
- Posts: 296
- Joined: Mon Apr 27, 2015 7:09 pm
- Projects :: Athenova Campaign
- Location: Planet 4546b
Re: Specular not working
I applied glow to the entire model, yes, but there are 3 different textures. There's a wall texture, a ceiling texture, and a floor texture. I applied glow to all of these when the model was in pieces, then merged them into a single mesh and checked the keep materials box. Not sure if that matters.
Edit: Okay, so I inspected the model and found that I had enabled glow for a fourth texture by accident. After disabling this, the light is being cast on the wall. Now I just need to dim the glowing textures because they're way too bright.
Edit: Okay, so I inspected the model and found that I had enabled glow for a fourth texture by accident. After disabling this, the light is being cast on the wall. Now I just need to dim the glowing textures because they're way too bright.
Last edited by Oceans14 on Mon Nov 28, 2016 12:56 am, edited 1 time in total.
-
- Gametoast Staff
- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Specular not working
As stated before, lighting does not affect glowing surfaces. Since your entire model has glow applied, that is why your red omni lights are not affecting any part of it. You will have edit the model to isolate just the parts you want to glow. There is no way around it. Even with alpha channels you cannot mask off parts you do not want glowing.
- Oceans14
- Command Sergeant Major
- Posts: 296
- Joined: Mon Apr 27, 2015 7:09 pm
- Projects :: Athenova Campaign
- Location: Planet 4546b
Re: Specular not working
Must've been editing my last message when you posted. You're right, that fixed it. Does glow and specular not work at the same time because the alpha layer is used as a controller for both these rendertypes?
-
- Gametoast Staff
- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Specular not working
Glow and specular can work at the same.
For example, look at the stock Magnaguard model: The eyes use glow, but the rest of the body uses specular (or gloss). The eyes and body altogether may use the same texture, but the eyes obviously don't use glow and specular at the same time. So this means you can independently edit part of the alpha channel texture responsible for the controlling the glow of the eyes from the parts responsible for the controlling the specular of the the body.
For example, look at the stock Magnaguard model: The eyes use glow, but the rest of the body uses specular (or gloss). The eyes and body altogether may use the same texture, but the eyes obviously don't use glow and specular at the same time. So this means you can independently edit part of the alpha channel texture responsible for the controlling the glow of the eyes from the parts responsible for the controlling the specular of the the body.
- Oceans14
- Command Sergeant Major
- Posts: 296
- Joined: Mon Apr 27, 2015 7:09 pm
- Projects :: Athenova Campaign
- Location: Planet 4546b
Re: Specular not working
I decompiled the magnaguard texture to see what you're talking about. So the entirety of the alpha channel is dark gray except the eyes, which are white... and you're saying that by making the eyes white, the designers were able to designate that as glow while the grey was ignored/used as specular? Sorry if I'm not catching on, this is mostly new ground for me.
-
- Gametoast Staff
- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Specular not working
But that is just the texture. The texture/alpha channel does not specify what uses glow or specular. Rather, the model's materials do. You might want to open the Magnaguard model up in XSI (or a hex editor) to see how it is set up. You'll notice that the eyes are a separate cluster from the rest of the body. You'll also notice that the eyes use their own material with glow enabled, and the body also uses its own material but with specular enabled. Both materials use the same texture, but the UVs don't interfere with each other majorly.
Going back to the texture, you could make the entire Magnaguard's head white in the alpha channel if you wanted. But in-game, only the eyes will still be glowing, whereas the rest of the head won't be glowing, but rather just be very shiny because it still uses specular.
In case you weren't sure, white areas in the alpha channel for glow means the glow will be at its fullest strength. White areas in the alpha channel for specular also means the specular will be at its fullest strength. Black areas in the alpha channel for specular essentially "turns off" the specular, like it was never enabled in the first place. But the same is not true for black areas for glow. If you were to make the Magnaguard's eyes black in the alpha channel, the eyes would appear black in-game even if you did not change the red eyes in the main texture.
Going back to the texture, you could make the entire Magnaguard's head white in the alpha channel if you wanted. But in-game, only the eyes will still be glowing, whereas the rest of the head won't be glowing, but rather just be very shiny because it still uses specular.
In case you weren't sure, white areas in the alpha channel for glow means the glow will be at its fullest strength. White areas in the alpha channel for specular also means the specular will be at its fullest strength. Black areas in the alpha channel for specular essentially "turns off" the specular, like it was never enabled in the first place. But the same is not true for black areas for glow. If you were to make the Magnaguard's eyes black in the alpha channel, the eyes would appear black in-game even if you did not change the red eyes in the main texture.
- Oceans14
- Command Sergeant Major
- Posts: 296
- Joined: Mon Apr 27, 2015 7:09 pm
- Projects :: Athenova Campaign
- Location: Planet 4546b
Re: Specular not working
I think I understand now. It'll come down to creating clusters for my hallway model - easy enough. Thanks very much for your help AQT, I definitely had no idea what I was doing before. (Thank you as well Marth - vertex lighting is an intriguing idea, I'm going to look into it.) Solved
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Specular not working [Solved]
No problem, lemme know if you need help setting it up.