Home Unreal Engine

Help glass shader faking reflection and refraction inside the material it self.

decorix
polycounter lvl 11
Offline / Send Message
decorix polycounter lvl 11

I have question if you had a grey neutral back plane environment

like the MetaHumansLighting presets scene in Unreal.


I want to have this Glass shader to look nice but I think the glass shader isn't going to 

work well as it hasn't got anything to reflect from just the grey environment surrounding.

Even if i reflection sphere in my scene it wouldnt do much with the grey neutral bg.


I don't want to change grey neutral environment, because its set up for the light rig in Metahumas

Lighting presets it would effect the lighting for my character. So I don't want to change this.


I'm using cube maps for the reflection and refraction.


So I think i need to fake the reflection/refraction inside the material it self. To get glass-crystal

to look better. 


Is this correct?


This is my shader setup is there anything wrong or would you do things differently. I'm not a shader

expert learning stuff what I can find on youtube. Unfortunately I haven't see any stuff hardly based on fake 

reflection/refraction inside a material so far. Unfortunately its still looking semi transparent.

Does anyone see what not working correctly? I want it to be more solid my opacity is already .9

Replies

  • be3d

    You could add a sphere reflection capture and instead of "Captured Scene" you could choose "Specified Cubemap", and then plug in your HDRI.

    This way you would have the reflections without changing the background.

    But you could also give it a boost within the material, as you did. I'm no expert either, but these are the things that I would do differently:

    -connect the reflection vector (without the vertexnormals) to the UVs of the HDR and simply add that to the color

    -also, if I'm not mistaken you're plugging in RGB color into the opacity? You should probably stick to grayscale values. A simple lerp between two values, with a Fresnel as alpha would suffice. And of course you can multiply this with another grayscale mask to add breakup and variation if you want.

    -I don't think you really need to use emissive for simple glass this, only if you want a specific artistic effect.


    You could also download from the store a project called "Advanced Glass Pack", it's free and it could give you some insights when building your own shader.

  • decorix
    Offline / Send Message
    decorix polycounter lvl 11

    Thanks so much be3d. Good tip about the reflection, I'm just wondering would this effect you character too if it had some light rig setup as MTH lightsetup. The last thing I want that it would also effect the character. Guess I would need to try it ;-) i'm using to cube map textures that controle the reflection and the refraction. I got this info from Ben Cloward he's expert on shaders. About the emissive I might have experimented my self. I have downloaded the pack great tip. Thanks. I will investigate more just wonder how you would set it up.

Sign In or Register to comment.