Questions tagged [lighting]

The simulation of light and illumination in games, including its interaction with the environment. A core element of games that can bring out vivacity into otherwise static worlds.

146 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
326 views

Why a point light not cast shadow on my moving object, but only on static?

In my Unity3d scene i've two light: a directional (sun, outside the window) and a point light. In my scene, I can see shadow correctly, also if i "play" with settings like Intensity or Range. But in ...
1
vote
0answers
58 views

Export baked lightmaps from Unity to Monogame

I'm trying to bake lightmaps in Unity, export as textures and apply the textures in Monogame. Is this the right path to go? If so, how it should be done? Thank you.
1
vote
0answers
33 views

Unity - What changes to a game object trigger baked lights to need a rebake?

I've noticed that sometimes when I make changes to game objects in scenes that have baked lights that the baked shadows will no longer be in effect and dynamic lights will instead be showing. ...
1
vote
0answers
353 views

Lighting, shader and GI is messing up the materials in Unity3D

Hello Guys I am not very sound with Unity3D Lightmapping. Currently I have a set of low poly items in my scene. Textures on my models are getting washed out. They totally look absurd. here is a ...
1
vote
0answers
1k views

Unity Lighting in 2D, block light source

I'm making a 2D game in Unity, and I want to have characters walking around with flashlights. I've set the 2D sprites to a a Sprites/Diffuse material so they can using unity's lighting system. I want ...
1
vote
0answers
81 views

How to mitigate this strange pattern shown in Phong lighting?

I am creating an entire lighting scene in OpenGL. The entire scene consist of only one point light. I noticed some strange z-fighting like pattern. This flickers when I move the camera. Can anyone ...
1
vote
0answers
1k views

Lighting doesn't work properly in WebGL build only at one place

So I have a 2d game where a player walks around the level (top view) with a flashlight in front of him. Everything works fine in the editor, however whenever I build it for WebGL and test it in my ...
1
vote
0answers
216 views

Combine diffuse map and lightmap into one texture file

Working with Unity, I'd like to do some more memory optimization. Currently, my 3D models have a diffuse texture and a lightmap, both at the same resolution and compression. I was wondering if there ...
1
vote
0answers
497 views

Opengl - SpotLight shadow map issue

I have a light / shadow system that implements a spot light too. Every lights are working fine, but the spot light is acting weird. If i dont use any type of "shadow softening" method, it works ...
1
vote
0answers
106 views

Why do I get white highlights at the edge once light build complete?

Whenever I build my lights in Unreal, why do I always get white highlights at the edges? I can't seem to solve this. I get this problem with both static and stationary lights. Can someone please help? ...
1
vote
0answers
51 views

Can I make global illumination from directional lights only affect their assigned layers?

I have a large space station scene, where there are giant mirrors that are sources of reflected light, and to emulate this, I made directional lights attached to the mirrors with cookies to make them ...
1
vote
0answers
44 views

Light intensity on plain from angle

Given a vector (v) for the direction of light and a vector (n) for the normal of a plain. How can I calculate a rudimentary intensity value (i) where ...
1
vote
0answers
749 views

Why does my Point light turn off if Player walks in any direction in Unity 2D?

My 2D Sprite has a material, Sprite diffuse attached to it. Now when I set up a light, it works but if I play the Game and walk, the light turns off immediately and the Player turns black. The ...
1
vote
0answers
823 views

Unity: Build looks different then gameview: runtime reflection probes not working correctly

Im having a really hard time figuring out how to configure my reflection probes to update in runtime once I build. The game port view looks totally different than the build view. Ive tried turning off ...
1
vote
0answers
263 views

Point Light shows black box & rect (PointLight not working) - libgdx 3D

I am creating a 3d scene currently a box and rect, and trying to enable lighting. When i create a PointLight and add it to Environment everything turns to black color? all i want to do is create ...
1
vote
0answers
1k views

Unity 5 lighting broken

EDIT: I've discovered the cause of the problem and it might make more sense if I continue in another question. To start with unity has decided that lighting inside reflection probe bounding boxes is ...
1
vote
0answers
299 views

How to make lens flare ignore layers work with first person character in Unity 5?

