Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: Robert Bodis on 2017-01-16, 14:44:57

Title: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-16, 14:44:57
Hi,

I bumped into some issues.
My scene setup is pretty basic. Vehicle with double sided windshields (shell) , HDRI for the lighting and a Backplate.

Now, when I look through my windshield, I see the HDRI and not the actual backplate.
In order for that to show up, I have to check in  " Thin", but if I do so, I lose the nice glass effect from my windshields.

Is there any way to get proper refraction on my widnshields without checking in " Thin " ?

Note;
-I already tried to plug in the backplate into the Enviro Refr slot in the Windshield material(s). (this ended up causing refracted bits of my backplate on unrealistic spots)
-Already tried having normal glass on the outside of the shell, and thin one on the inside. (...nope)
-Tried all 3 projection modes in the shadowcatcher.

What occured to me is basically adding a plane behind my vehicle with the shadowcatcher material, but this might slow down my render, cause shadows (if they cannot be turned off in the object properties) so on, so on.

I'd greatly appreciate if someone has some intel on this. Not sure if it's a bug or not.
Thank you!

Robert,
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: romullus on 2017-01-16, 16:14:37
No, it's not a bug. You need to instance your background to refraction override in render setup>scene>scene ebviroment.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-16, 16:21:54
Nope.
That way I get every single glass messed up. Headlights included, which are not supposed to get refractions from the backplate.

As I said before, the closest I got to a solution is adding a plane behind the windshield and add the Shadowcatcher to it.
However this will generate a dark square where the plane is, even if I turn off receive/cast shadows.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: pokoy on 2017-01-16, 16:41:19
Yes, facing this often. The solution that works and that you mentioned is to use a plane with the backplate mapped on it but it's a workaround that doesn't work well in some situations (animations or situations where the backplate is too close to the scene's geometry causing visible changes etc.). What would help is another map slot called 'backplate map' or so that would work differently from the refractions override.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: maru on 2017-01-16, 16:45:29
This should work straight away... Can anyone provide with examples (images, scenes)? I am especially interested in how you are making the backplate, and loading the HDRI.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-16, 17:26:11
Hope this one helps a bit more.

This is my workaround this issue , with the plane mentioned before.
This way I can see the backplate if looking through the windshields.          (thin-not activated)     (both clay and interactive image attached)

If I don't have the plane there, he will not project the backplate behind the windshield, but the HDRI.        (thin-not activated)     (didn't have a image attached of this one)

Third case would be by simply checking in " thin " , but then I lose a lot of detail from the windshields and they basically look flat.


*My windshields have a shell modifier on them
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: PROH on 2017-01-17, 00:48:29
Hi. At bottom of the map rollout in Corona mtl there are two slots for BG reflection override and BG refraction override. So if you create a glass material (solid - not thin) specifically for the windshields and put the backplate into the "BG refraction override" slot, then I believe it should work as needed.

Hope it helps
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-17, 10:41:47
Hi. At bottom of the map rollout in Corona mtl there are two slots for BG reflection override and BG refraction override. So if you create a glass material (solid - not thin) specifically for the windshields and put the backplate into the "BG refraction override" slot, then I believe it should work as needed.

Hope it helps

Thank you for trying to help, however,
Please read my first post again,

Done that.
I get incorrect refraction , pieces from the backplate that are not visible whatsoever.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 11:17:40
This is not resolved by using refraction override but by adding plate behind the car with ShadowCatcher material on it.

It should never cause dark square (and it does not seem so, on your recent image you posted). Keep in mind that Corona does not support receive shadows option, as it's too much of a fake. So toggling it will do nothing.

If your plate behind the car darkens, then it is most likely due to the plate being way too close to the car, catching a bit of shadow occlusion from the environment. Just put it further away from the car (even like 50 meters) and make it a bit bigger so it covers entire window area.

The plate thing is not really a workaround but rather default workflow. ShadowCatcher kinda works in a way it assumes you do very basic blockout of your scene with geometry. There's unfortunately no better way of doing it given how limited representation of a scene location single HDRI map and single backplate provides.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-17, 13:03:45
Moving the plane further away did stop the blackening.
However this is still a lot of work for such a simple , hate to call it "issue" .

