Documentation

Complete Studio Scene - 06 - Reflections

The next effect will present is the floor reflection. As I mentioned before, to get the reflection to work we have to make a duplicate render from a mirrored camera position. All the required tools are prepared in this Render compound.

00:00:15

We have a Mirror Camera here which is bound to the normal Camera and has its Mirror property turned on. That means that it will always move along with the normal camera and always renders a mirrored image of it. More precisely an image mirrored to a specific plane. The plane itself is specified by a Clip Plane module which is connected to the Mirror Camera. If we select the Clip Plane module, we can move it on the output screen. We can also rotate it, but in this case it’s pointless since we want to mirror to the floor.

00:00:46

We can also see that the Out Size of the Mirror Camera is overridden here. For the sake of minimizing the GPU load, sometimes it’s enough to render the mirror image in a smaller resolution. What we see here is a possible implementation of a half-sized rendering. There’s a System Params module here that, among many things, can tell us the default system Frame Size. We divide it by 2 using a Divide module and wire the result into the Out Size of the Mirror Camera. We can see that a half-sized image is coming out from the camera, and it’s also mirrored to the specified plane.

00:01:22

Of course, the small-sized mirror can only can be used in the cases when we use only faint reflections on the object surfaces - or if we apply a blurred reflection, simulating a rough surface. For the latter case we have prepared Blurrer module here. Usually we want to show crystal clear reflection, but a bit of a blurry one.

00:01:43

And now a smart trick follows. The mirror image somehow has to be transferred to the shaders, because the image must be directly wired into them so that they can use it as a texture. Using the normal wiring method we would have to expose the image output to the edge, then wire it inside the model compound, and then split it and connect it into all the relevant shaders. Of course it could be much more complicated if we had a hierarchy of nested compounds.

00:02:10

Aximmetry introduced a system of the, so called Tunnels, to avoid these difficulties. By using Tunnels we can create a web of invisible connections between sub-compounds. It works as follows. We add a Transmit module like this one here. Of course, there are Transmit module types not only for video signals, but for any data type. We have to specify a tunnel name in the “Into Tunnel” property. In this case it’s “MIRROR-1”. That means that the mirror image will be transmitted into the tunnel named “MIRROR-1”. From now on inside any subcompound we can access the mirror image by referring to the tunnel named“MIRROR-1”.

00:02:51

Let’s do it. Go over to the model compound by pressing Ctrl+2. Add a Transmit Video module. As you can see we use the same module type for accessing the tunnel as we do for creating it. The difference is that this time we use the “From Channel” property. It offers a list of the available video tunnels, so we simply select “MIRROR-1”. From now on as the desired mirror image appears on the output of the module.

00:03:18

So, How can we use it? Let’s select the object we want to apply the reflection on, and press M to find its shader. We have to wire the mirror image into this shader. But first we have to change the type of the shader since it is currently  not capable of handling reflection. Right-click and choose “Change Import Source”. This time we have to enter the “Mirror” subfolder, because most of the shaders related to mirroring are found there.

00:03:44

There’s an important thing to note here. Do not confuse phrases “Mirror” and “Reflection”, in Aximmetry they designate two different types of reflection. If you see “Refl” in the name of a shader, it indicates producing Environment Map based reflection. In contrast, the “Mirror” tag indicates plane reflection using a real-time rendered mirror image. The latter is our case now, so enter the “Mirror” subfolder. We don’t need any special extra feature here, we need a shader that besides the Color and Complete Maps also supports mirroring. Therefore we select the “Mirror_Flat_Compl” shader.

00:04:23

Now we have to connect the mirror image. The previously added Transmit module is too far from here, now I won’t search for it. Instead, I add another one with the same source tunnel specified. As you can see, we can access the same tunnel at any number of locations. Let’s wire the output into the “Mirror Image” pin of the shader.

00:04:44

Now we can see the reflection on the floor. But it is obviously wrong, the objects are not aligned with their reflections. The reason for this is that the mirror plane is misplaced currently. Let’s go back to the Render compound and select the Clip Plane. On the output screen the plane itself is shown by a red schematic rectangle. It might be disturbing for us when aligning the plane, so I suggest to switch it off now. Open File / Properties, select the Scene Editing section, then turn off the “Show helper geometries” option. It will also switch off the spot light cone figures and other schematic objects in the editor. Now the red rectangle is gone and only the moving arrows remain. Let’s use the upwards arrow to align the objects with their mirror images. It’s advisable to hold down Shift or even Shift+Ctrl to achieve finer movement.

00:05:37

Here it is. The effect we got is a bit unrealistic. Let’s improve it. Select the shader. We have a “Frenel Min Value” property here at the bottom. We set it to zero for now. We can see that a Fresnel effect is applied to the surface, meaning that the intensity of the reflection depends on the viewing angle, which is close to the real world effect. Also we may want to cut down the intensity a bit. We can find a “Reflection Color” property here. We can even change the color of the reflection here, but usually we only want to adjust the intensity of it, so let’s do it. We have a more realistic effect now.

00:06:19

On the original Max render we didn’t see a blurred reflection, so in this case we want a more clear mirror image. Go back to the Render compound. First of all cease the smaller resolution rendering. So now we render the image in full HD. Secondly adjust the Blurrer Radius so that we have only a tiny blurring. Now we are closer to the original look. Let’s cut down the intensity a bit more, and make itlet it be 0.82.

