Announcement

Collapse
No announcement yet.

UE4 still does not have any proper way to do tinted glass

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

  • replied
    Originally posted by NotSoAccurateNo1 View Post
    what's wrong with doing it this way
    https://youtu.be/XRwFh6s5wqE
    Because you do not want to edit opacity. In the context, opacity should be 1. But unreal ties opacity and accumulated distortion, which renders you unable to have any meaningful shading on objects with transmission.


    In any case, what OP is asking is largely impractical, as to get it working, you would need to accumulate tint color from all refractive objects, the same way, distortion is accumulated, which is phat.
    Gotta settle on using scene color to emissive.

    Leave a comment:


  • replied
    what's wrong with doing it this way
    https://youtu.be/XRwFh6s5wqE

    Leave a comment:


  • replied
    Originally posted by amoser View Post

    So, it would certainly be cool if there was a more streamlined approach, but this seems a bit like an extreme overreaction on several dimensions.



    There won't be Z fighting, since (as you noted below) translucent materials aren't even sorted via a Z buffer (and also there are plenty of built-in features, like PDO or the camera offset node, that can prevent Z fighting from even being a problem in the first place).

    And drawing geometry multiple times per frame is already an inherent part of the deferred renderer, so this is hardly something that will have a significant effect on performance. I can't see how having a "proper" way of doing this probably would actually make a difference.



    What part of this is "unrealistic"? It's just a question of duplicating all faces with a particular material; I think almost all modeling packages can easily be scripted to do this automatically on export.


    But is this solution really that bad? I can understand how having a dedicated shading model for this might feel "cleaner," but I'm not convinced that it would be significant in practice.

    More importantly, there are plenty of translucent effects that the engine can't do at all, so I'd be surprised if Epic wanted to prioritize something that can already be accomplished in a way that is, frankly, not that unpleasant. It's a "workaround," for sure, but then again, so is deferred rendering itself.



    I'm vaguely terrified to know in what situation 500 if statements could possibly do the same thing as a cast.
    Do I really, seriously need to explain why creating unique, separate complex geometry with two separate materials is a worse solution than adhering to the PBR standard where base color defines transmission color for transmissive materials?

    https://youtu.be/DO7zkJRWNgs

    I do get that not everyone needs to be effective at what they do, but I do. I can't afford to spend exceptional amounts of time to achieve mediocre things.

    Let's say I need to do following: A car has windows and tail lights. Windows need to be dark green tinted glass and tail lights need to be red tinted glass.

    Normal, acceptable workflow:
    1. Create window material by creating Lit Translucency material with translucency tinted to green
    2. Create tail light material by creating Lit Translucency material with translucency tinted to red
    3. Apply window material to car window
    4. Apply tail light material to car tail lights

    Current workflow:
    1. Get back to your DCC, assuming you are lucky enough it's your model and not a bought/received asset
    2. Spend time selecting all the window geometry
    3. Duplicate it
    4. Offset it
    5. Assign it new material ID
    6. Spend time selecting all the tail light geometry
    7. Duplicate it
    8. Offset it
    9. Spend more time dealing with the mesh self intersections induced by offseting mesh of complex curvature along the face normals
    10. Assign it a new material ID
    11. Bring the asset back
    12. Notice you are no longer able to take advantage of automatic LOD generation as decimation of 2 thinly neighbouring surface is imperfect so tint layer sometimes clips into the glass layer
    13. Create glass material by creating Lit Translucency material
    14. Create green tint material by creating green modulate material
    15. Create red tint material by creating red modulate material
    16. Assign glass material to glass pieces
    17. Assign red tint material to inner tail light layer
    18. Assign green tint material to inner window layer

    I can't comprehend what's in it for you to defend clearly inferior and ineffective workflow. Why would you advocate for not improving the engine? There is absolutely no benefit in treating one, solid glass medium as two separate objects. It has tons of downsides and corner case issues with literally 0 benefits.

    Leave a comment:


  • replied
    Originally posted by Rawalanche View Post
    I've seen that, they are using a ridiculous workaround of having two separate glass meshes, one for the non tinted translucent material and one behind it for tint based on modulate shader. That will work in a context of something like one-trick pony VFX shot, but it's unacceptable solution for any game stuff.
    So, it would certainly be cool if there was a more streamlined approach, but this seems a bit like an extreme overreaction on several dimensions.

    Originally posted by Rawalanche View Post
    You can't double the amount of your meshes and have the so close they will most likely cause Z fighting at distance just to pull off a tinted glass shader.
    There won't be Z fighting, since (as you noted below) translucent materials aren't even sorted via a Z buffer (and also there are plenty of built-in features, like PDO or the camera offset node, that can prevent Z fighting from even being a problem in the first place).

    And drawing geometry multiple times per frame is already an inherent part of the deferred renderer, so this is hardly something that will have a significant effect on performance. I can't see how having a "proper" way of doing this probably would actually make a difference.

    Originally posted by Rawalanche View Post
    You also can't have artists having to create inner modulate material mesh for all the meshes that could possibly have some transparent glass. It's just not realistic. If anything it shows what a painful route had The Mill artists go to even finish the project.
    What part of this is "unrealistic"? It's just a question of duplicating all faces with a particular material; I think almost all modeling packages can easily be scripted to do this automatically on export.
    Originally posted by Rawalanche View Post
    It's not just about having a solution, its about having a good solution.
    But is this solution really that bad? I can understand how having a dedicated shading model for this might feel "cleaner," but I'm not convinced that it would be significant in practice.

    More importantly, there are plenty of translucent effects that the engine can't do at all, so I'd be surprised if Epic wanted to prioritize something that can already be accomplished in a way that is, frankly, not that unpleasant. It's a "workaround," for sure, but then again, so is deferred rendering itself.

    Originally posted by Rawalanche View Post
    Sure, if you have 500 classes in your project, you could have blueprint with 500 if statements to check if it's the class you are looking for, or you could do a single cast. Both are solution to the problem, but one is acceptable while other one is not.
    I'm vaguely terrified to know in what situation 500 if statements could possibly do the same thing as a cast.

    Leave a comment:


  • replied
    Originally posted by MostHost LA View Post
    It's not a work-around, it's how it works, and it absolutely works in game without any z-fighting.
    It also makes 100% sense to have different layers. it's exactly the same as you would for reflectors.
    Not at all... It just doesn't make sense. I mean really? Having inner shell for every possible small glass part of a vehicle that's supposed to have tinted glass? Workarounds are not a solution. Solution is simple, having a shading mode which can do tinted glass. There's absolutely nothing preventing that in realtime graphics.

    It's not just about having a solution, its about having a good solution. Everyone can come up with some sort of solution sooner or later, but not every solution should be implemented, if it means complicating the process.

    Sure, if you have 500 classes in your project, you could have blueprint with 500 if statements to check if it's the class you are looking for, or you could do a single cast. Both are solution to the problem, but one is acceptable while other one is not.
    Last edited by Rawalanche; 10-10-2019, 03:53 AM.

    Leave a comment:


  • replied
    It's not a work-around, it's how it works, and it absolutely works in game without any z-fighting.
    It also makes 100% sense to have different layers. it's exactly the same as you would for reflectors.

    Leave a comment:


  • replied
    Originally posted by MostHost LA View Post
    Not sure about ray tracing, but tinted glass is one of the few things that really look best in unreal.
    Check out this stuff.
    https://www.unrealengine.com/en-US/t...-unreal-engine
    I've seen that, they are using a ridiculous workaround of having two separate glass meshes, one for the non tinted translucent material and one behind it for tint based on modulate shader. That will work in a context of something like one-trick pony VFX shot, but it's unacceptable solution for any game stuff. You can't double the amount of your meshes and have the so close they will most likely cause Z fighting at distance just to pull off a tinted glass shader.

    You also can't have artists having to create inner modulate material mesh for all the meshes that could possibly have some transparent glass. It's just not realistic. If anything it shows what a painful route had The Mill artists go to even finish the project.

    They in fact had to use 4!!! faces in the end for each glass surface, because double sided translucent materials in UE4 aren't even capable of proper depth sorting.
    Last edited by Rawalanche; 10-09-2019, 06:09 AM.

    Leave a comment:


  • replied
    Not sure about ray tracing, but tinted glass is one of the few things that really look best in unreal.
    Check out this stuff.
    https://www.unrealengine.com/en-US/t...-unreal-engine

    Leave a comment:


  • UE4 still does not have any proper way to do tinted glass

    Hi,

    so for ages, UE4 did not have any proper way of making tinted glass. There was an ugly workaround of using SceneColor node in the emission slot, however this has issue of ignoring all the translucent materials behind it, so it's usable only in some cases. On top of that, SceneColor is ignored when RayTracing is enabled, which makes it impossible to create tinted glass with RayTracing.

    Am I missing something or:
    1. There is really no way to make tinted glass which doesn't ignore other translucent objects behind it.
    2. There is really no way to make tinted glass which works with Ray Tracing?

    What we really need is a modulate blend mode which supports Lit Surface TranslucencyVolume.

    Thanks in advance.
    Last edited by Rawalanche; 10-09-2019, 04:01 AM.
Working...
X