I really hope they will add some sort of a direct override for this in the future.
If I'd have objects around the vehicle, I'd be screwed with this plane.

Thank you,
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 16:39:41
How is that a lot of work? It's just a single plane with the material you already have made. Plane creation = 2 secs, assignment of existing material on the plane = 2 secs, placement of the plane ~5 secs.

And how does the workflow break with objects around vehicle? You would then just move the plane further, behind those objects.

And how would you suggest resolving it differently? Aside from directly visible environment, the backplate can only be seen by any secondary rays (reflection, refraction, direct) if it has an actual physical position in the scene. Reflected and refracted rays need to know where in 3D space exactly is that point located, so it can be reflected or refracted.

It's easy to imagine it for car windows with a little bit of thickness, because they still visually behave as thin glass. BUT, what if there was a glass sphere, which bends the rays that it refracts parts of the refraction environment that are outside of camera's field of view? What color/information would be there, when backplate projection area is defined by camera view area, and there is no backplate information outside of it?
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-17, 17:02:51
I will just ignore your tone there and ask you a simple question instead.

What if I want to animate something.
I.e. a vehicle moving across the scene. I guess you would prefer animating a plane behind the vehicle instead of coming up with a proper solution, don't you ?

"And how would you suggest resolving it differently? "
Doubt I am the one who should have the answers for this.

Hugs,
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 17:12:43
What if I want to animate something.
I.e. a vehicle moving across the scene. I guess you would prefer animating a plane behind the vehicle instead of coming up with a proper solution, don't you ?

You will never animate camera, because your backplate is stationary, fixed from single point of view. If you needed camera animation, you would either use just HDRI, without backplate, in which case, problem would disappear, or you would use footage (image sequence). In that case, you would have to do some advanced scene blockout anyway, otherwise reflections would not map correctly.

That leaves us with just a stationary camera case. I see no problem with extending the plane to cover entire path of the car from edge to edge of the frame. I guess that would be another about 3-5 seconds of work. I am throwing those time estimates here because I have 3ds Max open with Car scene and testing my suggestions on the fly.

Also, I don't see anything wrong with the tone. It was just a series of questions with answers to cover the cases you may ran into, and the last one was a genuine question intended to make you pause and think for a second how would your suggestion (of some specific override for this case) work.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: redstarcg on 2017-01-17, 17:20:03
The plane method extension will also project misc reflections onto a car. Also instead of fixing the problem you are making excuses and temporary solutions. Corona is a fantastic engine and quality is great, but this is a very simple request that should not be hard to fix. Vray has the ability to have the refection be normal, corona is beating vray in almost every aspect so why not make this as good also.

Also as far as image sequence backplate. You said some advanced scene blockout would need to be done. That may be recommended but not needed. I have done a complete Ford Commercial and did nothing but animate the vehicle and slightly hdr, client was happy and work looked good. So no need to do something complex if it looks fine.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-17, 17:25:30
Obviously it would have no camera movement.

Let's just say a car spinning around.
Try out another theory with this then. Start scaling up the plate behind the vehicle, simulating the upscaled plane idea you just told me.
Now check the reflections on the vehicle.

You will be able to see the big plane on your clear coat.

Obviously you could haggle it out with a regular vehicle. However if I would have 500 frames to render, it would be hard to spot where that thing reflects up on the vehicle.
For most this would give a stroke after 500 frames.

Then there would be another issue if it's a bigger vehicle, god forbid a Sci-fi thing.

Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 17:29:18
Yes, and those projected reflections would be mapped absolutely correctly, given that you would model holdout objects in the same/similar distance actual real scene elements were captured on the backplate when shot. I do that all the time when doing VFX integration into footage. If you put plane very far away and make it small enough to cover just window, I doubt you will get any visible reflections projected on your car.

Actually, I will often take extra time to blockout some elements on the backplate to make scene even more realistic, such as for example street lamp close to the car, so that it gets reflected in the car hood/windshield, etc...

