Home Technical Talk

Max Viewport lighting issue

Hey all,

Having a weird Max lighting issue in the viewport. I'm using 2011 Design, and have been doing a lot of pre-rendered Architectural stuff recently, including messing with linear workflow and gamma adjustments so the likelihood I've switched something on/off and screwed something up is high. Problem is, I have no idea what I've done to make this happen.

I'll try explaining it and add some screenshots.

Basically, it looks like I've got hardware shading enabled regardless of whether it actually is. Even with no lights in the scene, I get horribly harsh light/shadows. This is on both standard Max shaders and most noticeably on DX shaders.

Any ideas?

Feel free to ask for more info if I haveb't explained this well enough!

MaxLightingIssue1.jpg

MaxLightingIssue2.jpg

Replies

  • cw
    Offline / Send Message
    cw polycounter lvl 17
    I think the key thing to draw from your data there is that DirectX Shader != Standard Max Shader.

    When you say directx Shader, what do you mean?

    It appears to me that your Directx shader has a specular term which is absent or largely reduced in your standard shader (hardware shading or no), but without more details I cannot speculate further.

    Good luck!
  • Tom Ellis
    Cheers for the reply CW!

    The DX shader is just a realtime shader, Xoliuls in this case but I don't think it's related to the shader since as you noted, the problem is evident with the standard Max shader too.

    The problem is those super harsh shadows, almost like I've set viewport lighting on with hardware shading and aimed a spotlight straight at the mesh, but there's no lights in that screenshot above, just default lights and hardware shading switched off.

    I'm sure I've messed with a setting somewhere. I've gone back and reset my Gamma / LUT settings and while that makes things a little dimmer, it doesn't fix it at all.
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    default light means there will usually be a light at the camera position, not 0 lights in the scene. What happens if you turn off default lights and there are 0 lights in the scene, both should ouptut black spheres if I unerstand correctly?
  • Tom Ellis
    Do you mean turn off default lighting in the viewport shading options? If so, I can't, I can only choose scene lights or default lights.
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    If you set to scene lights, then add an omni with strength of 0.0 it will do this.
  • Tom Ellis
    Setting an omni to 0 with scene lights selected does indeed show black meshes.

    Ok here's another screenshot, default lighting, no lights in scene. Surely this isn't normal? I haven't got access to any other versions of Max so I can't check, but it doesn't look right to me.

    MaxLightingIssue3.jpg
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    So is your default lighting set to 2 lights or something? Have a look in viewport configuration->lighting and shadows.

    by the way, I forgot to add - I get exactly the same thing if I set to default lighting, 2 lights. There is a key light and a back light. Switching hardware shading on and off changes nothing except the lighting being per vertex in software and per pixel in hardware.

    Good luck! (out of interest what are you expecting to see differently?)
  • Tom Ellis
    Ah it was set to 2 lights, switching to 1 seems to make it a lot better. Possibly back to normal. The shadows still look a bit dark but that could just be me imagining it.

    Thanks cw!
  • equil
    i don't use max so I can't give you a definite answer but it looks like the directX shader is gamma corrected.
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    equil wrote: »
    i don't use max so I can't give you a definite answer but it looks like the directX shader is gamma corrected.

    I am curious, what leads you to this conclusion?
  • equil
    spherecompare.png

    the harsher falloff.
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    equil wrote: »
    spherecompare.png

    the harsher falloff.

    good spot. With 3dsmax gamma correction off, using max hardware shading and xoliul 1.5 shader, the spheres are identical. Ditto with max gamma correction turned on, the spheres are identical, with the harsher falloff. You shouldn't get both in the same scene though unless your shader has its own gamma correction?
  • Tom Ellis
    Thanks guys, yeah I've definitely screwed up some settings in Max somewhere. As I mentioned in the OP, I'd been messing with linear workflow and gamma settings for some Arch-Viz stuff and as I didn't really know what I was doing, I ended up just hitting switches so to speak and forgetting how to default them.

    Also, despite my best efforts, Max seems to have concealed its default config files in some super secret location on my HDD, even after deleting the Max.ini, I still got the 2 scene lights by default, and the gamma setup was changed.

    Fortunately I'm in the AD student program so I can just switch over to Max 2011, as opposed to Design 2011, and with a clean install, all should be well.
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 14
    Hey dude ... uhm... it's completely normal. I added Gamma correction into my shader with the latest version, you can just disable it by setting the gamma correction value to 1 instead of 2.2.

    Btw, how strange that you seemed to think Hardware shading has anything to do with it, there is no difference in visuals between both of your images, so i would expect you to realize the setting doesn't matter ;) Hardware shading only really matters for shadows when you work with a DX shader.
  • Tom Ellis
    Thanks Xoliul.

    Yeah looking back at my OP, I've no idea what I was thinking. I think what I meant to say was that regardless of whether I had any lights in my scene, or what shader I was using, everything looked blown out like I had a intense light in the scene and had hardware shading enabled to display the shadows.

    So if your shader has gamma already set at 2.2, presumably I'd want to switch it down to 1 if I'm using 2.2 in Max, or alternatively switch Max back to 1 and leave yours at 2.2?
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 14
    The Max Gamma settings should not be used with shaders, as they do the correction on the entire image (bad, maps get corrected too), instead of just correcting the lighting calculations (like the in-shader correction).
  • Tom Ellis
    Ok, I've figured out my whole reasoning for thinking there was a problem, and I'd completely over-confused myself when the issue was quite simple, and quite different to what I originally thought. It has nothing to do with gamma, or hardware shading, as Xoliul pointed out... I just thought it did since that was the only thing I could remember messing with.

    The problem is, Max is defaulting to 2 default lights, rather than 1 (which I'm sure is the normal default right?).

    So when I fire up Xoliuls shader, and my VP lighting is set to two default lights I get this:

    MaxProblem2Lights.jpg

    But when I switch to 1 default light, I get this (the correct result):

    MaxProblem1Lights.jpg

    I'm not quite sure why it looks darker with 2 lights, if I up the number of lights in the shader, I just get a brighter version of image 1, still with the dark back.

    So now I'd like to set Max to default back to 1 default light, but I can't work out how to get that to be default, every time I open a new scene/open Max, it sets itself to 2 default lights.
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 14
    The 2 light default thing is in the viewport configuration. Possible that you've set this in your maxstart.max file ?
  • Tom Ellis
    Yeah it's definitely defaulting to 2 lights, is there a way to set it back to 1?

    I've had a look at my MaxStart file, but I can't find which bit refers to default lights.
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 14
    Oh sorry, I thought you knew where to find this.
    Hit the [+] in the top right of a viewport, then pick Configuration.
    Go to the Lighting & Shadows tab, the top left part that says "Illuminate Scene with:" contains the setting.

    You know, I always tell my students not to mess with settings they don't understand yet, so they don't freak out later and need me to fix it for them ;)
    (haha just kidding man)
  • Tom Ellis
    Lol, yeah I really shouldn't mess with this stuff.

    I know how to switch the viewport lighting but I don't know how to save it. Should it save configs automatically? On startup/new scene, it's set to 2 default lights, so I switch to one, but then it'll revert to 2 again on reopening Max or starting a new scene.
  • SpeCter
    Offline / Send Message
    SpeCter polycounter lvl 14
    Make your changes, save the scene as maxstart.max in max´s default folder and you are ready to go.
  • Tom Ellis
  • [HP]
    Offline / Send Message
    [HP] polycounter lvl 13
    SpeCter wrote: »
    Make your changes, save the scene as maxstart.max in max´s default folder and you are ready to go.

    This is amazing, i had no idea we could do this.

    Thanks
Sign In or Register to comment.