Render Shadows in AR in Unity with URP

  Рет қаралды 4,081

Dev Dunk

Dev Dunk

Жыл бұрын

Shadows can add a lot to AR experiences!
In this video, I will show you how to quickly get shadows working in your Unity AR project. This will be done with an asset for the Universal Render Pipeline (URP) on the Asset Store, with both a Free and Paid version available.
This shadow-receiving shader graph works on all devices (Android, IOS, Windows, Etc) and all AR frameworks (AR Foundation, ARKit, ARCode, Vuforia, Lightship ARDK, etc)
Downloads (affiliate link):
Shadow Receiver URP (Better Quality): assetstore.unity.com/packages...
Shadow Receiver URP (FREE): assetstore.unity.com/packages...
Base project:
github.com/smitdylan2001/Shad...
-Subscribe for more!-
My social media:
Discord - / discord
Itch.io - devdunk.itch.io/
Instagram - / devdunkstudio
Twitter - / devdunkstudio
Facebook - / devdunkstudio
#AugmentedReality #Unity #GameDevelopment

Пікірлер: 25
@DevDunkStudio
@DevDunkStudio Жыл бұрын
If you have any questions let me know!
@slow-wind
@slow-wind 9 ай бұрын
Thank you. You've simply solved my problem. Thanks to you, I learned something good.
@DevDunkStudio
@DevDunkStudio 9 ай бұрын
Good to hear! If you enjoy the asset a review is always appreciated
@HYETUSENGINEER
@HYETUSENGINEER 2 ай бұрын
I purchased your asset and I'm using it with Unity 2022.3 LTS, the AR Foundation template SampleScene, an Android phone (Pixel 6a), and I have Transparent Receive Shadows on. In this scene the XR Origin (AR Rig) contains the AR Plane Manager script and the default plane prefab "ARFeatheredPlane" has two materials: ShadowReceiver and OcclusionMaterial. When I replace the default ShadowReceiver with your ShadowReceiver.mat and build to the phone, the shadow planes appear to be missing their material (magenta). I must be doing something wrong. Could you help me out?
@DevDunkStudio
@DevDunkStudio 2 ай бұрын
Hey there Sorry to hear you are having issues. I have a few questions. If you want to add screenshots you can do so on Discord. - Do the planes also show up like this in the editor? - Are you using v4 of the asset? - Did you update the asset without deleting the previous version? - Are you on the latest 2022.3LTS? Does it work when you remove the occlusion material (for now), so it just has 1 material on it? - Which components are on this plane? I am not sure if a custom feathered component will break the shader. It should be a regular plane.
@Kskospo99
@Kskospo99 2 ай бұрын
Great Bro, but i have a problem when I am going far the shadow it not visible and when I came close the shadow is visible. please tell me how can I fix it?
@DevDunkStudio
@DevDunkStudio 2 ай бұрын
In your used URP asset, increase the shadow distance. This might decrease sharpness, so if you do this a lot you might need to increase resolution or cascade count
@Erik123211
@Erik123211 7 ай бұрын
Does the paid version support spot light shadows?
@DevDunkStudio
@DevDunkStudio 7 ай бұрын
Yep! Spot and point lights are both supported. There is a fix coming up that solves some issues with the additional lights as well
@Higameing212
@Higameing212 11 ай бұрын
what is your gradle version please help me
@DevDunkStudio
@DevDunkStudio 11 ай бұрын
Gradle is not related to this project, but maybe this will help: If you use Unity 2022LTS you need to install the android module and both submodules from Unity Hub. Then use these to build your AR Foundation projects. For Lightship, I suggest to use ARDK 3 (using AR Foundation) in Unity 2022LTS with the same setup as above. For ARDK 2.X use 2021LTS combined with gradle 6.7.2 or 7.2 or close to it. Just the version mentioned in the docs
@niederbayer2141
@niederbayer2141 3 ай бұрын
We bought your asset a while ago for AR on iOS and it worked fine. Now we tried it on the Apple Vision Pro and there it doesn't seem to work in the Mixed Reality Scene. Do you know why?
@DevDunkStudio
@DevDunkStudio 3 ай бұрын
AVP sadly has very limited shader support. I don't have a mac to test the shaders sadly. If I have one I can see what does and does not work with the AVP emulator. I think future releases of the AVP tools will improve compatibility as well.
@niederbayer2141
@niederbayer2141 3 ай бұрын
@@DevDunkStudio Just found out it works a little different on the Vision Pro because in the background RealityKit takes care of the rendering. I just had to add the component VisionOSGroundingShadow to the mesh renderers to signal RealityKit that it wants to throw a shadow. And then I didn't even need a shadow plane anymore.
@DevDunkStudio
@DevDunkStudio 3 ай бұрын
@@niederbayer2141 Nice! Good to hear you got it working. Just to double check, this is not with my asset, right?
@niederbayer2141
@niederbayer2141 3 ай бұрын
@@DevDunkStudio Yes correct. All you need is a mesh renderer and that component.
@DevDunkStudio
@DevDunkStudio 3 ай бұрын
@@niederbayer2141 Thanks! I will keep that in mind when people ask
@DogLancelot
@DogLancelot 9 ай бұрын
Hello Dev Dunk. I bought your Asset today (thank you for that, it is very easy to use), but unfortunately it is not working for me (AR scene). What I am doing wrong? For example if I use the ShadowReceiverTransparent, no shadow is visible. When I use an ShadowReceiverOpaque shader, then the plane is not visible (which is good), but I have only dark black hard shadows which I cannot change. Cast shadow is on. Renderer is URP and build is on Android (for now). Can you please help me out, it would be awesome, thank you very much! Greetings 🙂
@DevDunkStudio
@DevDunkStudio 9 ай бұрын
Thank you for the purchase! In the active URP renderer, did you enable 'transparent receive shadows'? Also make sure you only use 1 urp asset and renderer when setting up a project to make maintenance and troubleshooting easier. There are some extra troubleshooting steps in the included documentation. If that doesn't help let me know and we'll troubleshoot it further.
@DogLancelot
@DogLancelot 9 ай бұрын
@DevDunkStudio Hello, thank you for your quick response. Yes 'transparent receive shadows' is enabled and I have just one renderer (URP with ´AR Background Renderer Feature" put under Render Features (otherwise I would have just black screen insted of my phone camera)). What do you mean with ´documentation´? The PDF file inside the DevDunkStudio folder? If yes, I tried it. UPDATE: Interestingly, it works when I use ShadowReceiver from Demo folder (subfolder ´Materials´) and drag and drop it onto my plane (ground for shadow receiving)
@DevDunkStudio
@DevDunkStudio 9 ай бұрын
@@DogLancelot interesting. Before this you made a new material and assigned the shader to it? If so, maybe the alpha of the color is blank? Otherwise you can export the scene with the broken material and send it to me so I can look into it more.
@DogLancelot
@DogLancelot 9 ай бұрын
@@DevDunkStudio Thank you very much. I just drag and dropped the ShadowReceiver to the plane. Thank you for your offer, I just want to first check something, because it looks like my light is only working when it is a directional light. No other lights work. Something is really weird in my scene.
@DevDunkStudio
@DevDunkStudio 9 ай бұрын
@@DogLancelot In the URP asset make sure that cast shadows is enabled for additional lights, and that the light count is at 8 (for debugging, reduce it later for performance). Then make sure casting light is enabled on every additional light in the scene, as this can be disabled by default. Does it work in the additional light demo scene?
Perfecting Shadows in Unity: Introductory Guide with Troubleshooting!
12:44
Fist Full of Shrimp
Рет қаралды 4,4 М.
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 64 МЛН
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 22 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 16 МЛН
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 34 МЛН
Why Do Video Game Studios Avoid Blender?
6:49
The Cantina
Рет қаралды 424 М.
How to Setup Unity AR Foundation 4+ in URP
12:26
Dilmer Valecillos
Рет қаралды 12 М.
I Melted Wood With Friction
8:44
The Action Lab
Рет қаралды 739 М.
How I Implemented Shadows in my Game Engine
7:45
ThinMatrix
Рет қаралды 95 М.
The REAL Reason Unreal Engine VFX Looks FAKE
6:58
Joshua M Kerr
Рет қаралды 363 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,4 МЛН
Why Solo Developers Should Use Unreal
10:55
Thomas Brush
Рет қаралды 338 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 6 МЛН
Top 50 Amazon Prime Day 2024 Deals 🤑 (Updated Hourly!!)
12:37
The Deal Guy
Рет қаралды 1,4 МЛН
Зачем ЭТО электрику? #секрет #прибор #энерголикбез
0:56
Александр Мальков
Рет қаралды 625 М.
Сколько реально стоит ПК Величайшего?
0:37
Что не так с раскладушками? #samsung #fold
0:42
Не шарю!
Рет қаралды 208 М.