Everyone keeps talking about solution, yet no one knows what the solution is. No render engine has any advanced AI, that can differ which mesh is modeled in a way, in which it does not refract any environment outside of the camera's field of view, and which meshes with refractive materials bend the rays, and need to refract the environment.

Owlempires has stumbled upon this problem in one of the previous posts, where enabling refraction environment messed up his other glass materials. This is what I mean. If we had yet another override called "backplate map", what would that override do? In which ways would it be different to the existing refraction environment? I am sincerely asking here, without any angry tone.

You have simple solution of putting a small plane behind it, which never failed me in my life, and I did a lot of cars integration, and then you also have Refract BG Override slot at the bottom of each CoronaMTL, into which you can instance your screen mapped backplate, so you get refraction override only on materials selected by you.

I can't possibly imagine scenario where both these mechanisms would fail.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: redstarcg on 2017-01-17, 17:39:29
Rawalanche - The refraction override is almost doing it but the only issue I noticed for me when trying to use it, it will put the image in areas that should see other things, it kills the life of the headlights etc.

I dont like comparing things to vray because its not fair to do so. But for reference, in vray, whatever I have in my environment background image, that shows up through the back of my glass, refraction remain the same but it shows the bg image in back of glass.

On the other hand, the glass in Corona usually has alpha, so if you bring it into AE or Photoshop without showing background in render you can put backplate in there and it will be fine lol.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 17:43:22
I dont like comparing things to vray because its not fair to do so. But for reference, in vray, whatever I have in my environment background image, that shows up through the back of my glass, refraction remain the same but it shows the bg image in back of glass.

In that case, I am very curious what kind of setup do you use, because I use V-Ray on almost daily basis, and it behaves exactly as Corona does. In V-Ray, I always use planes behind the glass for the exact same reason. I can actually prove it. Could you share your V-Ray scene? Even if just stripped down?

And yes, it will kill life in your glass materials if you use it, because exactly as I said in one of my previous posts, backplate projection is limited to the camera's field of view. Renderer can not magically know what's outside of the view. It has no data. That' exactly he problem here. That's why you, as a human, need to manually tell the renderer where backplate is, by placing geometry with ShadowCatcher, and rest will be always considered HDRI environment.

Also, I did verify my workflow, and it indeed works, given that the plane is in sufficient distance from the car. Even if it stretches across the entire frame, it still does not affect the reflections:
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: redstarcg on 2017-01-17, 18:00:59
Here is my setup. Very simple. Backplate in Env slot. Vray dome with light set to invisible. Everything functions properly.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 18:08:24
That's because you are using environment mapped in screen space as your main environment. How does it illuminate your scene with GI instead of dome... have you tried that? You will see that once you enable GI, you will get your backplate ghosting also through completely opaque materials with no refraction or opacity. Also, don't you find it strange, that you have lens shaped meshes that should refract and bend light, yet your teapot and sphere pass through refraction from the environment as if they were completely thin? Shouldn't sphere refract what's behind it upside down, like it does in real world?
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 18:14:44
Attaching below an example of what happens on your image, vs what should happen. Rendered in V-Ray.

But yes, this is easily achievable. But it will make your refractions on some other meshes look pretty bland. That's exactly what Owlempires has complained about in some of his previous posts. So again, it's a tradeoff.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: redstarcg on 2017-01-17, 18:18:35
My backplate never illuminates anything even with GI on because I use a dome light. I created the shapes with no shell for a quick example. Also as long as you use a dome light with spherical checked your backplate will never show up through solid objects. I know exactly what issue you are talking about, but using a dome fixes that haha.
Trust me, this works 100% accurately when I am setting up a proper scene.
I am attaching some shots I have done in past with Vray so you can see how the glass works just fine, this was same method with no backplate plane.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 18:25:37
Yes, of course it works in those scenes, because you don't see any ray-bending objects against the plate. All the refractive materials except for window glass, where refraction is not noticeable, are blocked by something behind it.

But that's not an issue, really. I completely agree it works in these simple cases. The point here is, that the Refract BG override in material or Refraction environment override will do nearly same thing. Owlempires has brought up an issue where refraction environment override would modify his other glass materials, and ruin the look he liked. The thing with your V-Ray setup is, that you work with that setup he does not like right from the very begining. He already had a set up look, and then it changes. Hence my plane suggestion, or suggestion to use refraction override in CoronaMTL. Those two solutions should resolve that particular issue.

