Home Technical Talk

Shading issue (smoothing groups)

polycounter lvl 13
Offline / Send Message
Wesley polycounter lvl 13
Hey guys, I'm having a problem with my smoothing groups. Here's a pretty simple mesh in Max, with everything set to 1, and then 3 polys set to 2 with a fourth on both 1 and 2 for some blending. Pretty simple stuff and looks fine in Max.

polycountShadingMax.jpg

But in Cry it looks bad.

polycountShadingCry.jpg

Any ideas what is causing this?

Replies

  • Drew++
    Options
    Offline / Send Message
    Drew++ polycounter lvl 14
    I'm not 100% sure, but it looks like it's just the way the smoothing groups are. If you view it in 3DS Max with a real-time shader with 'per-pixel' lighting, I'm sure it would look very similar to what shows up in the engine. 3DS Max lights models 'per-vertex' by default... Might have something to do with it? :P
  • |MM|
    Options
    Offline / Send Message
    Are you exporting with the official exporter?

    Seems like it doesn't export this kind of smoothing groups blending properly.
  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Huh... well I've tried the mesh with 3PointShader, Xoliul and Marmoset, all works fine. I'm using the official exporter and I've done a test with a simple mesh and I have the same problem.

    Thinking about it I don't think I've had to use this kind of blending before in CryEngine... I guess it doesn't support it? That seems super weird...
  • |MM|
    Options
    Offline / Send Message
    I does, I exported a mesh from 3ds Max with the FBX exporter and it works, anyway there's nothing not to be supported since smoothing groups just create hard edges.

    The only problem might be with the original exporter, but I don't have acces to it.
  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Oh, it must be the CryEngine exporter then? I've checked the settings and I can't see anything related to smoothing groups. I'll use the FBX exporter then! Never used that for CryEngine, I assume I don't have to do anything too special?
  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Ah, there's a thread about FBX support in Cry right below this. :poly136:
  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Okay so it's much better, but still not correct.

    polycountShadingCryFBX.jpg
  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Okay so I decided to get around it by just using one smoothing group and add some extra loops to control it better.

    polycountShadingCryOneGroup.jpg
  • Olli.
    Options
    Offline / Send Message
    Olli. polycounter lvl 8
    cryengine doesnt really have any smoothing groups at all. Everything is rendered under a single smoothing group.

    When you export the mesh, the exporter splits all the hard edges in to 2 edges, so the mesh is physically in two pieces (albeit perfectly aligned).
  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Did not see this reply! Thanks very much for clearing this up, Olli.
  • choco
    Options
    Offline / Send Message
    choco polycounter lvl 10
    Olli. wrote: »
    cryengine doesnt really have any smoothing groups at all. Everything is rendered under a single smoothing group.

    When you export the mesh, the exporter splits all the hard edges in to 2 edges, so the mesh is physically in two pieces (albeit perfectly aligned).

    It does support smoothing group (hard edges) or at least in maya I'm sure it does.
  • Olli.
    Options
    Offline / Send Message
    Olli. polycounter lvl 8
    the engine only has uses 1 smoothing group like I said.
    hard edges are physically split (which also breaks the smoothing, creating a hard edge)
  • choco
    Options
    Offline / Send Message
    choco polycounter lvl 10
    You probably want to check this thread then, it demonstrates that CE3 supports smoothing groups.
    http://www.polycount.com/forum/showthread.php?t=105067

    On crydev wiki if you search for smoothing groups you'll find multiple documents implying that multi-smoothing groups are supported :
    example :
    • Try to match the smoothing groups/material splits/UV borders with each other. Every time material splits/smoothing-group splits/UV border-splits share the same edge, vertices will split only once and the tri count won't be affected as much as it is when having splits in different places.
    • Again, always use as few smoothing groups/material IDs/UV borders as possible.
    Vertex normals need to be split where polys with different smoothing groups(hard edges) meet - keep the number of smoothing groups and hard edges low.
  • |MM|
    Options
    Offline / Send Message
    You're both right in a way, smoothing groups or hard edges are just split vertex normals or split vertices.

    Now, for displaying the mesh in doesn't really matter since it gives the same result,
    but if the mesh is actually split it may produce some problems.

    Eg. take any mesh with smoothing groups into CE3 and apply vertex deformation to it, there'll be gaps wherever the splits are.

    UDK doesn't seem to suffer from that (I tested a mesh with a material with worldposoffset to it), I guess it's a matter of when the splitting
    occurs.
Sign In or Register to comment.