Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: romullus on 2015-02-21, 21:15:44

Title: Dirt on glass
Post by: romullus on 2015-02-21, 21:15:44
If anyone knows how to create dirty glass material, please, share that secret with me. I need proper refracted glass, not a thin sheet, so blended material won't work, unfortunatelly :[
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-21, 22:54:35
Any photo reference?
Title: Re: Dirt on glass
Post by: romullus on 2015-02-22, 09:03:13
(http://wac.450f.edgecastcdn.net/80450F/1027kord.com/files/2012/05/Why-Windshield.jpg-300x225.jpg)
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-22, 11:01:21
Here's the scene. You can tweak the maps to make glass less transparent or reflections more rough. It's all in slate editor view.

Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-22, 11:06:38
And try to replace attached texture with this one :)
Title: Re: Dirt on glass
Post by: romullus on 2015-02-22, 11:18:50
Thanks, but i can't open this scene, i'm on max 2014. Can you show slate editor screenshot? That shoud be enough.
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-22, 11:50:18
That's strange. Could have sworn i saved it as max 2014 :) Try this one:
Title: Re: Dirt on glass
Post by: romullus on 2015-02-22, 14:30:50
Yes, it works... kind of. I just wish that there'd be a way to blend refractive material with completely different one. Let's hope it'll be fixed someday. Anyhow, thank you for your help, Rawalanche.

BTW, don't know why did you put glass material into multi/sub mat - this instantly renders your mat completely wrong.
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-22, 16:06:39
Yes, it works... kind of. I just wish that there'd be a way to blend refractive material with completely different one. Let's hope it'll be fixed someday. Anyhow, thank you for your help, Rawalanche.

BTW, don't know why did you put glass material into multi/sub mat - this instantly renders your mat completely wrong.

Nope. The glass is dirty just from the outside of the car. On inside, it's clean. But it renders wrong, and i know why. It's a bug :)

If you did it with mental ray or vray, it would not happen :)
Title: Re: Dirt on glass
Post by: romullus on 2015-02-22, 17:59:04
I know it's a bug, that's why i created this topic in the first place :]
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-22, 20:14:48
At the moment, you can workaround by using only one material, but using multiMap set to material ID. Then one material ID will be all the dirty maps, other ID will be all the clean colors. That should not mess up the refraction.
Title: Re: Dirt on glass
Post by: romullus on 2015-02-22, 22:14:23
I'll try to figure it out tomorrow, but at the moment i can't imagine how it could help o/O
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-23, 09:59:00
Part of the problem is that Corona decides which volume ray is in by material. So even if you create two identical glass materials, and assign one to front face, and other one on back face, you get double volume entering interaction, instead of one entering, and one exiting. Only if both front and back face have same material, correct enter and exit will happen, so area behind the windshield won't have glass in it ;)
Title: Re: Dirt on glass
Post by: romullus on 2015-02-23, 10:32:30
Thanks for explanation. It's good to know some background of this problem, but what i really would like to know, is this fixable?
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-23, 10:43:48
Damn, i though i already explained it more than well :D

Here's the scene:
Title: Re: Dirt on glass
Post by: romullus on 2015-02-23, 11:42:03
Sorry, i was talking about blending refractive materials.
Anyway, thanks for help - your solution will fit for now. And that trick with multimap is really cool.
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-23, 11:45:36
Blending refractive materials is impossible with Corona at the moment. But for simple dirty glass, it would be a wrong approach in the first place. It would be just slower way (rendertime-wise) to achieve same thing.
Title: Re: Dirt on glass
Post by: romullus on 2015-02-23, 19:56:16
While i certainly agree that blend would likely be slower to render, i can't see why it is wrong approach. It's easier to setup and arguably would give superior results, IMHO.
Title: Re: Dirt on glass
Post by: Ludvik Koutny on 2015-02-23, 23:29:20
While i certainly agree that blend would likely be slower to render, i can't see why it is wrong approach. It's easier to setup and arguably would give superior results, IMHO.

It would be easier to set up, but result would be of identical quality, if identical maps were used ;)