Spot light doesnt work for virtual reality in unity Urp - unity3d

My point lights renders in unity but it wont render in the oculus headset. What could be the cause. I Could not find a solution online.
I am using URP

Add more details if possible, are you using baked lighting, mixed, realtime? It might be your light per pixel setting.
Try to disable any other light in the scene and leave only the spotlight, increase the spotlight range and check if the spotlight works.
If it does, then it's your light per pixel/vertex count, you can edit it from your Settings folder, opening up the URP profile you're currently using, it's called Per Object Limit:
Do not go beyond 1 on the Quest and bake lights if they don't have to be dynamic.

Related

How to optimize lights in Unity

I'm building a virtual exhibition platform in unity. There are about 50 stalls and I used a directional light and 124 point lights light up the scene. I didn't use any real time lighting, only baked lighting is used. But at runtime frames get dropped. when I inactivate all pointlights it works smoothly. How can I optimize lights?
You can improve your performance by doing the following,
Add Light Probes, this can minimize the number of point lights in use.
Change Render Mode to Auto, this will reduce the load significantly in your case as there are a lot of point lights in use.
Apply a culling mask, make sure the light affects only the required object in the stall.
Use Fake Shadow instead of using Soft Shadow.
Switch to URP or HDRP.
Alternate way :
Build and bake each stall separately in Blender or Maya. Then add them to unity. This way you don't need to add that many point lights and bake.
124 Point Lights that is a LOT of lights, but you could use Deferred Rending path on your Camera (but if you need VR I'm not sure its supported).. You can set the Point Lights to be Baked, use Baked lighting and light probes instead. Set everything that won't move in your scene to be Static objects (very top right corner box). also remember to go into Rendering -> Lighting and Generate the Lighting and look at the options presented there.
Light probes video

Unity rendertexture only renders a solid color

I'm making a game in Unity 2019.1.6f1 PC, Mac, Linux standalone. I want to project the game unto the pages of a book and believe that render textures can help achieve this.
They worked reasonably well on the placeholder book model, but when I try to apply the same render texture on a different model, it only seems to project a blown-out single pixel.
Here I placed them close to eachother to show the problem:
I made screenshots of all the settings that may be related, though I did try to change all of them already. If any other information is necessary, please let me know.
The camera settings
The material settings
The mesh renderer settings
The texture settings
I tried changing the size variables to powers of 2, but that didn't work either.
I also found this post, but I don't believe this is the same problem.

Lights not doing anything

I'm working on a project and no matter what light I put in everything stays the same. It won't even show itself unlit. Also yes the scene lighting is on. I have tried altering Pixel Light Count nothing works -100 - 100. I turned off my scriptable render pipeline too and even that didn't work.
No lights in scene Light in scene scene lighting on btw I've used this specific scriptable render pipeline before and it works but I disabled it anyway.
My render pipeline was set in one place but not the other small problem easy fix.
Essentially go into setting and if your using HDRP make sure it says HDRP under render pipeline and then check under the lighting assets to see if HDRP is enabled.

Unity light breaking in build version

So in unity you can bake lights and you have to make the gameobjects static so they get a lightmap
So I did made my objects static and bake the scene light.
The result in the editor and in editor play
this is what I want
But when I build the game I get this
there is no light at all or its just spread all around the floor
The floor gameobjects are just primitives with a texture
I tried to reacreate the bug by placing some gameobjects and lights in a new scene
in both editor and build there was no problem
I used the default camera to make sure its not a issue with the camera on the play but no matter what I do it has the same effect on the previous scene.
I tried making the direct samples bigger inderect samples bigger and enviroment samples bigger
also the lightmap size bigger but nothing works.
LightMap Settings
Quality Settings
Okay so they way to fix this is go to
Edit > Project settings > Player
go to other settings and disable lightmap streaming
You need to disable it because huge maps like mine generate a lot of lightmaps and streaming all of them in runtime is really slow and so the lightmaps is really low res

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: