Announcement

Collapse
No announcement yet.

Mesh Rotation Breaks Specular

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Bump bump. Also, I may have found a workaround. I'm working on it anyway. Not this issue exactly, but a similar issue caused by the same problem: http://www.polycount.com/forum/showthread.php?t=102900. I've tried everything in there and in other places, and my mesh that makes use of rotated and flipped UVs still has ugly broken normals.

    But like I said, I think I'm onto a workaround. For now, here's something you can try at home. If you get it working before I do, let me know.

    Take your diffuse texture. Hook it up to a World->Tangent Vector Transform. Plug the Transform straight into diffuse. If any of the faces have flipped or rotated UVs, they will show up as bright solid colors. Red (1,0,0), Green (0,1,0), and Yellow (1,1,0) are what I'm getting. I'm going to try using those colors as a mask. I'm still trying to figure out if there's anything I can plug in to make it work. I'll let you know if I come up with anything.

    Leave a comment:


  • replied
    (Edit: sorry for the huge images)

    I'm in the same position, and I just recently did some tests of my own.

    In short you cant' rotate assets, objects, or UV's without getting shading/baking errors...

    I've done some simple tests just to see what happens. None of these uses any normalmaps and it's all flat surfaces (boxes and planes). The material is a standard UDK phong with a grey color and white specular. The specular power is set at 50.



    This is what happens when the same box is rotated inside UDK. You can see that there's errors to the dynamic specular as well as the baked lights and the lightmap specular.



    In this case the box was rotated 180 degrees before export. So the scene contains 2 separate assets, none of them have been rotated inside UDK. The dynamic specular looks accurate but the baked light and spec still looks terrible.



    Here all squares are part of the same mesh, but the faces have separate UV-shells where haf of them have been rotated 180 degrees. The lightmap UV's are still just a planar projection with no seams. The dynamic specular holds up but the baked light and specular breaks.

    It has been suggested to solve this problem by swapping the UV-sets for lightmap and diffuse, since the tangent i calculated based on UV0. But if you introduce a normal map to the material you can see that it's not a viable option since it will then mess up your tangents compared to the normalmap.



    Now this is the most simple case I could find. The problem only increases if you have a more complex object. UV seams become very visible between rotated shells. Even just slightly rotated UV's create shading errors, not to mention mirrored UV's which are even worse.

    At this point the only "solution" available seems to be to hide the errors in excessive normalmap detail, grungy textures, noisy specular maps and always model your assets with some sort of natural seam along the border. Or just don't put rotated objects too close to each other so that the error becomes less obvious...

    I am either missing some super important setting somewhere, or this is just really broken...

    Leave a comment:


  • replied
    Thanks for the bump!

    The best "solution" I've found is to just turn off lightmap speculars completely. I noticed while taking a close look around the levels in Bioshock Infinite that the majority of the surfaces seem to only reflect speculars from dynamic light sources and not from the baked lightmaps. I'm guessing that for their main sources of light they used toggleable lights to get the direct light and specular to be calculated in real time with the shadows and indirect lighting being baked. They then used regular completely baked light sources for any other additional lighting. I'm not sure if this is a viable solution in UDK to have all those toggleable lights in a level or if Irrational Games had to implement their own lighting system to get this work.

    As a side note, it seems that the problem also occurs based on uv rotation. The rotation of the model has to coincide with the rotation of its uv island for the specular to be calculated corrected. Using my previous post as an example; if instead of rotating the actual model 90 degrees to break the specular, I instead just rotate its uv island 90 degrees, the specular breaks in the same fashion.

    I might be wrong, but I think this also explains that old mirrored uv specular seam problem that all unreal engine games have. One half of the uv is rotated correctly so the specular is fine, but the other half which is mirrored is technically reversed on the uv compared to the model orientation so the specular is reversed.

    Just some more food for thought.

    Leave a comment:


  • replied
    I would love to see an answer for this Having the same issues.

    Leave a comment:


  • started a topic Mesh Rotation Breaks Specular

    Mesh Rotation Breaks Specular

    Basically whenever a mesh is rotated, its light map specular breaks.
    The problem is clearly apparent with modular assets because of the sudden break in the highlight, but this problem occurs on every single model that gets rotated within the Unreal Engine.


    Modular floor tile mesh, imported into UDK and duplicated to create a floor. None of the meshes have been rotated from their original import position. Single point light above, lighting baked. Specular highlight is perfect.


    Same exact set up, but only the middle floor tile mesh has been rotated around 180 degrees and lighting rebaked. Specular is broken on that one tile.


    Extremely simple mesh and material for ease of recreation and to isolate the problem.

    I've been digging through a ton of threads both on here and polycount.com with people running into the same issue and never being able to find a reasonable solution.

    http://www.polycount.com/forum/showthread.php?t=89000
    http://www.polycount.com/forum/showthread.php?t=98050
    http://www.polycount.com/forum/showthread.php?t=94585

    Polycount member Snight had some valuable information about this from that last thread

    "I believe (if I can remember correctly) that this is intended by Epic. You have to remember that unless using fully dynamic lights you don't have real time specularity. From what I understand, UDK uses a light vector with 3 channels. If they had used 4 channels instead of 3 this problem wouldn't exist. I believe it was too costly. This is the same reason why you can't flip UVs on the vertical axis for meshes with mirrored geometry."

    "What happens is when you generate static lighting it picks 3 vectors from the surface (somewhat randomly) and computes the lighting intensity from each with what is generally the strongest light effecting the mesh. (it's more complex than this, but this is artist friendly). That generates the lightmap texture that DOESN'T include specular data. Specularity is calculated at runtime using all 3 vectors. Those vectors are based on the model's space, so if you rotate the model the vectors rotate. This means that rotated meshes compute specularity differently."

    It sounds like this problem is occurring due to some optimizations Epic took, I suppose to keep down light map texture sizes down. However the trade off has become broken speculars on the majority of your assets.

    Any solution or official word from Epic would be great.

    Thanks guys!
Working...
X