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
1 answer
57 views

Is it better to cut floor polygons where they're hidden under objects?

I have a floor that's interrupted by several objects sitting on top: Would it be better for performance to let the floor polygons extend straight through the footprints of these objects? Or should I ...
  • 13
0 votes
0 answers
27 views

What is the correct way to set up the Unity URP Pipeline to allow for Normal Mapped lighting to work with Isometric Sprite Tilesets?

I'm attempting to build an isometric RPG in Unity. I'm trying to get this to layer correctly, and to work with Unity's 2D normal mapping and lighting system. So far I have: Used the Isometric Z-as-Y ...
0 votes
1 answer
35 views

How can I create a mask for 2d lights in Unity?

I'm working on a top-down 2d game in Unity. assume my world/map looks like this through the player's eyes: (The art isn't mine, this is just an example) Now by making art directly like this, I can ...
1 vote
0 answers
32 views

How to bake ambient light?

I'm working on an indoor maze-like scene, with the only illumination coming from a few static point lights set to either Baked or Mixed mode. Since there are no windows, I'm facing the problem that ...
  • 111
0 votes
0 answers
21 views

Strange Shadows and Textures On Models When Lighting a Scene in Unity ( Models Exported From Blender )

I am importing models into Unity that I have created in Blender. In Blender, the models look great when lit and textured, and have no strange lighting / shadow issues. When in Unity, however, when I ...
0 votes
1 answer
88 views

How to turn off shaders?

Whenever I import something in Godot it looks like it's covered in some mushy slimy glittery stuff, I don't like it.... Garbaj on youtube showed that it's possible to turn shaders off and just render ...
  • 1
1 vote
0 answers
42 views

Is there an alternative method do do per-texel lighting in 3D without stream compaction?

Note: I'm not asking for an x% faster method. Work efficiency is an objective measure, it doesn't change because of hardware. I've got a voxel world I'm trying to render, think Minecraft, same texture ...
  • 1,713
0 votes
1 answer
40 views

How to Start with a Flashlight in the Off Position on Start

I'm fairly new to Unity, and I have a script I'm working with that plays two different flashlight sounds (one for the off and one for the on position). Here's the script I'm currently working with: <...
  • 3
1 vote
1 answer
58 views

How to keep the sunlight out of the interior even with a transparent roof?

In my Unity project, the player sees the action from a bird's eye view. If he walks into a building, the roof should become invisible. The problem now is that the lighting shouldn't change, which ...
0 votes
0 answers
35 views

Ambient occlusion formula

I have been reading some papers on screen space directional ambient occlusion and the formula with which AO is formally described such as seen below. We all know this sum should be between 0 and 1 as ...
0 votes
1 answer
53 views

How can I change the default dawn and dusk times in Unity?

I'm working on a game in which the season is particularly important to the player, along with sunlight. It progresses from early spring to late fall. I have a very basic day/night cycle system working,...
0 votes
0 answers
45 views

How to stop light from seeping through meshes?

I'm trying to make a giant minecraft world but light keeps seeping through everything, as every block is paper-thin. Is there a way to increase its thickness? Notice the edges of the meshes. Light is ...
0 votes
1 answer
29 views

Character Controller shows in scene but not in game

When I press play my character controller turns black, the scale on the z axis is 0 and all the children are not visible. Now the thing this only happens when I press play — if I don't, everything is ...
0 votes
0 answers
133 views

Directional light in additively loaded scene affects already-loaded scene

The issue I'm facing is how to light my worlds. My current game setup includes scenes being loaded in additive mode as the player progresses the game. So each scene is an island which should have its ...
0 votes
2 answers
337 views

Sprite Shape & URP Custom 2D Lighting Shader

I've been losing my mind over this for a couple of days now, and can't find any concrete information about it. I am trying to write a custom shader (shader graph to be specific) to light sprite shape ...
0 votes
1 answer
75 views

Surface normal vs tangent space

I am having a hard time being convinced why calculating the tangent space the way most textbooks do is the best thing to do? Why shouldn't we just simply use the edges of our triangle as Tangent and ...
0 votes
0 answers
38 views

Generate Uniform distances in Distance Field without Square Textures?

Following this Godot Tutorial I've been implementing a shader for 2D global illumination. In the tutorial it mentions adding a UV to World aspect ratio change within the raymarching function to ...
0 votes
0 answers
163 views

How do I set the target sorting layer in Unity Light2D using Universal Render Pipeline (URP)

I'm making a top-down shooter game and I'm trying to add a muzzle flash by using URP light 2D. I'm trying to set the target sorting layers for the URP Light2D. I've looked in the documentation and ...
  • 1
0 votes
1 answer
119 views

Change environment saturation based on exposure to "light source" - Unity

I am trying to make a game where particular "light sources" bring color to an otherwise grey world. I am extremely new to the world of custom graphics processing. I assume it will require a ...
  • 3
0 votes
1 answer
67 views

Adding second light hides the first on iOS unless quality is set to high

When I add a light in the scene then the light will show on the ground, but when I add a second light, neither of them show on the ground. One light: Add second light: My light is a spot light, and ...
0 votes
1 answer
70 views

Why does lighting on the object changes when I import it as Unity Package from my old project to new one?

Here is the original lighting ( Unity 2021.1) And Here is the same setup imported in a new project ( Unity 2021.1): As you can see importing this package in new Unity project makes it a lot lighter ...
  • 183
0 votes
0 answers
117 views

Gaps in shadows even with zero bias set Unity

I have a problem with gaps in shadows in Unity. I know that there are many questions about that, but all of the answers are usually about setting bias property to 0. But this didn't help me. I use ...
1 vote
1 answer
158 views

HDRP indoor scene has no diffuse indirect light

The lights in my indoor scene correctly produce direct illumination, but no indirect diffuse illumination. So the areas that aren't directly lit are completely black before exposure/post-processing. ...
1 vote
1 answer
91 views

Inverse Spot light

A central mechanic in my game involves shining a flash light on a glass sphere, which then focuses the light like a magnifying glass in order to burn enemies. The flash light was easy to implement - ...
1 vote
1 answer
193 views

Strange lighting/shadows in Unreal Engine game (shadow suddenly gets darker or lighter)

As the title suggests. I have made a level for Unreal Engine. It uses RectLights in the ceiling without any directional lighting. There is a Lightmass Importance ...
1 vote
1 answer
73 views

Determine if a static mesh is lit by directional light

I want to determine if a mesh is lit by the directional light on my scene in editor to automatically disable its "dynamic shadow casting" property (let's say I have one light source in my ...
0 votes
0 answers
30 views

Procedural Terrain Computing Normal in Shader

I've been pulling my hair out on this. I'm trying to paint a procedural terrain. The white ball in this photo is supposed to be the light source. However, it looks like it is shining black light. The ...
  • 111
0 votes
0 answers
39 views

Problem with pointlight used as "cubic" light

I'm now applying my recent work to some "real" game level and find an issue with the lighting. In this level I'm using a light source which should be like a "cube" (see picture). I'...
  • 89
0 votes
0 answers
111 views

What's the solution to this kind of shadow acne?

I'm working with a OpenGL ES/GLSL homebrew engine my company developed, in C++. Below is a screenshot of it rendering shadow acne. The light's direction is too perpendicular to the face of the curve ...
0 votes
1 answer
183 views

How do I fill a scene with light by using real-time lights in Unity?

This is my scene: Components of this scene: Cube Spotlight This project is under URP and I am building it for android. In this scene, I want more indirect lighting so that the objects/materials ...
  • 1
0 votes
1 answer
116 views

How do I adjust the start diameter of a spotlight in Unity?

To clarify, I'm an experienced 3D modeller, but there are hiccups here and there getting used to Unity's interface. I'm working with an adjustable spotlight for a game; it can be mounted and directed ...
0 votes
0 answers
31 views

How to calculate if a complex shadow matches a Texture?

Unreal 4.27, newbie and experimenting, will switch to 5 if supporting features are not available in 4. I have a light on the left side of the room pointed toward the right side. In the middle of the ...
  • 101
0 votes
1 answer
17 views

Math function equivalence for deferred transparency blending

if one consider the following blending operation: color1*src_alpha blended with color2*(1-src_alpha) Where ...
  • 89
0 votes
0 answers
312 views

What is a good method for 2D isometric lighting in Pygame?

I'm making my first isometric game in Python using Pygame. It's a 2D tile-based dungeon crawler, but I want to create a nice lighting system. I've made a random level generator that creates the rooms ...
  • 101
0 votes
1 answer
73 views

Storage of surface and vertex normals

I am writing a program that displays a bunch of 3D objects in a room with lighting. I am doing that from scratch, so I have to implement normals calculation myself. Say I have a set of 3D points ...
  • 3
1 vote
0 answers
1k views

Spotlight and Point Light not working in HDRP

I have a Unity project using HDRP, and in my scene only directional lights work. Spot lights and point lights don't work, even if set them to a super high value. How can I correct this?
1 vote
1 answer
444 views

How can I make my Unity 2d scene pitch black, except for manually added lighting?

I have tried modifying all the settings suggested that I can find, but the lighting of objects in my Scene remains unchanged. I've used the "Generate" button, I've set "Intensity ...
0 votes
1 answer
608 views

Scene lightning is wrong when scene is loaded from a different scene

I have a problem with the light in my scene. If I start the scene directly, it looks like I want it to be. If I load the scene from another, the light is too dim. Lighting is still applied, but ...
  • 2,655
-1 votes
1 answer
123 views

Is diffuse reflection definition failed when we see both reflection(diffuse,specular) is happening on one single object?

Let us consider the situation where only we moved the camera. The object and the light source remain in the same place. Thus the angle of the incident light is the same for every point.I have captured ...
  • 117
0 votes
1 answer
362 views

Changing Ambient Light settings in Environment window does not affect scene after baking LightMap

My settings: Unity version - Unity 2021.1.12f1 Lightmap Lighting Mode - Bake indirect Render Path - URP I want to change Ambient Light in Environment window while I have baked LightMap. Is it possible?...
1 vote
1 answer
413 views

Why specular reflection portion changes when we move in different direction?

We know that in Specular reflection rays reflected off surface at inverse angle;so camera position matters;creates bright highlights. I have taken one image where specular reflection is seen(Here ...
  • 117
2 votes
0 answers
98 views

Best practices for treating Light Volumes in Deferred Lighting pipeline

This topic is about ways to handle light volumes in a deferred lighting pipeline. I currently have a deferred lighting pipeline where spheres are sent to an openGL GLSL lighting shader. The sphere ...
  • 21
0 votes
1 answer
87 views

Improving performance of lighting on mobile

I'm trying to make a 3D game for mobile. When rendering a very simple scene, my performance drops from 60 fps to 30 fps when I use fragment shader lighting instead of vertex shader lighting. I really ...
  • 72
-2 votes
1 answer
261 views

GL error GL_INVALID_OPERATION: mismatched type setting uniform of location "4" in program "1"

I get this error while trying to add lighting ...
user avatar
-1 votes
1 answer
165 views

How do I add light to my textures?

How do I add light to my textures using this? I have this GLfloat ka = 1.0; glm::vec3 ia = glm::vec3(0.5f, 0.5f, 0.5f); and in the fragment shader ...
  • 1
2 votes
0 answers
473 views

Tweak brightness of widget in UE4

I would like to make an interactable monitor in Unreal Engine 4.26. I am using the default material for widgets as you can see in the image below: The texture I would like to show is: When I drive ...
2 votes
2 answers
721 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
1 answer
370 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 ...
user avatar
0 votes
0 answers
52 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
1 answer
94 views

How to lerp between diferent spot angles

I have this code that Change spot angle randomly between 'minAngle' and 'maxAngle' each 'interval' seconds: ...

1
2 3 4 5
15