I have a simple lens flare on my directional light (sun) and I would like the flare to only be visible when the sun is directly visible, naturally...But right now with the default ignore layers, the ...
1
vote
0answers
42 views

My Directional light lights the floor of my cave but not the ceiling (concave mesh)

I am developing a small demo with Meshes created from a vertex map. When i put a hole in the mesh (making it concave) the physics work fine but the directional lightning only lights one part of the ...
1
vote
0answers
28 views

Is there a way to control the ordering and grouping of ShaderLab Blend command?

I'm writing a shader in Unity that responds to 3 lights: 1 directional and 2 point lights. The point lights are processed in the ForwardAdd pass (once per light). I need the ForwardAdd pass to blend ...
1
vote
0answers
135 views

Simulating sun 3d direction

At the moment I got the following to simulate the suns direction: ...
1
vote
0answers
334 views

Smooth seams and banding of overlapping lights in deferred rendering

I have finally managed to get on screen multiple lights with a deferred renderer, but the result is somehow disappointing. In particular I have severe banding problem Other than having clear banding ...
1
vote
0answers
858 views

Why is my diffuse lighting changing with camera position?

I am trying to do lighting in view space, but I am afraid I have an issue. I calculate the normals as: N = norm_mat * vec4(vert_norm,0.0) where ...
1
vote
0answers
385 views

Understanding diffuse lighting in The Division

Here is a screenshot of the main character walking under a bright lamp: His hat, that was originaly dark grey, turns completely white. My question is how can such lightsource do this without making ...
1
vote
0answers
63 views

Trouble with Lightmaps When Meshes Intersect

I've been working on making lightmaps for a game on mobile devices (meaning that individual texture sizes cannot exceed 2048 and that file size needs to be as small as possible), but I'm running into ...
1
vote
0answers
320 views

SpotLight in ForwardBase pass using forward rendering

Is there anyway I can force Unity to allow me using a custom shader to render spotlights in a ForwardBase pass (using Forward Rendering Path)? For what I could see ...
1
vote
0answers
1k views

Unity : shader that uses mesh.uv to tile texture atlas and mesh.uv2 to tile light atlas

I'm using a texture atlas and a light atlas to tile a mesh. I have the texture atlas working fine. I can apply textures and create a sort of tile map on my coded mesh. At the moment I'm using the ...
1
vote
0answers
79 views

Implementing Light Volume Front Faces

I recently read an article about light indexed deferred rendering from here: http://code.google.com/p/lightindexed-deferredrender/ It explains its ideas in a clear way, but there was one point that ...
1
vote
0answers
387 views

Unity Pro - Shadow rendering issue

I am using Unity Pro 4.2.1f4 and I always have this sort of glitch. This is due to the shadows and the bias. Even with a low bias this is happening. I've found a thread that talks about that but I ...
1
vote
0answers
692 views

Dynamic 2D soft shadows with concave polygons?

I've implemented dynamic 2D soft shadows from this article on gamedev.net. It uses an image for the penubmra and is fast, physically accurate and looks good in most situations, so I really like the ...
1
vote
1answer
80 views

Distant objects remain fully lit at sunset, when they should be in the mountain's shadow

I'm trying to make dynamic sunrises and sunsets in my game but I have some problems. My scene is surrounded by mountains and when the sun tint is still hot the sun is not visible but, the trees that ...
0
votes
0answers
15 views

vertex vs fragment shader lighting for mobile games

I'm trying to make a 3d game for mobile and after implementing the shaders, I realised that, with only rendering running and a very simple scene, my performances dropped from 60 fps to 30 fps when I ...
0
votes
0answers
41 views

Lights do not fully respect SortingLayers in Universal Render Pipeline

I just installed Universal Render Pipeline (10.5.1) into my Unity (2020.3.15f2) 2D project and believe I have everything configured correctly. I created a new RenderPipeline asset I deleted the ...
0
votes
0answers
65 views

Have object accept shadows cast from other objects without receiving lighting (Unity)

I have a map object with textures (including lighting) baked in. I want to have a realtime directional light shining on my character walking on the terrain such that the character shadow is cast on ...
0
votes
0answers
15 views

