One way to get tinted/colored windows/glass for e.g. cars (Eevee)

Hey!

Just sharing an idea of how to get nice looking tinted windows/glass in EEVEE.
Unfortunately, it doesn’t give you colored shadows.

Does anyone have a better solution?

Setups in Blender 2.8 (build=2018-12-28):


(in the image, the rear window has a darker tint, the sides is a little bit brighter and the windshield is the brightest. As it is on cars in reality)

Nothing fancy, just to show the difference:
GlassVersusTinted

Used from others:
Carpaint - Master Car Creation in Blender
Glass - EEVEE cwGlass shader, Chipp Walters youtube
Hdri - HDRIHAVEN.COM


My Artstation

usually if you want higher reflections,then you only need to increase the specular value.

if you are familiar with IOR values you can convert a IOR value to specular with this formular
https://docs.blender.org/manual/en/latest/render/cycles/nodes/types/shaders/principled.html

at refractive index site,i found after a quick search,the highest glass IOR in they list with 1.85

with the specular formular you get 1.11 for the specular

the metallic in the principled shader is used for real metal materials.if it works for you fine,just sayed that glass has its own IOR

@pixelgrip

I am familiar with the principled shader, IOR, metallic and all that. I was just happy to find a way to get the glass darker without disappearing. I just mentioned what “metallic” does if you increase it. It may not be correct and / or realistic, it was not the meaning. I changed a little in the post.

Do you have a better way to solve this? I know it’s in Beta and maybe it will work differently later.

Thanks! =)

I am not sure what you mean exactly?of course you can mix all nodes and parameter like you want.as sayed in my post before,every material, in this case the glass,has its own IOR.maybe you dont know the exact glass type, what is used in the real car.the point is,instead of mixing metal reflection to the glass,you can increase the specular.maybe( 0.5 - 1.2 )should be enough for increased reflection and a realistic result,because it is in a range that glass can have.

Why use principled? Glass is basically fresnel -> refraction and glossy, where refraction can be replaced with transparency (some tricks may be required, been discussed to death before), where the fresnel can be curved/powered if you need to (for i.e. antireflective coating effects) and the refraction/transparency can have a darker color (glossy should generally still be white, but I never checked my own tinted car window).

Btw, I have no idea what works in Eevee, I don’t have a computer that can run 2.80 yet.

@pixelgrip Thanks but I meant to get a tinted look in eevee, It’s easy in cycles

ok,then CarlGs method is maybe the best,with refraction and glossy shader.this way you have inputs for the color and a seperate reflection color

afaik CarlG has posted many glass shader before,maybe he can post a link for a simple and better solution

yes it should be allways white,except for metals.only metals have colored reflections

Not always, which is why I emphasized it. I don’t know how the tinted portion of the car glass is produced. I have coated eye glasses myself, and you can clearly see a green tint on facing reflections which becomes white at grazing angles. Being anti reflective, I’m guessing the fresnel should undergo a power curve as well (stretches out the low end and also lowers the low end at facing angles = less reflection).

usually,the antireflection coating are the same thinfilm physics.the tint you are see ,is due the phaseshift in the thin layer and reflecting at the substrate.the outside layer (if i am not wrong,it could be interference that some waves are canceled out) is always white(except metals),and is mixed with the substrate reflection which ray is exit on the same angle.

here a video how it works

I know, but we don’t have a builtin efficient thinfilm shader. For things as simple as a green tint at facing angles, I’ll rather fake it as I described. I might use the thinfilm setup if I did more complex colory things such as oil on water, soap bubbles etc.

I value efficient/intuitive but plausible more than hypercomplex/unintuitive but physically accurate. Usually eyeballing it is actually sufficient :smiley: and not what makes or breaks the image.

Another case of not using white but a portion of the albedo color for facing specular color is handled with the principled specular tint control. Can be used in some cases where we want to fake an effect rather than rely on computationally heavy real (or impossible) simulations.

fair enough.your own glass setup you are meantioned

is the very similar to the result as the thinfilm.you have the white glossy fresnel,and the tinted refraction or transparent shader
the difference is,you are set the color manual,vs the thinfilm or glass absorption calculation, the specific shader would do for the coloration.

btw if you are using a constant thickness in the thinfilmshader, then you get a even coloration.the color swirls on a bubble for example, are due the thickness variations.

Did you settle on a solution for this? I’m looking to make some red tinted glass for the siren light bar on an ambulance. Coloured shadows aren’t an issue as I’m going to use coloured lights, but being able to see the actual chrome light housings inside is important :slight_smile:

don’t know but in Eevee you can change the glass color
but may not give same effect then a tinted thin film

or higher IOR

or more transp

happy cl

That will tint the reflections as well, which doesn’t happen for “glass” - reflections are supposed to be white. If regular glass shader works (I’m not an Eevee user, at least not yet), you’d be better off setting up fresnel to shader mix between refraction and glossy, where the color is given for refraction only.

In reality for normal glass, both of these would be white, and color should come from volume absorption.

After posting this, I found the updated cwGlass/ekGlass and played with the settings there, it’s just been updated to be even better since yesterday too:

Such a good community!

That one looks weird to me. IOR 0.9 is supposed to be for backfacing faces (exit IOR, or from water looking up through snells window), and it’s not the inverse of the other IOR of 1.4 (1/1.4 is 0.7143), so I have no idea where that number comes from. Maybe it looks good in Eevee, I don’t know. But it has nothing to do with a physical approach.

It is also called “thin”. But for thin (in Cycles) you don’t need to use refraction; transparency with glossy is enough, although you must invert the IOR for backface. If thin means thinfilm (like in a soap bubble), now you should modulate the color of the reflection - low frequency magic texture from reflection coords scaled up and driving a slightly desaturated wavelength node is (for me) “good enough”. Although it’s not something I have to deal with for real projects.