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.

Filter by
Sorted by
Tagged with
1
vote
0answers
28 views

How can I create a shader which makes an object transparent in bright light and opaque in low light?

I'm trying to set up a shader that, as the title says, functions similarly to the effect appearing in the "Lights Out" horror short film. Cut down to the very basics, I'm looking for advice ...
0
votes
0answers
10 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
1answer
72 views

How to calculate the shadow bounding box with a directional light

I'm trying to implement a directional light in my C++ / OpenGL engine, but I struggle to calculate the shadow bounding box (i.e the shadow frustum). The bounding box has to encompass the main frustum ...
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
1answer
42 views

How to lerp between diferent spot angles

I have this code that Change spot angle randomly between 'minAngle' and 'maxAngle' each 'interval' seconds: ...
0
votes
0answers
11 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
22 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"...
1
vote
0answers
80 views

Unreal 4 - Static mesh has strange, glitchy shadows?

The first image below shows my mesh in Blender with the Blender lighting, and the second image from inside UE4 has this weird shading on it. Is there any way to help it look like the first image? I've ...
1
vote
1answer
33 views

Unity Light Bugs in Android

I was testing my game, so I made a build to test it on my phone. I noticed that when I play in an android build, it is so darker than when I play in the editor or in a PC build. It looks like this in ...
0
votes
0answers
64 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 ...
1
vote
0answers
24 views

Perspective of a Point Light

I'm trying to calculate shadows by projecting the silhouette of each object seen by the light source. (The shadows are just going to go on planes.) To get each silhouette I take a snapshot from the ...
0
votes
0answers
27 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
1answer
39 views

Lights beyond the fourth do not appear?

In my scene there are 6 point lights. But 2 of them do not illuminate my floor plane. If I disable any of the working lights, then one of the non-working lights starts working. It's like my level can'...
0
votes
0answers
14 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
50 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 ...
5
votes
1answer
1k views

How is this lantern glow effect achieved?

I was wondering if anyone knows how this lighting effect is achieved. It's clearly not a bloom shader. My best guess right now is that it's a billboarded transparent sprite, which is animated to give ...
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
30 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. ...
5
votes
1answer
875 views

Invert the colour of pixels where 1 bit sprites are overlapping

I have a simple scene in Unity that makes use of some simple art that uses either white or transparent colours to create a 1-bit art design. The image below shows this. I want to have a that if two ...
0
votes
0answers
14 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 ...
1
vote
1answer
37 views

How to use a normal map for light effects with an AnimatedSrpite?

I am trying to add light effects with normal map on an AnimatedSprite. I was following that tutorial but with no success. I am using a Ligth2D, this sprite sheet: ...
0
votes
1answer
95 views

How to get light level (brightness) of a particular location?

I'm making a 2D top-down survival game similar to Rimworld, I'm trying to emulate a day-night system. Many features depend on whether any tile is light (or dark) ...
2
votes
2answers
193 views

How to implement pixel art lighting as in the game Project Eastward?

Project Eastward Lighting Demo Can somebody point me to the right direction as to how this lighting is done to recreate this lighting effect? The game is 2D but uses a 3D lighting system.
1
vote
0answers
187 views

Baked lightmap: Parts of scene appear too dark

I'm having trouble setting up global illumination in my Unity 2021.1.1 URP project Parts of my scene are appearing completely dark, I'm only using directional light and area light on the windows, here'...
0
votes
1answer
16 views

Lights not displayed on Sprite

I have a scene that contains 3 elements: Main Camera A 2D Sprite that renders a single white pixel image, scaled to 2000 x 1000 A point light with a yellow color What should be done so that the ...
0
votes
1answer
64 views

How can I make 3D lighting smooth?

I'm trying to view 3D objects in a terminal. Everything was looking good until I implemented lighting. I'm using shadow rays to determine where the object should be lit. Although it's working I don't ...
0
votes
0answers
33 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?...
1
vote
1answer
560 views

Weird blue shine on URP Lit shader Unity

I recently started to use URP and I am noticing a weird blue like tint on shiny objects that use the URP/lot shader and I can't understand what it is and how can i remove it.
1
vote
1answer
27 views

