Home Technical Talk

Unreal 3 Shadows not working properly.

Hey Guys,

I noticed if I have for example a cup on a table, from a certain distance it will not show the object casting shadow unless you are right up in the object's face. Anyone know how to fix this?

Thanks!

Replies

  • 00Zero
    Options
    Offline / Send Message
    ill just copy/paste what i wrote in the unreal thread.

    those are dynamic shadows. the editor hides them once the object gets too far away from the camera.

    if you want "real" shadows you need to bake them.

    1. make sure the model you exported has 2 unwrap channels, 1 for textures and the 2nd as a unique unwrap for shadows. (if your asset doesnt have a 2nd unwrap and you cant get it because you dont have the max file to re export it or w/e then read step: "obese whale")

    2. after importing the model, double click and go into the model viewer in generic browser. there are 2 settings u need to change on the right side. one is which channel you want to bake shadows to (0 means 1, 1 means 2, etc. unreal starts with 0).

    3. put the channel on 1 and then below that set the resolution you want the shadow baked at. (its using your 2nd unwrap so...judge by that how much res you need).

    4. unreal is retarded and does this for some reason. after you place the object, select it and go into properties (f4) and on the bottom go to the staticmeshes rollout, then scroll all the way down again and there is ANOTHER static meshes rollout. inside there is bOverrideLightmapResolution or something like that. By default its checked on, you need to turn it off or else it will override your lightmap res to 0.

    5. make sure youre using static lights, not dynamic. dynamic = "U" and static uses "S". thats why youre not getting shadows, your light says U in your screenshot.

    6. repeat steps 1-4 for any object you want to recieve shadows. and then bake lighting. it will take a while, especiallly if you have any lightmap resolution over 512 and a lot of objects. save or crash and die. :)

    "obese whale". welcome to step 'obese whale'. so you lost your max file and cant re-export with 2nd uv set. no worries. open your model in generic browser model previewer. go to the first menu on the top left and then "generate UV something or another". IMPORTANT: there are 2 dropdowns for channels. leave teh first one alone, change the 2nd one to "1". since you dont have channel 1(aka 2) then it will generate one for you. it will make unique unwrap of ur model. then follow the steps as usual. its not the best way to do it since unreals auto unwrap sucks obese whale v4gina, hence obese whale, yea u were wondering weren't you?

    good luck
  • glib
    Options
    Offline / Send Message
    Also, this for a version of 00Zero that has pikatures.
  • Mazvix
    Options
    Offline / Send Message
    Thank you very much guys!

    I will give it a try.
  • 00Zero
    Options
    Offline / Send Message
    yea pikatures are alwasy good i guess. :)
  • Mazvix
    Options
    Offline / Send Message
    Sure. Here is a render AFTER it was "build all lights" as you see it is crap.

    standak3.th.jpg

    You have to move the light a tad to get it back to normal so here is this one, you compare the difference and tell me :)

    standlitcp1.th.jpg
  • 00Zero
    Options
    Offline / Send Message
    um. well. the first one you posted looks completely fine to me. i can see the shadows baked in and they look correct.

    the second one is using dynamic shadows aka realtime calculated shadows. theyre used for animated things and cost more memory.

    shadowmaps (baking shadows) is the way to go for games.

    what resolution are you using for the lightmap on that asset? is the 2nd unwrap 100% uniquely unwrapped?

    it looks normal to me. maybe that part on the left looks a bit weird which is why im asking the above questions.

    but once you move a light or mesh after you bake lighting (build lighting, or build all) then it goes back to dynamic lighting. trust me, once you have a bunch of dynamic lights in a scene the frame rate will jump through the roof.
  • commander_keen
    Options
    Offline / Send Message
    commander_keen polycounter lvl 18
    If it looks like crap it means your doing it wrong :/ Add lightmaps to the ground and adjust material specular and light brightness.
  • Mazvix
    Options
    Offline / Send Message
    If they do so in games, then great! I just think it looks flat without shadows? Also it looks like skylight in 3DS MAX which kills the specs on the objects as you see, I want to learn more so please share your wisdom :P

    Ya every object has its own light map, some people told me if it will be for portfolio bump it up to like 256/ 512. Originally I had them as 32. And yes they are uniquely unwrapped.

    I want to do my single renders for props like that (for my website) you do not want to have anything distracting on the ground, it is why I chose the color gray, unless a floor texture with a normal will make it look better? I am open to suggestions!

    "If it looks like crap it means your doing it wrong :/ Add lightmaps to the ground and adjust material specular and light brightness."

    Actually you are right if it is textured? but I am not sure how well that applies to a Grey material, you know "neutral colors" so your eyes do not get distracted.

    Just let me know what would be best for representing my stuff in UT3, and yea I notice the shadows baked but it is killing the specs on the metal pieces plus the post process.

    Thanks guys!
  • Ott
    Options
    Offline / Send Message
    Ott polycounter lvl 13
    You have to move the light a tad to get it back to normal

    Immediately after you move the light, you have broken "correct" lighting and need to rebuild all. The "correct" version of your scene is AFTER you have rebuilt. Therefore, if you rebuild all and it still looks bad, then you have to break it down and figure out what you need to do to make it look better.
  • glib
    Options
    Offline / Send Message
    The object that you're lightmapping looks very close to the same in each image. The difference in the second image is the shadow on the ground. I suspect you're adjusting the lightmapping on your table prop and expecting a change on the shadow on the ground. Is your groundplane BSP? If so, bring up the surface properties on it and lower the lightmap resolution, then rebuild your lighting again.
  • Mazvix
    Options
    Offline / Send Message
    Even when it is rebuilt, shadows will be on the objects but not on the ground as you saw, and yes it is a BSP. I doubt putting a higher lightmap resolution on a grey material would affect it, unless I am wrong?

    Yes I do understand it is built, but how can I build it and keep the postprocess plus the reflection off my metal material?

    Because it does that everytime with any of my objects/scene. I will go back and try to tweak it.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Mazvix wrote: »
    Even when it is rebuilt, shadows will be on the objects but not on the ground as you saw, and yes it is a BSP. I doubt putting a higher lightmap resolution on a grey material would affect it, unless I am wrong?

    Yes you are wrong. If you have a low resolution lightmap on a BSP surface the shadows will just become a big blur and you will lose any sort of shadow definition. If you want sharper lines in your shadows you need higher resolution shadowmaps.

    As it's a BSP surface, select it, then hit F5, and lower the number under lightmap resolution.
  • Mazvix
    Options
    Offline / Send Message
    Thanks a lot guys! well now that does make sense to fix it for everything else.

    But what about the spec? It totally disappears when you rebuild, any suggestions to show the spec with the built shadows?

    Thanks! Greatly appreciated :)
  • 00Zero
    Options
    Offline / Send Message
    thats pretty common for the spec to go away a bit after you build. just adjust it in your material editor so its more intense i guess.
  • Mazvix
    Options
    Offline / Send Message
    Appreciate it =)

    You guys have lifted a load off my shoulder, thank you very much.
Sign In or Register to comment.