00:06:47

Let’s continue since there are more reflective surfaces in the scene. Let’s see the Midfloor object. Now the problem is that it is a higher plane, so we have to mirror to a different plane. If it were a small surface where it’s not too striking we could cheat and use the same mirror image we used on the Basefloor. But this isit’s not the case, and also we have lamp bodies and other objects here that would make the misalignment very noticeable. So we have no choice we can’t do choose other than but rendering another mirror image.

00:07:19

Go back to the Render compound. Here we can simply clone all the mirror related modules by dragging them while holding down Alt. This time we send the image into the “MIRROR-2” tunnel. The Clip Plane have to be moved upwards, but before that we wire the mirror image into the corresponding shader to see what we are doing.

00:07:39

Let’s select the object and then its shader by the M key. It hasve to be changed to the “Mirror” version as we did before. We select “Mirror_Flat_Compl”. Then we wire the second mirror image into it from the “MIRROR-2” tunnel. We can see the reflection. Also, what we didn’t expect at all, unrealistic reflection appeared on the sides of the object as well. Of course, the shader also affects the sides, but due to the applied method, the reflection cannot be corrected  there.

00:08:11

One method to avoid this situation is to split the object in two parts and use different shaders on the top and the sides. But the shader itself offers a simpler solution based on the objects normal vectors. We can specify a direction to which we want to restrict the appearing of the reflection. We have a “Mirror Direction” property in the shader. Its handling is a bit hardcore, but can be followed easily. The first 3 component specifies the desired direction. Usually we can leave it as is, because 0, 1, 0 means the Y or upwards direction. The fourth parameter specifies how strong the shader suppresses the reflection in other directions. The default is 0 which means no suppression at all. Now we can set it to 1 or 2 if we are more strict. The more I decrease the value the more the reflection expands to the thin curved corner of the object. We can stick with 1.5 as a friendly middle value.

00:09:09

We can now adjust the mirror plane. Select Clip Plane 2. The arrows are at an inconvenient location. Of course, we can move the plane sideways as much as we want, because it works as an infinite plane, the horizontal location of its center is completely irrelevant. So we move it to a position convenient for us to adjust. Let’s drag the upwards arrow. This time we can use the bottom of the lamps as a reference. We set a bit more blur and on the shader we setup the Fresnel and the intensity of the reflection. That’s it.

00:09:45

On the original Max render also the middle wooden floor had reflection. This means a third mirror plane for us. At this point we have to start thinking over. If our current GPU load is too high we cannot afford rendering another mirror image. In this case we can either cheat and use the previous mirror image or we don’t use reflection at all. Currently we still have a fair amount of spare power, so we’ll do another mirror.

00:10:12

Let’s go back to the Render compound. Clone the mirror rendering part again. The target tunnel will be “MIRROR-3”. If we select the object and its shader now, we can see that again multiple object share the same material. So let’s clone the shader for our object of interest, and do the already familiar steps on that material. Change it to a mirror shader and so on, I won’t show the whole process again. We can skip to the result. I applied a stronger blur on the reflection this time. So we have the three reflective floor surfaces.

00:10:46

Now we continue with the other type of reflection when we simulate reflective surfaces on arbitrary shaped objects. In absence of ray tracing we cannot do real reflection in realtime. So we’ll settle for some fake reflections. Let’s begin with these red surfaces here. Select the object and its shader. We can see that the same shader is used on all three objects, so it will be easy for us. Let’s change the shader type. This is the case when we don’t need a “Mirror” shader, but a “Refl” one. It can be found here in the same folder, namely the Flat_Refl_Compl shader is what we want. It extends the capabilities of our shader by an Environment Map property.

00:11:29

An Environment Map has to be a cube texture. We won’t discuss the creation of such textures here, but we have a bunch of stock Environment Maps in the Common project. Within Common enter Textures and then Envmap. We can test the maps we find here. Since the objects have quite large and smooth surfaces, using intense Environment Maps is inappropriate here. I suggest to use the “Chaos_06” map which contains smaller spots with a faint coloring. Also I cut down its intensity using the Reflection Color property.

00:12:05

We also have a larger white reflection here which isn’t coming from the Environment Map, but is a Specular effect from the light source we added before. We cut this down as well using the Specular Color property of the shader.

I’d say these faint reflections are more than enough to make the illusion, we don’t have to apply any stronger effects.

00:12:25

Do the same thing for this black glass surface. We have two glass objects with the same shader. Let’s change the shader to a Reflection type one. Select the same Environment Map as before, it will do perfectly. We got a bit of a harsh effect. In addition we have planar surfaces here that make it worse. Let’s adjust the effect. We have an “Env Map Rotation” property here. By using it we can rotate the reflection pattern if we are displeased with it. But the best here is to cut down the intensity as before.


 

Aximmetry Technologies Ltd.

Incorporation no: 01-09-171556
EU VAT registration no: HU24314486
Tax registration no: 24314486-2-41

Gömb utca 26., 1139 Budapest, Hungary
+36 1 300 5060
This email address is being protected from spambots. You need JavaScript enabled to view it.
Office hours

©2020 Aximmetry Technologies Ltd. All Rights Reserved. Designed By freeart.hu

Search

We use cookies
This site uses cookies to personalize content, to provide social media features and to analyse traffic.