1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UE3 - UT3 Trouble with pixelization caused by self-shadowing on character

Discussion in 'Modeling & Skinning' started by providen, May 24, 2009.

  1. providen

    providen New Member

    Joined:
    May 24, 2009
    Messages:
    3
    Likes Received:
    0
    Hi, sorry if noob question. My trouble is that when I turn on CastShadows / bCastDynamicShadow in SkeletalMeshComponent of SkeletalMeshActor, this ugly self-shadowing problem happens. The problem is less prominent in a well-lit level, but it's still not acceptable.

    Ideally I would like the SkeletalMeshActor to have no self-shadowing (cuz those shader effects are really cool as they are), but to cast a sharp shadow (I don't want many lights in the scene - like in the first two pics) on everything else. If that's not possible (or in any case) how can I make that self-shadow smoother?

    Thank you.
     

    Attached Files:

    Last edited: May 24, 2009
  2. Anuxinamoon

    Anuxinamoon New Member

    Joined:
    Feb 4, 2009
    Messages:
    18
    Likes Received:
    0
    Is your light set to force dynamic lighting and its lighting channel set to the same as your model? (usually dynamic) It helps to add a low light sky light in there aswell.

    Also the pixels you are seeing is the wonderful way UE3 compresses its Normal maps. It doesn't swizzle them for a more better cleaner compression, which is why you get big blocks appearing on the self shadows. its the way the engine does it and you cant change it. Its trademark ue3.

    Remember, when you are making a model, its minimum distance away from the camera when you play the game. No point worrying about a freckle or funny pixel shading when if you view it at games distance it looks fine. (like 4 metres away)
    Like people who add detail to shoelaces for background NPC's that stand behind a box the entire time. *facepalm*
     
    Last edited: May 24, 2009
  3. providen

    providen New Member

    Joined:
    May 24, 2009
    Messages:
    3
    Likes Received:
    0
    This is not for a game but for a real-time demo. Camera distance should be centimetres from the face, and it's the whole point.

    There's no normal map used in the face shader. What gives?

    The face shader is a MI based off M_CH_All_Base_02, it only has a diffuse source and the LODGroup of that I set to TEXTUREGROUP_Skybox. Another MIs I made based off M_MasterFaceFxNoMask (like Jester_FaceFX) are handling this issue better, but not quite perfectly. And no, I cannot use M_MasterFaceFxNoMask for this face. I'll try to post more shots of those other MIs later.

    And I'll try your suggestion with the lights, thanks, although I already did play with those settings to not much avail.
     
    Last edited: May 24, 2009
  4. [SAS]Solid Snake

    [SAS]Solid Snake New Member

    Joined:
    Jun 7, 2002
    Messages:
    2,633
    Likes Received:
    0
    This is actually more of a problem with the shadow map generation. Try switching the light shadow map to VSM instead of PCF, as PCF has this problem when generating shallow shadows.
     
  5. Dogger

    Dogger New Member

    Joined:
    Oct 4, 2004
    Messages:
    122
    Likes Received:
    0
    The compression is god aweful in UE3, The souce engines VMT compression is way more effective as it has multiple choices, like no filtering on normal maps.
     
  6. [SAS]Solid Snake

    [SAS]Solid Snake New Member

    Joined:
    Jun 7, 2002
    Messages:
    2,633
    Likes Received:
    0
    The compression is just DXT in UE3. Make sure you choose the correct LOD settings, and it is also possible to not have any compression at all on normal maps. A swizzle option would help as well, but that may be something Epic implemented later on.

    And again, I believe this problem has nothing to do with texture compression, I believe it has more to do with shadow map generation via PCF as PCF tends to create shadow acne at shallow angles, which is presented here and many other UE3 games.
     
    Last edited: May 25, 2009
  7. Anuxinamoon

    Anuxinamoon New Member

    Joined:
    Feb 4, 2009
    Messages:
    18
    Likes Received:
    0
    Actually you are right solid snake. I remember the shader programmer talking about this one day with my lead. I can't remember the whole thing but it was code related. :)

    I will have to try this VSM switch, sounds like a winner :D
     
  8. providen

    providen New Member

    Joined:
    May 24, 2009
    Messages:
    3
    Likes Received:
    0
    Thank you, that sounds like solid advice....

    Edit: pun absolutely not intended, but how appropriate!

    EDIT2: When I switch ShadowProjectionTechnique to VSM, it autoswitches back to ShadowProjTech_Default. When I rebuild,
    nothing happens, as I guess default is PCF. I tried BPCF_High as well, which does not switch back to Default, but did not improve anything either. How do I disable this autoswitching?

    What LOD do you mean? The mesh has no LOD, it has about 64000 triangles, so I was hoping for some good visuals. The material only uses one 2K texture for the diffuse channel, the LODGroup of this texture is TEXTUREGROUP_Skybox (I think that's the highest).

    EDIT3:
    I have found these settings:
    bEnableVSMShadows
    bEnableBranchingPCFShadows

    Both are in [Engine.Engine], [Engine.GameEngine], and [UTEditor.UTUnrealEdEngine]
    Set all to true to no avail. The editor still autoswitches ShadowProjectionTechnique from VSM to Default. BPCF_High results still
    not any better.

    I also wish I knew better which of [Engine.Engine] and [Engine.GameEngine] overrides which and when.

    I have found ShadowFilterQualityBias, MinShadowResolution and MaxShadowResolution in [SystemSettings], set them to 0, 512 and 2048 to not much avail either.

    I have found that TEXTUREGROUP LOD settigs can be tweaked in [SystemSettings], so I have changed my texture's LOD group to TEXTUREGROUP_UI and set TEXTUREGROUP_UI=(MinLODSize=2048,MaxLODSize=4096,LODBias=0).
    It didn't make any difference. I guess if the camera is so close to the actor, the highest LOD is used anyway.

    I think at this point I'd rather implement what I had in UT2004 for "realtime shadow" - a render-to-texture dynamic projector attached to the skeletal mesh. I only need the shadow on the floor anyway and the shader already creates the feeling of volume
    and plasticity on the face. Can somebody say from the top of your head if there's a similar mechnism already implemented in UT3?
    If not, I don't see any dynamic projectors in UT3 source, what have they been replaced with, decal actor?
     
    Last edited: May 26, 2009
  9. [SAS]Solid Snake

    [SAS]Solid Snake New Member

    Joined:
    Jun 7, 2002
    Messages:
    2,633
    Likes Received:
    0
    You can adjust the LOD settings for the texture itself. There should be a few options regarding which LOD you wish to have. Do this by double clicking on the texture itself within the Generic Browser. You can also have uncompressed textures, but this will use more video ram.

    It's entirely possible that the version of Unreal Engine 3 shipped with UT3 may not even have a VSM shadowing all as I had a more recent version of UE3. I'll check when I get back on my development machine.

    Projectors have now been replaced with a light functions.

    Render to textures aren't cheap in Unreal Engine 3 as compared to Unreal Engine 2, and I am unsure if there is a specific shadow to texture function within Unreal Engine 3.
     

Share This Page