Results 1 to 27 of 27
  1. #1
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    69

    Default Realistic Glass Materials in UDK



    a while ago i made an interactive bathroom visualization, which can be found here : http://forums.epicgames.com/showthread.php?t=774897

    since then i received several requests to make a tutorial. so here it is - im gonna cover the various glass materials i made in this scene.

    lets start then :
    the most important thing to learn in CG (and UDK for that matter) is studying reference, understanding how materials look and behave in real world and trying to replicate it in CG world.

    Window glass material :


    im gonna start with the easiest one which is the window glass.
    its a pretty straight forward material. basically its just a transparent plane with fresnel reflection on it. but from carefully observing this material in real world, you can see that due to the multiple glass planes in today's windows, there seem to be multiple reflections visible. also the glass plane is not a perfectly smooth surface so the world refracting behind it seems to be very subtly distorted. so why not recreate this in udk ?


    -this is how the shader network looks. for the window glass i used only one mesh, so to imitate the multiple glass look, i duplicated the reflection, and faked the duplicate with bump offset node - so it looks shifted from the first one.


    Solid Glass Shader :


    this material is made out of a single cubemap. one neat trick you can do with cubemaps is. that it can be used not only for reflections, but it can also create a very neat and realistic refraction.


    all you need to do is swap the textures in the cubemap - as seen above. this will result in a flipped reflection - that will give the illusion of transparent material refracting the world behind it


    after that, you'll just stack the cubemaps over. thats about it. i also made the glass just a bit transparent to make an illusion of light wrapping around the material.
    this method can be used for solid material like this, or a water in a glass or bottle and so on.

    im not sure how long a single post can be, so ill continue in the next post
    Last edited by bukkit; 05-03-2011 at 01:33 PM.

  2. #2
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    69

    Default

    Arch Glass material


    there are few things you'll need to obey to create a realistic looking glass tank, table, or anything more complex made of glass.

    again as usual, important thing is to check reference from the real world

    what do we see. the glass is refracting the world behind it, its reflecting more when looked at from an angle, than looking directly at it. the opacity is similar. looking directly at it, it seems more transparent than looking from an angle. also notice, the edges of the taple on the photo , you cant see through them at all. so this is something were gonna recreate.


    i made the tank out of two meshes. one for the glass part , and one for the darken edges, to simulate that particular real world behavior


    this is the shader for the glass, its made of two masked out realtime reflections. and one fake cubemap reflection with invert mask , so those two types of reflections wont interfere with one another
    the reflections are then tinted with that dark aquamarine green color.

    the opacity is made out of two fresnel nodes, for a smooth and also a sharp transition.

    the distortion is imho basic with a huge amount of control for the user, who can edit the distortion on the area direct to camera, and also away from camera. and also the fresnel node for the distortion transition


    the dark edge material is pretty basic. here i used the same trick with cubemap refraction as in the glass spheres material.

    a problem with the material setup like this is the distortion.... it is distorting not only object behind it but also objects in front of it , which can look wery strange.

    luckily you can use a simple trick to fix this. the problems only occur with opaque materials. so you can switch them to an translucent material with wery high opacity (something like 0.995) to remove the artifacts


  3. #3
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    69

    Default

    working on this scene, i noticed a problem with using cubemaps in interior. they just dont fit properly, which is imho something that has something to do with the fact that the reflection is comming from infinity.

    i saw a solution to this problem made in Blender Game Engine.
    http://www.gamedev.net/topic/568829-...nment-mapping/
    it would be awesome if somebody would be able to recreate this approach in udk. i wasnt able to unfortunately (it was too complicated for noob like me)

    so i come up with a noob method to have at least some control over your cubemaps. its a bit tedious, requires many trials and errors, but its better than nothing.


    if you setup the cubemap like seen here. you can adjust the size of the reflected map ,and also its X Y Z position.

    so i guess this is all from me. hope i was somewhat helpful. and i also thank you for your attention.

    any comments or questions are of course welcome

  4. #4
    Marrow Fiend
    Join Date
    Jul 2006
    Location
    UT40k
    Posts
    4,184

    Default

    awesome work there, just one question, could you do a tutorial for a Stained Glass Window like you see in Churches or like when the kids paint pictures on thier windows
    UT40K:The Chosen - Warhammer 40,000 for UDK
    ut40kgeodav - UT3 Tutorials - Characters - Weapons - Vehicles - FaceFX
    UDK Tutorials - Basics - Vehicles - Characters - Weapons

  5. #5
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    69

    Default

    http://udn.epicgames.com/Three/Light...cent%20shadows.
    never done that, but i would start from here.

  6. #6
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Posts
    105

    Default

    awesome thanks for sharing great stuff

  7. #7

    Default

    Wow, that´s really good.
    Thank you very much

  8. #8
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Denver, CO
    Posts
    410
    Gamer IDs

    Gamertag: K0par

    Default

    Wow, great tutorial. Some really well thought out solutions and attention to detail! Thank you so much!

  9. #9
    MSgt. Shooter Person
    Join Date
    Dec 2010
    Location
    Planet Earth
    Posts
    97

    Default

    wow, this is fantastic !!!. Thanks dude!
    Phoenix Artist

    Fuel up your games with affordable quality assets:-
    Section 1
    Section 2

  10. #10
    MSgt. Shooter Person
    Join Date
    Apr 2009
    Posts
    126

    Default

    Quote Originally Posted by bukkit View Post
    Arch Glass material
    a problem with the material setup like this is the distortion.... it is distorting not only object behind it but also objects in front of it , which can look wery strange.
    I found that ticking "Use One Layer Distortion" in the translucency tab of the material also solves this problem but obviously will limits you to one layer distortions.

  11. #11
    MSgt. Shooter Person
    Join Date
    Sep 2010
    Location
    Mitten Island, USA
    Posts
    318

    Default

    very nice, three thumbs up!
    Resources:
    >[Reference] iOS Hardware Technical Specs by Device
    >Good Programming vs. Bad Programming
    >Your GPU says branches are the devil.

    sporadic chunks of forum activity are often a result of my procrastination left unchecked (admittedly exacerbated if I come home with a certain fuzziness about me),
    and that can lead to large replies or numerous edits; so feel free to correct/disagree/whatever with whatever, or whatever...
    on the other hand, if it turns out you find some value in these kinds of posts, please let me know so I won't feel like such a piece of **** for not better utilizing my time.

  12. #12
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Location
    Tilburg, The Netherlands
    Posts
    30
    Gamer IDs

    Gamertag: RAKSHASRAJA

    Default It's quite an issue, this one!!!

    Quote Originally Posted by bukkit View Post
    working on this scene, i noticed a problem with using cubemaps in interior. they just dont fit properly, which is imho something that has something to do with the fact that the reflection is comming from infinity.

    i saw a solution to this problem made in Blender Game Engine.
    http://www.gamedev.net/topic/568829-...nment-mapping/
    it would be awesome if somebody would be able to recreate this approach in udk. i wasnt able to unfortunately (it was too complicated for noob like me)

    so i come up with a noob method to have at least some control over your cubemaps. its a bit tedious, requires many trials and errors, but its better than nothing.


    if you setup the cubemap like seen here. you can adjust the size of the reflected map ,and also its X Y Z position.

    so i guess this is all from me. hope i was somewhat helpful. and i also thank you for your attention.

    any comments or questions are of course welcome
    I'm busy working on re-creating Mass Effect 2's Normandy SR-2! I used Umodel to extract the meshes and it's textures and stuff, from the original game disc!

    Ur way of controlling a cubemap, gives me a good alike reflection on my Normandy screens like it is in the original game! The only thing is that it 'reflects' ONLY when the camera MOVES and when i PAN the camera and not when i TURN the camera (like looking around), which is actually what i want to achieve; CAN U HELP ME ON THIS?!

    Ps. I know i missed the Vector Transform node as of now; as soon as i use that node all my controls seems to be messed up!
    Last edited by RAKSHASRAJA; 08-21-2011 at 09:24 AM.

  13. #13
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    69

    Default

    i would love to help you but i really have no clue :/

  14. #14
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Location
    Tilburg, The Netherlands
    Posts
    30
    Gamer IDs

    Gamertag: RAKSHASRAJA

    Default No problem!!!

    Quote Originally Posted by bukkit View Post
    i would love to help you but i really have no clue :/
    No problem!!! At least i achieved a quite alike reflection on my Normandy's screens, thanks to ur tips and tricks!!! :-) Thanks a ton!!!

    Last edited by RAKSHASRAJA; 08-24-2011 at 01:47 PM.

  15. #15

    Default

    Quote Originally Posted by bukkit View Post
    Arch Glass material


    there are few things you'll need to obey to create a realistic looking glass tank, table, or anything more complex made of glass.

    again as usual, important thing is to check reference from the real world

    what do we see. the glass is refracting the world behind it, its reflecting more when looked at from an angle, than looking directly at it. the opacity is similar. looking directly at it, it seems more transparent than looking from an angle. also notice, the edges of the taple on the photo , you cant see through them at all. so this is something were gonna recreate.


    i made the tank out of two meshes. one for the glass part , and one for the darken edges, to simulate that particular real world behavior


    this is the shader for the glass, its made of two masked out realtime reflections. and one fake cubemap reflection with invert mask , so those two types of reflections wont interfere with one another
    the reflections are then tinted with that dark aquamarine green color.

    the opacity is made out of two fresnel nodes, for a smooth and also a sharp transition.

    the distortion is imho basic with a huge amount of control for the user, who can edit the distortion on the area direct to camera, and also away from camera. and also the fresnel node for the distortion transition


    the dark edge material is pretty basic. here i used the same trick with cubemap refraction as in the glass spheres material.

    a problem with the material setup like this is the distortion.... it is distorting not only object behind it but also objects in front of it , which can look wery strange.

    luckily you can use a simple trick to fix this. the problems only occur with opaque materials. so you can switch them to an translucent material with wery high opacity (something like 0.995) to remove the artifacts

    I actually think the opaque one looks more realistic only because, as you say... looking at real world references, if an object is close to the glass like the plant is there you would see a distorted reflection like the one you have depending on the lighting of course. In the translucent image I see hardly any reflection of the plant which kills the illusion for me. But I guess it is a matter of preference.

  16. #16
    Skaarj
    Join Date
    Jan 2010
    Posts
    26
    Gamer IDs

    Gamertag: looMAXool

    Default

    Thank you very much .. This is so awesome ...
    Nothing Important here
    Not looking for any more new team members

  17. #17
    MSgt. Shooter Person
    Join Date
    Feb 2011
    Posts
    213

    Default

    Yeah, really good work. Thanks a lot for sharing!

  18. #18

    Default

    Would you mind posting a breakdown for the material setup? The image showing the connections for the glass material is zoomed too far out to read all the plugs / connections. I was trying to follow your setup for an interior glass pane in a door effect but I'm having issues seeing things. Thanks.

  19. #19
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    69

    Default

    damn, it was perfectly fine when i uploaded it ,
    looks like imageshack shrink down mine large images. :/

  20. #20
    MSgt. Shooter Person
    Join Date
    Feb 2011
    Posts
    213

    Default

    I've recently ran into this problem (image re-sizing on free hosts). I found http://postimage.org to be a good replacement.

  21. #21

    Default

    Ok, so I tried using reflection vectors to generate fake reflections on my glass but I get weird vortex reflection effects. When I move toward or way from the glass the reflected image spirals in and out of the center. Anyone else having this issue? This happens on both cube-maps with vector transforms + reflection vectors, and on basic texture samples / 2D textures as well.

    The cubemap I generated by using the RendertoCubeActor.

    I don't know how to drop an image file into the forum or I'd have images for ya to look at.

  22. #22

    Default

    Bukkit, can we bug ya to upload large size images again? Thanks for the tut regardless, excellent info here!

  23. #23
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    69

    Default

    i dont seem to have them anymore unfortunetly :/

  24. #24
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Location
    Sarajevo, Bosnia and Hercergovina
    Posts
    128

    Default

    nice tutorial, can you make the pictures again in a bigger size or make a graf

  25. #25

    Default

    Looks Nice, I will bookmark this for when I am ready to start my project.

  26. #26

    Default

    Thanks a lot for your posts, they are very helpful.

  27. #27
    Prisoner 849
    Join Date
    Apr 2009
    Location
    Jacinto
    Posts
    989
    Gamer IDs

    Gamertag: Keltar3007

    Default

    Very noice


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.