If you want to go with same workflow as your V-Ray one, then simply start your scene from scratch with refraction environment override enabled and filled with the backplate..
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: redstarcg on 2017-01-17, 18:28:46
This is pointless.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 18:37:12
Oh come on... Don't just end it like this. It's exactly discussions like these that lead to improvements of Corona. I occasionally even change my mind and try myself to convince Ondra and his team to implement something new. It just needs to make sense.

I just want to work out how would the better solution work...

Look, with your setup, you can indeed make great output, but I mean, what would you for example do, if you had to integrate some Car as well as a few glass refractive objects in the scene, something like this:
(https://forum.corona-renderer.com/index.php?action=dlattach;topic=14608.0;attach=57892)

Right now, Corona accommodates for this scenario right out of the box, where as V-Ray doesn't. If you want quick, easy fix to your window glass in your car, you just plug your backplate into window glass material's refraction BG slot. And you are done. But with V-Ray, how would that work then? If we in theory switched to V-Ray's solution, how would people go about this use case then?
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: redstarcg on 2017-01-17, 19:05:48
Aha! Okay so I did the test Rawalanche.
I see what is happening. Vray and Corona have the same concept inverted lol.

I agree with you on the ball sample, vray will only do this if I do not override backplate image, which makes it actually a bigger pain than Corona and actually corona wins here with it being easier.
But I do have to still stand behind the logic that when you do refraction override in Corona it does behave a little bit different than when you have a backplate image in Vray env slot.

I guess at this point its either one way or another, in this sense the foundation of Corona is more accurate if you want to use balls and such, however it does backfire in the sense of refraction override but that can be fixed with a plane behind windows.

Just knowing solutions to problems, still cgi so it can never be 100% easy hahahaha. :)
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-17, 19:24:55
Sure, it will never be 100% easy :)

BTW could you try using backplate plugged into refraction BG override of a car windows glass material in some of your scenes? I mean, it could cause some issues on meshes that refract parts of environment outside of camera's FOV, but that's not the case of windows planes, which are usually quite thin an straight. In that cause, it could work as a best solution. Only drawback would be that you would have to have one more separate material specifically for windows glass (which is the case mostly anyway).

I am just curious, if it would cause any problems in your scenes. It should not. And if it does not, then you don't need to worry about planes anymore.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: mferster on 2017-01-18, 01:03:43
http://www.ardakutlu.com/maxscripts/#cameraPlaneJump

This script may help you.... with maybe a few tweaks

Creates a plane that matches your backplate input and takes up the extent of your camera's field of view at all times and moves along with your camera's movements/transforms.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-18, 13:10:10
I haven't joined in the conversation between you two gentleman, because my knowledge is still not thorough enough about the subject.

However. Blunt idea.
Getting correct results is possible. Via the plane.  So the end result is achievable.
What if the camera or the material has an option, that will make selected objects act as if they were Glass with a back-plane behind them ,determined angle by the camera and its target.

I'm only spit balling ideas here.
Would that be possible in some way ?
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-18, 14:02:42
What if the camera or the material has an option, that will make selected objects act as if they were Glass with a back-plane behind them ,determined angle by the camera and its target.

That's pretty much what you get if you plug your backplate into CoronaMTL's refract BG override slot.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Robert Bodis on 2017-01-18, 15:50:52
If I plug the backplate there, I get dark windows and the windows are refracting the backplate on bits that are basically covered out by the seats.
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: Ludvik Koutny on 2017-01-18, 15:55:55
Darkening happens to me too. That's probably some bug with how internal reflection gets handled.

Idk what's up with it showing through the seats though. That doesn't happen to me. Probably some weirdness in the setup process.

So I guess plane solution it is
Title: Re: Backplate/HDRI Refraction through 2sided Vehicle windshield
Post by: maru on 2017-01-18, 17:03:38
Guys, can we draw some conclusions here? Do you think there is some issue in Corona that should be fixed, or is everything working as expected?