Search Unity

Shadows After building to EXE

Discussion in 'Community Learning & Teaching' started by Simpso, May 4, 2015.

  1. Simpso

    Simpso

    Joined:
    Apr 20, 2015
    Posts:
    158
    Hi everyone,
    Finished the Zombie Tutorial Survival shooter today.
    Everything looks fine and exported to an EXE file . No problems.

    Noticed one glitch though. The shadows for the enemies do not seem to be casting. Anyone have any ideas how to fix this.?
    The only shadowing they have appears to be from the tips of their ears.
    I am using unity 5

    Have included an image below.

     
  2. renaissanceCoder1

    renaissanceCoder1

    Joined:
    Apr 8, 2015
    Posts:
    127
    On the Unity toolbar, go to Window -> Lighting. Then open the Lightmapping tab and make sure "Continuous Baking" is unchecked. See if that works.
     
  3. Simpso

    Simpso

    Joined:
    Apr 20, 2015
    Posts:
    158
    Thnaks for the reply.
    This is one of the first things i had to switch off due to Shadow errors causing the scene to look really dark.

    Would it make any difference if i rebake the scene as the last time i baked was before the enemies were placed in the level?
    Or is my understanding of baking well off? :)
     
  4. renaissanceCoder1

    renaissanceCoder1

    Joined:
    Apr 8, 2015
    Posts:
    127
    Wouldn't hurt to try. Although baking is typically done for static objects. The problem lies somewhere else. This only happens on the .exe - but works fine in the editor?
     
  5. Simpso

    Simpso

    Joined:
    Apr 20, 2015
    Posts:
    158
    Yeah exactly. its very strange :)
     
  6. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Sounds like a mix of quality settings removing shadows and some part of the upgrade process. First step - switch on continuous and let the scene bake. If its too dark then try tweaking the ambient settings in the Lighting panel or try increasing the intensity of the directional lights slightly til it looks how you want it to. But check Edit > Project Settings > Quality to ensure you're building to a setting that includes shadows on lights.
     
  7. Simpso

    Simpso

    Joined:
    Apr 20, 2015
    Posts:
    158
    Hi,

    Attempted your suggestions and they didnt change the outcome :(

    Just to check my build quality settings are set to Fantastic with Shadows as follows :

    Shadows - Hard and soft
    Res - High
    Projection - Stable Fit
    Distance 130
    Cascades None.

    As i said its strange because the player shadows work fine.

    Any other ideas?
     
  8. Elaha

    Elaha

    Joined:
    Jun 21, 2015
    Posts:
    3
    <Solution for errors on enemy shadows after building to EXE.>

    1. Go to Project\Materials\ and see ZombunnyMaterial.

    2. Change Shader to 'Legacy Shaders/Bumped Specular' from 'custom/Rim Lit Bumped Specular' at Inspector tab.
    (I just found that PlayerMaterial shader was legacy shaders/bumped specular.)

    3. Do it same at ZombearMaterial and HellephantMaterial.

    4. Done.
     
    Last edited: Jun 21, 2015
    peteorstrike and theANMATOR2b like this.
  9. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    That might be a good solution. The "custom rim lit bumped spec" is based on the legacy bumped spec. You could also try using the standard shader, and see how well that works out.
     
  10. peteorstrike

    peteorstrike

    Unity Technologies

    Joined:
    Oct 4, 2013
    Posts:
    116
    The custom shader I wrote in 4.6 isn't compatible with the many changes to rendering and shadows introduced since 5.0 launched, so Elaha and Adam are on the money with what's causing the lack of shadow-casting. Good catch! Hopefully we can get a 5.0 version out soon so people stop hitting weird little backwards-compatibility issues like this...
     
    theANMATOR2b likes this.