Fade in / Show unity lights only at a specific distance from a camera

I noticed that in URP point / spotlights are not initially visible at a distance and then they sort of fade in the closer they get to the camera. I am wondering if I can control this behaviour somehow?...
0
votes
0answers
16 views

Shadows issue in Unity

I am using Unity Built-in render pipeline 2020.3.5 I have a weird shadow projection when pointing at game objects with my flashlight (spotlight). It looks like the shadow is floating or is another ...
0
votes
0answers
12 views

When dealing with Image based lighting, are the generated irradiance map and specular ibl dynamic?

I have been reading about IBLs, trying to understand how they work; so, I can implement them in my engine. I have understood the general concept and the calculation for the diffuse but I am still a ...
0
votes
0answers
24 views

Is there a technique to properly illuminate a PBR material when using directional light?

I use the following formula to calculate PBR color for each light source. For the sake of this post, let's assume that there is only one directional light. I am using Vulkan; so, +Y is "down"...
0
votes
0answers
66 views

How to make a shadow-casting day/night system in 2D URP?

I am trying to achieve a day/night lighting system similar to the game RimWorld. Short preview of what I want can be seen here: https://giphy.com/gifs/VgzcwtjueP7BrYSrXe Instead of using Global Light ...
0
votes
0answers
28 views

Unity Light Bug

I saw this while testing my game. I have a light situated behind the Main Camera. All is working perfect, until I get a Game Over, and changes to the Game Over scene. From then, all lights have no ...
0
votes
0answers
16 views

Are global lighting settings meant to be changed at runtime? Unity

I would like to influence things such as daycycle. Yet it seems that the global lighting settings are meant to be permanent. Can this be done, or is there another way of creating large lighting ...
0
votes
1answer
57 views

Unity baked light messes up a set of objects

On a few objects I use a technique where instead of using geometry, I place planes with a Cutout Material on top of each other, creating a 3D illusion with minimal cost. The thing is, it looks great ...
0
votes
0answers
19 views

Ray tracing Bug with Diffuse material

I am trying to do ray tracing in python (following the tutorial given in Ray Tracing in a weekend). Basically I am shooting rays from eye and the recursively bounce around, each time they hit ...
0
votes
0answers
33 views

The scene becomes dark when reloaded

I have a prototype of a simple game. When I hit a spike, the game restarts, but when it does the whole scene becomes dark. The light intensity level stays the same. ...
0
votes
0answers
15 views

Updated Unity project from 2020.2.1f to 2021.1.7: lighting is messed up, scenes are brighter

I've updated my project from 2020.2.1f to 2021.1.7 (also tried 2020.3.8), and now my scenes are much brighter for some reason: Any tips? Current I use the standard pipeline I think, because the ...
0
votes
0answers
45 views

How can I get my physically based sky to be blue all the way down?

I'm rendering with a physically based sky. I want to get a very simple light blue background but below the horizon the sky becomes grey/brown. How can I get it so that the sky is blue all the way down?...
0
votes
0answers
15 views

Adding lighting to custom vertex shader in Unity

What's the simplest way to add shadow functionality based on the modified vertices, nothing I've found online seems to work ...
0
votes
0answers
54 views

How to make a point light cast shadows in realtime?

I have a solar system... The central star has a point light attached to it. However, objects don't cast shadows on each other... Planets are < 20 units from the star, so it's not a light falloff ...
0
votes
0answers
13 views

Difference in light between Unity 5.5.2f1 and Unity 2019

The lighting is different between Unity 5.5.2f1 and Unity 2019. Please see the attached image. I dislike the way the lighting is done in the 2019 version. Both verions are installed out of the box, ...
0
votes
0answers
20 views

Draw Ordering with Glowing Objects

This is mostly a general design theory question, but for reference the bulk of my game is in JavaScript. I can draw images to the screen that layer on top of each other in the order that I please. One ...
0
votes
0answers
66 views

Implementing DirectX 7 light attenuation in Unity's Universal Render Pipeline

I am create a modern Unity based client of an old MMO from 2000, and I am working on implementing their lighting system. Based on the data I have reverse engineered, it looks like they used a custom ...