I have an issue where my skybox lighting in the scene and game windows rotates when my character rotates. The game has a top down view and is running in the HDRP render pipeline (Unity version: 2021.3.4f1). I'm currently using a procedural sky. There are no additional lights added to the scene and the camera does not rotate, it just follows the player keeping the player in the center of the screen. At one point it was working fine and the skybox lighting was only ever facing one direction. However, while working on unrelated gameplay mechanics the skybox lighting has now permanently started to rotate with the player character. Why is this occurring and how can I fix this?
Related
First of all, please understand that I am using a translator.
I'm making a first person game and I've split it into two cameras. A camera that renders the main camera and the player's arms. FYI it's a URP and the camera sometimes doesn't render the hand mesh for the player's arm.
I have no idea what the heck is going on.
So I have a HD2D Setup in Unity, meaning a 3D world containing 2D sprites (billboards). I am using URP and created a Lit Shader with the following configuration:
This Shader is attached to a material and this material is attached to my sprite. My problem is, when I rotate the global directional light, the sprite with this shader attached has sort of a delay in adjusting its darkness to the global light (in the video, the environment is bright (morning) but the sprite is still very dark in color (see next picture) and vice versa). This behavior can be seen in the video I uplaoded here:
https://www.youtube.com/watch?v=uAm71ftfy2Y
Desired outcome:
The sprite gets darker as the sun fades (similar to the white Quad that can be seen in the video scene).
Does anyone have an idea which setting I need to tweak here? Thanks for any advice.
I figured it out. For some reason, URP Pipeline was not set under Edit-->ProjectSettings-->Graphics. Once set, I was able to set [X] Will be affected by shadows in shader graph. This solved the problem
This is a screenshot of the original Game scene the cube is white :
and this screenshot is of the directional lightning in the same Game scene :
Then this is the same scene with the same cube settings and directional lightning settings after i loaded the scene from another scene by pressing a button :
and the directional lightning. to make the cube white again i need to change the directional lightning intensity value from 1 to something higher.
If every object settings are the same camera , directional light and the cube why when loading the scene from another scene the cube is not white and i need to change the intensity value ?
Maybe because in the scene i'm loading the Game scene from the main camera Clear Flags is setting to Solid Color and also the Background is not the same as in the Game scene ? but why is that will make any changes when loading the Game scene ? I'm not sure what is going on. also when i'm loading only the Game scene and running the game only with the Game scene everything is fine with the cube only when loading the scene from the other scene then this cube change happens.
When render pipeline you're using?
If it is URP, you have to set it to lit version of the shader if you want it to be lit by the light present in scene. If you decide to set it o unlit, it remain the same in all cases.
I'm using Unity2021.3, and this is a URP project.
There is a 3D sprite in the scene that receives and casts shadow, the material for its spriteRender uses a shader that is a simple modification of Unity URP Simple Lit, and there is a spotLight in front of the 3D sprite with shadow enabled, and there is also a directional light in the scene. The 3D sprite casts shadow on the ground due to the directional light and the spotLight, everything is correct.
But if I switch to a new shader, it seems the SpotLight passes through the 3D sprite, rendering the shadow incorrectly, if I move the SpotLight to make it far away from the 3D sprite, then it seems the shadow is correct.
Please see the attached screenshot, the top three screens are custom shader, below two are the URP Simple Lit variant.
I'm wondering what the problem is with the new shader?
Thank you so much.
I have three objects in a scene: a grass cube, a sky cube, and a brick cube. All the objects are in the same layer, and it appears that they are correctly aligned in space to show properly. Actually, the camera preview shows them right, but then in Game mode somehow one of the cubes, the sky in this case, always shows in front and overlaps the brick.
What bothers me specially is that in the tiny Camera Preview window it's showing correctly, but then in the Game it's not.
Any idea why could this be happening?
http://prntscr.com/6iez5a