google-ar / arcore-unreal-sdk

ARCore SDK for Unreal
https://developers.google.com/ar/
Apache License 2.0
277 stars 122 forks source link

Shadows are present only on specific angle of the device #29

Closed alexandreMarie closed 5 years ago

alexandreMarie commented 6 years ago

Hi everyone,

I've finished my application but one problem subsists.

This is what I want :

arscreenshot_web

And if you move just the device a little :

arscreenshot_2_web

It's clearly a problem of angle because if I maintain this orientation and go far fo the model or close to, the shadows are here. It's really if I'm moving around, all the shadows disapear.

Anyone had this problem and knows how to avoid it ?

Alexandre

bopangzz commented 6 years ago

What GLES level you are using in your app? Have you tried use the other one? I know there were some weird shadow issue on GLES 3.1 in the previous version of Unreal.

Also can you try tp record those positions with this problem and try place the camera and your scene in the same spot and see if you can reproduce the issue in Unreal editor when setting preview level to the one you were using on your phone.

alexandreMarie commented 6 years ago

I'm currently using OpenGL ES2 I will try using OpenGL ES3.1. And I don't understand what you are meaning by record positions ? I have perfect shadows in the editor, no matter the orientation of the camera even in Game View mode.

Thanks for the reply by the way :D

Alexandre

bopangzz commented 6 years ago

I mean try change the editor graphics preview level to GLES 2 and see if you see the same issue in Unreal Editor.

alexandreMarie commented 6 years ago

So I tried both same results. And when I set "Settings"->"Preview Rendering Level"->"Mobile/HTML5"->"Android Preview" AND "High-End Mobile"->"Mobile OpenGLES 3.1" I have effectively no shadows. Which I don't understand because it should. My skylight is in Static with "No Cast Shadows" and one "Directionnal Light" with the following setup : capture

And all my models have this setup : "Movable" (of course I think) and "Receive CSM Shadows" and this : capture2

bopangzz commented 6 years ago

Do you have Mobile HDR enabled? Modulated Shadow only works when Mobile HDR is enabled, if I remembered correctly. Also your light need to be stationary.

alexandreMarie commented 6 years ago

Unfortunately yes :( I will try to have Dynamic Shadows with stationnary lights because when I put my light in stationnary I have no shadows anymore.

bopangzz commented 5 years ago

Have you tried using dynamic shadow? It seems modulated shadow have some bug in Unreal 4.20.

bopangzz commented 5 years ago

I have verified both dynamic shadow and modulated shadow works fine with ARCore in Unreal 4.20. If you still find this is a problem, feel free to reopen this bug.