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.
740 questions
0
votes
0
answers
69
views
Applying greyscale shading to objects in a Python 3D renderer
I need help with how to apply greyscale shading to objects in a 3D renderer I made in Python. The code is pasted below:
...
1
vote
1
answer
88
views
Phong shading: missing specular lighting, skipped face
I'm implementing my first rasterizer, and I've run into a 2 issues with Phong shading that I have no idea how to debug. First, specular lighting seems to be completely missing. Second, there is an ...
0
votes
0
answers
149
views
How to best simulate headlights
Goal:
How can I best simulate headlight beams, in a night-time scenario, in Godot 4?
The components I have are all sprite-based - a top-level car sprite, a shadow sprite (that is offset based on time-...
1
vote
1
answer
97
views
Why does dynamic light flicker/get replaced with a square when rotating the camera?
I am facing the same problem over and over again with Dynamic Lights in Unity and don't know where next to look. I am still learning Unity so maybe I'm missing something trivial because it happens in ...
1
vote
1
answer
166
views
How can I fix the rotation on a sprite normal map in Unity?
I'm making a 2D ball game in Unity v6.0, now in the process of adding some 2D lighting.
The player ball is a circle sprite. To make it look like a sphere, the sprite has a normal map added as a ...
1
vote
0
answers
66
views
How to hide a Sprite unless it is illuminated by a Light 2D?
I want to have a sprite that is invisible when outside of light, and visible when inside of light.
I created a new Custom Lit Shader Graph in Unity 6 with the following setup:
I then created a player ...
0
votes
0
answers
37
views
Unity Lighting Window API
I am trying to develop a tool for baking light in Unity but with some modifications and additions.
Currently, what I want to achieve is for the commands ...
0
votes
1
answer
68
views
Difference between BakeAsync and BakeMultipleScenes
I am trying to develop a tool for light baking with certain modifications, but I do not understand the difference between the two functions BakeAsync and ...
0
votes
1
answer
121
views
Generate Spherical Harmonics without intermediate cubemap
I am in the process of generating Lightprobes using Spherical Harmonics.
The usual approach is to render a cubemap, convolve it to generate an irradiance cubemap and then sample it to generate ...
0
votes
0
answers
69
views
How to build directional light view / proj matrices in DirectX11?
I think I built my matrices wrong:
...
2
votes
0
answers
90
views
How to feed lightmap in GPU instanced meshes in Unity?
Unity's documentation state that GPU Instancing supports baked lighting:
Since Unity 2018.1, Global Illumination (GI) rendering is supported by GPU Instancing in the form of light probes, occlusion ...
0
votes
0
answers
57
views
Unknown light source in viewport when camera projection is orthogonal
I'm using Godot/Redot for my game development but so far this happens when camera projection is orthogonal, there's unknown light following the viewport when the camera is moving.
Here's the example
...
0
votes
1
answer
79
views
Inconsistent light effect with same distance from the source from the opposite direction
I have the following brdf code to light my scene
...
0
votes
1
answer
154
views
Light dissapear when baking in Unity
I am playing around with Unity and lighting is proving to be the most nerve racking thing about it so far.
I think I understand the types of light and pros and cons of bake vs realtime but when I do ...
0
votes
1
answer
156
views
3D-lighting considerations
I'm considering how a graphics-engine lights any given environment, at the level of code.
So I guess perhaps the simplest way to light a scene is just to provide a Value-figure (i.e. Value as in the ...
0
votes
0
answers
75
views
What is the rendering method used in "viewport shading: solid" in Blender?
https://streamable.com/km0hv0
I want to make a low-poly game.
I noticed that in blender in viewport shading mode, when the camera rotates, the face progressively change color, from grey to black, ...
0
votes
1
answer
89
views
Use AnimationClip to turn a material pitch black and then back to its original color
I have an object that has 2 materials, both using the URP/Lit shader. One of them is emissive and its color changes at runtime.
I would like to create an effect where the two materials become pitch ...
0
votes
2
answers
67
views
Sun's lens flare
At what degree of the sun's altitude/hight does it's lens flare appear? (At sea level and without any external influences).
I'm trying to develop a game and I want to add lens flare to the sun. My ...
0
votes
1
answer
254
views
Combine 2D and 3D lighting in Unity
I am using URP and would like to have 2D and 3D objects in the scene affected by lights.
This is not supported by Unity, however the docs said that one can use "Camera Stacking" for this ...
1
vote
1
answer
189
views
How to achieve believable interior night light in Unity URP?
I have scene which shows inside of an house. I am trying to achieve night as shown in horror movies. But in order to light up the entire room I have to increase the intensity of light way too much. ...
0
votes
0
answers
53
views
Unity high res mesh brighter than low res mesh despite using the same material
I'm currently making an LOD system for terrain. I have a high-res mesh:
And a low-res mesh:
As you can see, the high-res mesh is significantly brighter than the low-res mesh. They are definitely ...
0
votes
1
answer
72
views
How to minimize cost of drawing 1-2 objects while keeping them bright enough to see?
I have a really simple scene that includes only one or two 3D objects, and the rest of it is UI. My target is WebGL so I am taking every chance to optimize thing as much as possible.
The game objects ...
1
vote
2
answers
266
views
Baking the light either takes too long or doesn't work
Why does the baking process take so much time? What I'm sure of is that I won't make a mistake somewhere. Do any of you know my mistake? I'm sure 7 hours is a very long time. At one point, even the ...
0
votes
1
answer
410
views
Unity scene doesn't have skybox and lightsource
I am a beginner in Unity and 1st time asking in this platform. I am working as a team and I got invited to this project via Github. (if this matters at all)
I want to work in 3D environment and I ...
0
votes
0
answers
72
views
Unity Grayscale camera but mask colors
I'm trying to replicate the example given in this thread:
https://gamedev.stackexchange.com/a/185593/179264, and I was able to, but for now I want to implement the "mask" thing to 2d lights ...
0
votes
0
answers
83
views
What is the best lighting & shadow setup for mininal draw calls and triangles?
I have been testing out various lighting and shadow settings in Unity since during play mode the stats are showing a much higher set pass call and triangle count to what I know my model has. I have ...
0
votes
1
answer
63
views
light difference between scenes on player model
Here is a screenshot of same model on different scenes.
I'm trying to understand why the second one has that bright/light and remove it.
I want the model appear like the first picture.
Is this a ...
0
votes
0
answers
87
views
The lighting result is wrong when switching scene in Unity
When I use SceneManager.LoadScene() to switch between scenes the result of lighting in loaded scene is wrong. However if I open the scene solely the lighting ...
0
votes
1
answer
161
views
How to setup gradient lighting in OpenGL shader?
I setup simple single light source lighting around campfire object.
However, as can be seen, the transition between lightened area and unlighted one is sharp.
The GLSL fragment shader code:
...
0
votes
0
answers
74
views
Surface Lit on Wrong Side (UE 5.3)
I have a triangular mesh and a directional light in UE 5.3.2. The directional light is facing in +Z direction (up). Can anyone explain to me why the top surface is lit instead of being in a shadow (i....
0
votes
1
answer
290
views
How to prevent sun light from passing through the walls and flickering when navigating in viewport?
I am new to UE5. I am using a geometry brush to create an inner box and an outer box. The inner is set to brush type ‘subtractive’, resulting in a simple room like this:
Then I create several windows ...
0
votes
0
answers
63
views
0
votes
0
answers
54
views
Materials on 2D Objects Has Bad Lighting and Changes Shape
Whenever I assign a material on an object in 2D unity, it becomes much darker and if the material is assigned to a circle, the circle becomes a dodecagon. The material is completely white. I can fix ...
2
votes
1
answer
88
views
I can't find what I'm doing wrong when rendering a point light that is clipped by the floor
I have a top down camera on my game, and I'm rendering a point light on my opengl fragment shader.
When the point light is far away from the floor it looks like I would expect it should look, like a ...
0
votes
1
answer
138
views
Normal map lighting is just slightly off
I've been trying to implement normal mapping into my custom OpenGL shader. The result I'm getting is almost there, but it looks like the Point Light is not ...
0
votes
0
answers
122
views
Baked lightmaps in SceneA, at runtime loaded SceneB from SceneA: lighting is now messed up in untouched SceneB. Only in Editor!
I'm using Unity, and in my MainMenu scene I made most objects static and baked some lightmaps.
I built the game, clicked on a button in MainMenu which ...
1
vote
1
answer
172
views
Can somebody please explain why my illumination is inconsistent?
100% not a graphics guy here.
Problem Demonstration.
Randomly discovered this when showing the project to a friend after not touching it for over a month (been working on other stuffs). First I ...
0
votes
0
answers
62
views
Is there a way to make area affected by light completely white despite object color in Unity?
I have a 3D object that is affected with a directional light with a cookie texture (might be irrelevant). This object has a specific color lets say blue for the example. I would like the area affected ...
1
vote
2
answers
812
views
Recreating The Lighting In Paper Mario: TTYD In Unity
Goal:
I would like to recreate the lighting in Paper Mario: The Thousand Year Door.
Currently, I am only using a directional light.
I am also using URP.
Comparison:
Here is an example of how it looks ...
1
vote
0
answers
82
views
Terrain Trees weird behaviour after lightmapping
I've been working on this game for quite awhile now and have had this problem ever since I switched from real-time lighting to lightmaps. For some reason the trees that are at X distance from me ...
0
votes
1
answer
3k
views
In Unity, how can I make sprites be affected by lights in the scene? The Sprite-Lit-Default Material doesn't seem to be working
I am trying to make it so the sprites in my scene are affected by lighting, but I cannot figure out how. I looked it up, and everywhere I looked, I was told to switch the sprite's material from "...
0
votes
0
answers
47
views
speeding up image manipulation for shadows- engineless
so my project is a ray-casted lighting system thats trying to implement soft shadows. the ray casting is working currently, so right now my focus is on performance of the soft shadows portion.
i use ...
3
votes
0
answers
118
views
Smooth self shadow on dense foliage
I don't know how to achieve or research smooth lighting on foliage, like in this screenshot of theHunter: Call of the Wild.
The grass is translucent, but blocks light smoothly when it's tall and ...
1
vote
0
answers
848
views
More performant 2D raytracing than Radiosity?
Currently if you want real-time 2D ray-traced scene lighting, you're limited to a few options: geometry based SDFs or Scene Based Radiosity. However 2D Radiosity is really the only choice if your game ...
1
vote
1
answer
117
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 ...
0
votes
1
answer
2k
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 ...
2
votes
0
answers
675
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 ...
0
votes
1
answer
583
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
vote
0
answers
381
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 ...
0
votes
1
answer
109
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:
<...