ARoverlay function

 

Hi, brother. I have tried to link the render general node to ARoverlay pin of unreal virtual cam according to the official tutorial about combined rendering. But the AR output will always floats on the top layer of the scene without shadows, which is so weird. Please tell me how to fix it. 

Besides, I wonder how to achieve the effect below. Thank you.

Is the scene real or virtual?



   Fullman

 
Profile Image
Fullman
  -  

Hi,brother. Please help me. I am waiting for your reply online. haha.

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

The floating is probably caused by the AR object being in a slightly different position than the Unreal object's surface. To really blend the two different renderings into one, you have to know where is the Unreal object's surface's position and put the AR object rendered by Aximmetry exactly there.

To render the shadow of a model in Aximmetry, you can use this shader with a Rectangle module or with any other model: [Common]:Shaders\Special\Transp_ShadowOnly.xshad

The 3 screenshots you posted most likely have a real-world background and AR camera compound. This tutorial scene for example has the same graphics as the first picture: [Tutorials]:AR\AR_Example.xcomp
Nevertheless, you can do this with an Unreal scene using the AR Overlay pin.

If you make a screenshot of your flow editor and post it, then I can probably give more specific help.

Warmest regards,

 
Profile Image
Fullman
  -  

Thanks for your reply, brother. I don't have an AR camera or any trackers. So I just want to explore the ARoverlay function. I have tried linking the nodes but still confused.

There is no shadow and it always on the top from any angle. I have checked their postions. They are all at 0,0,0 point. And I have turned on/off the Allow Virtuals or the AR Overlay Behind but still makes no difference. Below are my Nodes linking. Please help me.



Below are my Nodes








 
Profile Image
Fullman
  -  

I just use the 3D Bar xcomp of the Aximmetry application and only copy the nodes out.


 
Profile Image
Eifert@Aximmetry
  -  

Hi,

The reflection hides the Unreal scene cause the shader of the reflection is on opaque settings. You can make it transparent by setting Transparency to Normal and Opacity to 0.01. Also, turn Off Cast Shadows and Recieve Shadows:


For the shadow, you can duplicate the Rectangle used for the reflection and add the [Common]:Shaders\Special\Transp_ShadowOnly.xshad shader to it. Then set Cast Shadows to Off, Transparency to Normal, and Depth Write to Off:

Then you can change how the shadows are generated in the Directional Light module:


Ar Overlay Behind can change if the billboard is rendered in front or behind the Aximmetry rendered objects. For this Allow Virtuals needs to be turned off so that the Billboard is also rendered by Aximmetry:


When Ar Overlay Behind is turned on. I intentionally turned off the billboard's shadow here, cause the billboards shadow won't affect the Ar Overlay:




Note, that the surface of this rectangle-like cube is not at 0,0,0 point, as it is not fully flat. So to make the bars perfectly fit the surface, you will probably need to move them higher. You could in Unreal put a rectangle on top of the surface just to read out the height, after which you can delete it. In Unreal everything is in cm while in Aximmetry everything is in meters, so you need to multiply the height in Unreal by 100 to use it in Aximmetry:

Note, that the reflection is only drawn on one side of the rectangle, so if you are under the reflection's rectangle, you won't see any reflection. In a real-world situation, it is very unlikely you would want to go under the reflection's rectangle and still see the reflection.

Warmest regards,


 
Profile Image
Fullman
  -  

Hi, bother Eifert. I am here again and I truly appreciate your timely help. I have made it to show shadows. But there is still a problem. The shadows will gradually disappear when I slightly change the camera angle. I want to know how to fix it.




 
Profile Image
Eifert@Aximmetry
  -  

Hi,

Maybe the reflection receiving shadows are interfering with it. You should have shadows turned off on the reflection's shader:

Sadly, even in my previous post's screenshot it was incorrectly turned on, so I just now edited my previous post to correct it.

Otherwise, the camera's movement shouldn't change the shadow and I couldn't reproduce this phenomenon.

Note, by pressing down CTRL and moving the mouse over a pin or connection, you can peek at the connection's current value:

You could check if the shadows gradually disappear in the image before the Virtual Camera compound by peeking like in the above screenshot.
And you can even
enter the Render_General compound and see if some of the video mixings of the rendered layers are causing this issue.

Warmest regards,

;