URP Shader Graph shaders time node doesn't work in certain situations - unity3d

I have several shaders that use the Time node to animate certain UI elements for my mobile game.
In certain cases (which I am unable to reproduce), the shaders will be stuck on a specific time and not animate.
For example, a shine shader might be stuck mid-shine.
Some important things to note:
Time.timeScale is 1 - all my tweens using scaled delta time are working correctly
When this happens all shaders using the time node in the active scene will "freeze in time"
This only reproduces on actual Android devices (iOS untested)
All parameters affecting time in said shaders are positive, valid numbers
There are no errors or warnings
When I transition from my main menu scene to the game scene, time based shaders will work correctly - when I come back to the main scene, it will reproduce again (obviously it's something specifically there)
Running on Unity 2019.4.11f1 with URP & Shader Graph 7.5.1, but it did reproduce in older versions of Unity/URP as well
Sample shader - The preview actually looks exactly like the issue as it will appear in game when frozen:

For any lost souls who stumble upon this issue (although I doubt it's by design as it seems like a bug).
The problem is that time isn't updated in shaders in scenes without a camera.
The camera doesn't have to render anything; it just needs to exist.
My main menu is pure UI elements and had no camera; adding a camera to the scene fixed the issue.
It is important to note that this behavior only happens once you build to an Android device; not sure if it reproduces on other platforms.

Related

Unity bloom effect not working (cinemachine, URP)

I've been working on a fairly large project in Unity. Until recently, we weren't using universal render pipeline (URP) and made that change. When we did, all the bloom effect we already had in place to create a neon glow look for our game disappeared, and everything looks opaque. All the tutorials I found say that it's fairly simple to add this effect, but I can't make it work. I'm starting to get suspicious of the Cinemachine in the main camera, since it's brought us problems in the past. I'll just state some of the things I've tried:
The post processing checkbox is ticked in the camera view.
My materials have emission turned on with colors that used to work before URP.
The camera has the volume component, with an override of bloom and the values of intensity and threshold super high.
I've also dropped a global Volume in the scene with a volume component with bloom effect (one solution suggested I do that)
I think that's everything. Please let me know of any suggestions!

VR Headset issue: objects displayed in one eye because of default shader. (in my case TextMeshPro shader)

I have:
Unity
High Definition Render Pipeline (HDRP)
Single pass rendering (no ability to change)
VR Headset
Part of objects displayed only in one eye.
Investigation show that the reason of this -- non-compatible shaders for such environment. For particle system I have resolved such problem with own shader created using ShaderGraph (below is solution)
But My problem of this question is:
I have no idea how to write correct shader for TextMeshPro Text.
Can anybody help with this?
THIS FIX WORKS FOR PARTICLE SYSTEM one eye issue: Shadergraph shader (works well with transparency, Color over lifetime, etc)

Light Baking Issue

Before I have real-time lighting because of the performance issue, I decided to do light baking for my 3d game.
So I have mark 3d environment as static because it remains on screen always without movement.
Also changed direction light mode to Mixed because I have few moving game objects too.
But after the baking process gets completed, I got this kind of output:
In above, you can see in the above image what happened with my environment after baking and I have also included light settings if you need it.
You have to enable lightmap UVs in your 3d imported model file.
I got this reply from one Unity forum member so exact wording, I am posting here:

Why sometimes ImageTarget isn't recognize?

I'm using Vuforia with Unity and I try to track an ImageTarget( that with stones from Vuforia site). The problem is that sometimes (in 20-30% of cases) it takes like 10-20 seconds to recognize the ImageTarget even if I put it very clearly in front of the camera. Other problem is when the ImageTarget disappears from the scene and reappears sometimes works perfectly sometimes not. Any suggestion why this is happening? (I'm new in Vuforia)
If its default project without your scripts - then may be quality of your camera is not enough to track correctly image targets all the time. Also vuforia sometimes has bug with loading resources with image targets but if you do not reload app and image been tracked it is only quality of your camera.

Physics messed up with cardboard scene in Unity

I am in the process of putting together an app using the Google Cardboard SDK. The user will be able to use the app with or without cardboard. So, there is a switch button inside the app, that activates and deactivates stereo rendering.
The app also uses the Vuforia SDK to track image targets. If a specific target is recognized, some 3D objects above the target and a particle system starts to emit particles.
Everything works fine in non-stereo mode. Particles are emitted and falling correctly as intended. They should simulate snow. Also if the user turns the image target to an angle, the 3D objects above fall down.
When switching to stereo mode, the physics are messed up completely. The snow particles are not falling anymore, they seem to "teleport" around the screen. Also the 3D objects do fall upwards, with a really heavy negative gravity. Timescale seems multiplied several times, but is not - I double checked that. Gravity also does not change when switching between non-stereo and stereo rendering.
Everything works fine in Unity Editor in moth modes. It only appears on the device, which is an iPhone 5.
Cardboard SDK is version 0.52, which is the newest.
Unity is version 5.3.1.
Vuforia is 5.0.6, which is not the newest, but release notes do not indicate a fix concerning physics. Will update it anyway as a next step.
Vuforia is 5.0.10, which is the latest version.
I double checked gravity and timescale, which are not changing when switching between modes. I have a hard time figuring out what might cause the physics to mess up.
EDIT:
I did some further investigations. I made me a little gizmo sitting always in front of the camera but getting the rotation of the Unity world space axes, so I know the 3D-world is oriented in relation to the camera. And it turns out, that when in VR mode with the Google cardboard camera system, the world does spin around the camera heavily. I managed to hold the test device in a way, so it is slowing down and almost freezing, but I have no explanation for the effect yet.
I managed to get my setup right again. Unfortunately I did not find the source of the weird behavior. But By deleting the Vuforia Prefab and the Cardboard Prefab and adding them again to the scene, the problem was solved.