Please note that this is a BETA version of the document. All information presented is correct but we are working on improving the details. |
Introduction
In this documentation, we will talk about creating an AR scene using Aximmetry SE. We will cover adding a model, adding shadows, and reflections and some additional information to make it more realistic.
You can read about AR production in general here.
Importing the required compounds
To be able to render an AR scene you will need the following compounds:
- [Common_Studio]:Compounds\Render\Render_General.xcomp / Render_General_PBR compound
- [Common_Studio]:Compounds\TrackedCam\TrackedCam_AR_Prev_3-Cam.xcomp Camera Compound
- Your AR model
Dran-n-drop them into the flow editor and set up the connections like so:
After this, you can position your model in the 3D space and set up its materials.
You can turn on the Transformation Gizmo to make positioning easier:
You can learn more about the transformation gizmo here (coming soon)
Adding Shadows
To be able to add shadows to your AR object you should add one or more dynamic lights to your scene.
You can learn more about dynamic lights here.
Adding a Shadow Catcher
A shadow catcher is a transparent object on which only the shadow is visible.
Add a Scene Node and a Rectangle to your scene and connect them like so:
Position the Rectangle so that it covers the location where you want the shadows to be:
Adding Shadow Catcher above the ground
If you wish to add shadow to let's say a table, you will need to take some extra steps:
First, you need to measure the size of your real table. Its depth, length and height.
Then you have to adjust the 3D Rectangles sizes accordingly.
Let's say you have a table that is 0.9m wide, 0.5m deep and its height is 0.75m.
The properties of the Rectangle should be the following:
- Plane: XZ(1) - This makes the Rectangle face upwards.
- X Start and X End - These values set the width of the Rectangle
- Y Start and Y End - These values set the depth of the Rectangle
Then you should position the Scene Node to the height of the real table, 0,75m in this example:
Then you can use the Transformation Gizmo to rough position the plane at the table:
You can learn more about the transformation gizmo here (coming soon)
You can fine-tune the position of the Rectangle using the Transformation properties of the Scene Node.
Adding the Shadow Catcher shader
Add a [Common]:Shaders\Special\Transp_ShadowOnly.xshad and connect it to the Rectangle:
Set the Transparency property of the shader to Normal(1):
You can adjust the opacity of the shadow using the Opacity property.
The image on the right shows the current settings for this shadow:
We see that the Sphere is now casting a shadow but it looks a bit too dark in this environment.
To add more realism we can add Ambient Light to our scene as well:
More on lights here.
This is the result:
Adding Reflections
To be able to add reflections to the scene we need to add a reflection plane:
Select the Shadow Catcher's Scene Node and Rectangle.
Press Alt and Drag-n-Drop them to duplicate.
Disconnect the Transp_ShadowOnly shader from the duplicate.
Add a [Common]:Shaders\Mirror\Mirror_Flat.xshad shader and connect it to the rectangle:
Follow the instructions on adding Planar Reflections here and connect the MIRROR-1 tunnel to the Mirror Image input of the shader:
Set the Transparency property of the shader to Add(2):
Placing the Reflection
As the Shadow Catcher and the Mirror Catcher are at the same location only the Shadow Catcher will be visible.
Select the Mirror catcher's Scene Node and raise its height by 0.001 meters.
In the case of floor reflection, I have moved it from 0 to 0.001 meters:
And in the case of table reflection, I have moved it from 0.75 to 0.751 meters:
Your flow editor should look like this:
And your output should be something similar:
To make the reflection more realistic you can have a look at our Planar Reflections documentation.