How do you simulate UV light and materials with UV-reflective/fluorescent properties within a PBR renderer?

I have a PBR setup, say, in Unity (or Unreal, doesn't really matter, I'm asking about the general principle, not specific implementation), and I would like to add a UV light source, and have control ...
0
votes
0answers
14 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 ...
1
vote
0answers
43 views

What is the best way to bake my own environment maps?

My engine has support for IBL by using pre-obtained HDRIs. It looks fine, but... I want the environment map to match the scene that is currently being rendered I want the environment map to take the ...
1
vote
1answer
259 views

How to make 2D lighting in JavaScript

I am making a recreation of the 2D voxel game Terraria in JavaScript. Like most sandbox games, Terraria has lighting, but because I am using JavaScript, performance is going to be an issue. I have ...
0
votes
0answers
49 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, ...
1
vote
1answer
119 views

Issues with referencing experimental light class

I am trying to reference a Light2D component on a GameObject but I get the following error: ...
1
vote
1answer
138 views

Why real time lightning fails to show shadows on terrain in Unity?

I'm using the TerrainTools unity package to create a simple 500x500 terrain, and placing a simple character that moves around, however, by default, the lightning is at real time mode, and the shadows ...
1
vote
0answers
20 views

Trouble with Normal Matrix and Point Lighting

I'm having issues with lighting in my game. For some reason, no matter what I try, point lights appear to cut off halfway through the center of the light. I'm trying to render this light on a quad. ...
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
1answer
37 views

Unity: What does the green line gizmo signify?

When I place a point light it shows this green gizmo that ends in the terrain. What's the name of this gizmo? What does it signify?
0
votes
1answer
108 views

UNITY : how to pause baking and quit project?

How to pause the lighting bake and quit the project ? so when i re-open the scene it will continue baking without have to start the bake from beginning ? I need to take a break to do other job on my ...
0
votes
0answers
50 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 ...
0
votes
0answers
196 views

Update shadow caster 2d points in script

Using the Universal Rendering Pipeline, how do I update the points of a ShadowCaster2D through script? I presume I could have a singleton manager that would contain ...
2
votes
1answer
121 views

Why should every light source have its own ambient light?

I'm currently learning how to use OpenGl, and I'm following a tutorial on learnOpenGL. I'm at the lightning chapter, and it has introduced basic lightning, ambient and diffuse with specular highlight. ...
0
votes
1answer
58 views

Unity Unable to blend 2D Light renderers

I've followed the documentation on Unity regarding 2D lighting. It said to turn on Alpha blending in the options. But this is how it turns out: If Alpha blending is off: If Alpha blending is on: I'm ...
1
vote
1answer
386 views

Using a mesh stencil with 2D lighting in the Universal Render Pipeline

I've followed the CodeMonkey tutorial on using a dynamic mesh as a stencil for a field of view or visibility polygon effect, and have got it working using the latest version of Unity and its Universal ...
0
votes
1answer
980 views

After baking my lights again in Unity, my character is black?

I had to re-bake my scene several times before getting the look that I wanted. This last time, the scene looks great, but my characters are now very dark and the playable character is completely black....
1
vote
1answer
108 views

Why does my game look different on my mobile device than in the editor?

I am new to Unreal Engine. My game in mobile looks totally different than in Unreal Engine editor. In Editor: In Mobile: Is this a symptom of something obvious? How can I make it so that what I'll see ...
0
votes
0answers
432 views

How real time volumetric light beam effect could be achieved in opengl?

Here is 1.5 mins long video to give you an example of what I meant. From research that I did , regarding lighting effect, usually it is done offline (post-processing) using algorithms like "god ...
0
votes
0answers
253 views

3D Object in 2D Unity Project

Is there a way to bring 3D objects into a 2D project that is using the 2D Universal pipeline for rendering light? I have some 3D objects I want to bring in to the project I'm working on, but they just ...
4
votes
1answer
95 views

Issue with specular light at highly oblique angles with Blinn-Phong

I'm having an issue with my basic Blinn-Phong renderer, when looking at objects at very oblique angles: I don't think this is an issue with my code, although I'll post my fragment's GLSL below. ...

1
2 3 4 5
14