#archived-lighting

1 messages ยท Page 42 of 1

deft fiber
#

Though some nodes work differently in different RPs

#

There's nothing about BiRP that fundamentally makes the original less likely to happen
In either case the quality shouldn't change for "no reason"

#

URP additionally has more tools to work around and to eliminate light limits than BiRP does

fallen island
#

While we re on the topic, can you tell me if my theories can be correct? And if so, can I increse per game object limit?

#

Yeah I know, I switched and get lost at the start

#

So installed back urp

deft fiber
#

But as mentioned the limit can be different between editor and build if they use different quality levels or active URP assets
They assigned defaults can differ easily

#

But in your case if you also have a script controlling the quality levels or graphics otherwise, it's a very likely culprit for swapping at the wrong time or in the wrong way

fallen island
#

So would the solution be to make in every pipeline asset per game object limit at 8?

fallen island
#

Yeah but Im on my phone rn and my computer is off so yk just asking ๐Ÿ˜…

deft fiber
#

It most likely would
If not, that implies you have a script that directly changes the light limit

supple nacelle
#

You may want to ask yourself if you really want to be raising that limit though anyway, rather than just setting up your light ranges to keep the count low?

deft fiber
#

I'd first search the whole codebase for any script calling methods in GraphicsSettings, QualitySettings class or using UnityEngine.Rendering namespace to find the main culprit

fallen island
deft fiber
supple nacelle
#

If you have more than.a couple lights hitting an object, you are setting yourself up for a lot of endless tweaking and balancing

#

For sanity sake there is also benefit in keeping your lights tight and avodiing a lot of overlap

deft fiber
#

Since URP also lets you use Forward+ rendering you should test if it's lighter or heavier than 8 light limit

#

Compare against deferred rendering too (if that's a practical option due to its limitations)

fallen island
deft fiber
#

There can be unique light limits per quality level but because the light culling is anything but graceful you'd effectively have to design every lighting scenario separately for each different light limit
Which costs the aforementioned sanity

deft fiber
supple nacelle
#

What you want is ambient light, and you are trying to get it with a LOT of point/spot lights

#

2 lights with baking will look better than 20 point lights placed all over the place to try and simulate it

fallen island
supple nacelle
#

Are you opposed to baked lights for some reason with your use case?

deft fiber
#

Or just environmental light

supple nacelle
#

No idea what your style/look is so hard to give any tips on how to get ambient light

#

but lots of point lights is rarely the way to go

deft fiber
#

If none of your scripts really have nothing to do with it and your editor is using the same quality level as your build in projects settings > quality, then we'd have quite a mystery

fallen island
#

Wait let me think Im not a native speaker and its 11PM so my brain works slower

#

Ill start with lights. I cant have 2 lights bc I operate in closet environment so Im using many point lights to simulate bulbs if yk what I mean. They are set to baked and static so I dont think there sould be much of a problem with these.

hasty condor
#

also all this only happens in the editor, its fine in build

fallen island
#

Hope I havent skipped anything

deft fiber
deft fiber
fallen island
#

Smth like this. This is start of my game for example

fallen island
deft fiber
deft fiber
fallen island
#

That makes sense. After trying to increse in every pipeline asset per obcject limit to 8 Ill bake light and see if that works. One of these should work - theres no other way.

#

The funny thing is I baked lights in my previous game that I was making to learn unity but I just forgot thats a possibility.

#

It was 2 years ago so you cant blame me

#

And if these 2 things wont work Ill send my quality settings.

deft fiber
deft fiber
fallen island
fallen island
hasty condor
deft fiber
# fallen island Than Ill have no idea how to proceed.

Scenes/projects in development always have some amount of unknown variables that we miss
So what always has worked for me is to reproduce the problem in a fresh scene / fresh project / fresh project with another unity editor version
Sometimes logic breaks, but there's always some cause for it and the process of elimination can tell you where it's not

deft fiber
fallen island
deft fiber
#

If you can repro it, you can report it as a bug to unity QA
(Well, you can report it otherwise too but if you can't repro it, they probably can't either)

deft fiber
fallen island
#

Yeah, this sounds more professional.

fallen island
#

Well, thanks for help for today. Ill update tomorrow if Ill make it in time to hop on the computer to test everything. If not than Ill have to wait until friday when Im coming back from school trip.

deft fiber
# fallen island Yeah, this sounds more professional.

In your case it seems most likely you've missed something that'll seem obvious in retrospect
Especially if you have a chance to share the images of the settings and such
But even if it's something weird, probably not so weird that we can't pinpoint it somewhere

fallen island
#

I also think its really small issue but Im just not so good at using unity to pinpoint the problem

deft fiber
#

One related but rare "weird" issue is that Render Pipeline Assets may sometimes break internally, and the solution is to replace them with newly created otherwise identical ones

fallen island
#

Well I did that when I was trying to install hdrp and ultimately came back to urp so that wouldnt help in this case

deft fiber
#

Useful that it's ruled out ^^

fallen island
#

Yeah. Ok thanks for help once again I really have to get some sleep bc I now have ony 5h left so gn.

livid stump
#

Does anyone know where these artifacts are coming from? there's no UV overlapping error, and I also have a 2nd UV for the lightmap

#

Even if I change the quality of the lightmap and the scale of the specific mesh, it is still not changing

nimble night
#

when i use shape keys the shadows go really splochy, any idea whats causing?

#

i also tryed Poiyomi and the same things happening atm but im still playing around with it

fallen island
#

@deft fiber LETS GOOOOO!!!!

#

So it was different graphics settings!

#

Now I have to delete these builds LMAO

#

@deft fiber @supple nacelle Thanks for help I love yall

#

I was so sick of this but it works now

#

now I have to figure out if I can safely delete other graphics so its not worse than in editor or smth

#

but thats not a problem

#

again thank you so much

deft fiber
#

https://discussions.unity.com/t/lightmapping-troubleshooting-guide/895352/
Looks like invalid texels due to one-sided geometry facing the wall (c.15)
Also what appears to be denoising or possibly filtering artifacts (c.17 & 18), which can be seen in other spots a bit as well
Did you author your own lightmap UVs or generate them? Generating is more reliable unless you know a specific reason why you need to unwrap manually

#

@livid stump ^ flunked the reply

deft fiber
livid stump
livid stump
deft fiber
#

Change something else?

livid stump
#

yeah, it's the opposite direction light that I put to test haha, I'm fixing it already, no potential issues ahead. Thanks

deft fiber
livid stump
#

Fixed it already. Next is adding volumetrics

silver lynx
#

Is it possible to bake Skybox lighting, or it is trickier than it sounds?

silver lynx
#

THis

silver lynx
deft fiber
#

Clarify?

silver lynx
#

I want to restart the bake, since I switched to directional light, reason, it has a Kelvin color chaning.

#

But as you can see even after turning the skybox off and deleting bake data floor still has light on it.

#

How can I comepletley delet the light from sky box

deft fiber
#

Make a skybox material from a black texture and use that to generate lighting

#

Realtime GI or Baked GI are not necessary to be enabled just for that

silver lynx
#

Is it possible to make the skybox visible but not allow it to emit any light?

deft fiber
hasty condor
# hasty condor Yeah

man gamedev is so fun in the process of recreating the entire project in another project i realized i had turned off scene and domain reloading

deft fiber
#

The description of "flashing random colors and a strange face" sounded really weird

hasty condor
deft fiber
#

Flashing could be NaN errors which sometimes happen with lightmaps and more commonly with custom shaders, but they're usually black and white

hasty condor
deft fiber
deft fiber
hasty condor
#

when it flashed i kinda saw the screen in a muted non lit r, b or g tone

deft fiber
#

In my experience anything can break when upgrading to 6, and each time I've tried something different has broken in a way that not even a Library deletion fixed, only making a new project and swapping your assets into that (though it's best to re-make render pipeline assets)

#

Once it caused a flashing issue in editor when Resident Drawer was enabled

hasty condor
deft fiber
#

Not relevant if you're on BiRP, which wouldn't have Resident Drawer either

magic osprey
#

Hello im using URP with Unity 6000.1.3f1 and when I use adaptive light probes I keep getting random artifacts all over my level like this not sure what to do to figure this out. I did notice if I lowered an emission intensity (HDR), it would stop artifacting in one area but then move it to another lol. This is at 0% Intensity, so not sure where its stemming from. Not sure if this is related to any of the stuff above as I think my issue is directly with Adaptive light probes.

EDIT - I turned off Importance Sampling and now it looks as it should.

hasty condor
deft fiber
#

Can't hurt to make new ones anyhow though

#

You didn't mention which RP you're using or if Resident Drawer option does anything / is available

hasty condor
deft fiber
#

It's supposed to be used with U6 but I'm mentioning it because I've had project upgrade related issues with it

hasty condor
#

tried turning whatever i could of it on and nothing happened

deft fiber
#

GPU occlusion culling is a different thing
Resident Drawer being on is usually what causes issues

hasty condor
deft fiber
#

("Usually" referring to the rare cases where there's rendering issues due to upgrading)

near wraith
#

Hi. I have a problem: all my materials from the Normal map turn black if the camera looks at them from a certain side of the world. If you remove (set the power to 0), they will look fine. I couldn't find anything on the Internet. How to solve it? I've been having this problem for a few months, and I don't know what to do anymore, except how to remove the Normal map (which is not cool)

deft fiber
near wraith
#

I don't know who or what to blame, but for some reason the textures flew off, and they weren't a normal map. I thought they were fine, because they are shown in blue. Thank you very much.

odd bluff
#

Has anyone baked lightmaps for unity in blender? what settings do i need? because direct+inderect (no color) is too washed out, direct+indirect+color oversaturates colors

#

@languid wing yeah can do that. you do a unity bake on shittiest settings and then do a by script replacement

deft fiber
#

But it's not something I've looked into much

odd bluff
# deft fiber What's your workflow exactly? As far as I know there isn't really a way to bake ...

I just did. Screenshots first. Then this code

exposure_multiplier = 2 ** -0.83  # โ‰ˆ 0.56
clamp_max = 0.5
...
img = cv2.imread(path, cv2.IMREAD_UNCHANGED)

    if img is None:
        print(f"Failed to read {path}")
        continue

    # Clamp and exposure adjust
    clamped = np.clip(img, 0.0, clamp_max)
    adjusted = clamped * exposure_multiplier

    # Overwrite file
    cv2.imwrite(path, adjusted)```
that brought it 95% close.
#

The issue was that unity uses diffuse bounce to contribute to lightmap, while blender is either direct+indirect, or direct+indirect+color, but mercifully that node allows to override ray type lookup

#

python adjustment to clamp overblown highlights which go toabout 2.0 in exr, and then additional exposure reduciton which i matched by hand in substance designer (Which basically let me correctly work on hdr colorspace)

#

side by side - some color info is too reduced but otherwise it's close enough

deft fiber
#

Matching exposure to what, the result in unity?

odd bluff
#

yeah

deft fiber
#

I don't think clamping the light can result in a "correct" lightmap, what's the problem being solved?

odd bluff
#

๐Ÿ™„ i just said that blender overblows it into 2.0 color values in exr. unity doesn't

deft fiber
#

I mean what's the reason for baking in blender

odd bluff
#

Speed

#

enlighten is unapologetically shit still. blender cycles with automation - i get about 2 minutes per object at 2048x2048 lightmap. Unity takes about 10+ minutes. with comparable settings.

deft fiber
#

Enlighten is the very old system replaced by Progressive Lightmapper which supports GPU baking and is rather fast

#

So I have to assume you're stuck with an old unity editor

odd bluff
deft fiber
odd bluff
#

yeah

deft fiber
# odd bluff yeah

The bake speed should be similar, but it depends on the bake settings and the scene
I have advice to give on that, but if you decide to go with external baking I'm curious to hear what kind of a process it'll be

odd bluff
#

no it absolutely shouldn't be. cycles been worked on for much longer with much more saner codebase to boot.

#

progressive lightmapper is relatively new, been worked on under reign of ricitello, and judging by how it bakes - uses trashier algorithms across the board

#

i am not even talking about lack of sane in-situ denoising

deft fiber
#

Cycles is great at rendering, not so great at baking in my experience
Doesn't seem to be fully utilizing GPU for that task even if configured to do so

odd bluff
#

not post-sampling but in-situ akin to optix/openimagedenoise

odd bluff
deft fiber
odd bluff
#

if memory serves unity denoises post-bake. it has been written in blogpost during rollout. optix/oid denoises progressively starting at 50% of iterations (or configurable)

#

i might be wrong on that one though. it's been ages since they announced that feature

deft fiber
odd bluff
#

yeah you are completely off base here

deft fiber
#

My bakes in both engines take about two minutes on average, if that can indicate anything

#

It could be a matter of familiarity since I've been using the progressive lightmapper much more, and getting a good bake fast has been just a matter of tweaking variables

deft fiber
#

I wish it was easier to get lightmaps into unity from blender without having to go through hoops

odd bluff
#

pretty easy actually

#

bake shittiest lightmaps for objects (in unity, so that it populates the lightmap asset), make sure you don't generate UV2 in unity but have them made in blender prior.

using System.Collections.Generic;
using System.IO;
using UnityEditor;
//using UnityEditor.AssetImporters;
//using UnityEditor.U2D.Sprites;
using UnityEngine;


[System.Serializable]
public class ObjectToLightmapGroup
{
    public string name;
    public GameObject staticLightmappedObject;
    public Texture2D desiredLightmap;
}
...
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LightmapSceneConfig : MonoBehaviour
{
    public List<ObjectToLightmapGroup> lightmappingGroups;
}
...
public class LightmapAssignWizard : ScriptableWizard
{
   
    public LightmapSceneConfig config;



    [MenuItem("Tools/Lightmap reassign Wizard")]
    static void CreateWizard()
    {
        DisplayWizard<LightmapAssignWizard>("Reassign Lightmaps", "Apply");
    }

    void OnWizardCreate()
    {
        if(config==null || config.lightmappingGroups.Count==0)
        {
            Debug.LogError("No config/config empty");
            return;
        }
        foreach(var lmObj in config.lightmappingGroups)
        {
            var cObj = lmObj.staticLightmappedObject;
            var cmr=cObj.GetComponent<MeshRenderer>();
            if (cmr == null)
            {
                Debug.LogError($"selected object {cObj.name} has no mesh renderer");
                return;
            }
            if(cmr.lightmapIndex<0)
            {
                Debug.LogError($"selected object {cObj.name} is not lightmapped");
            }
            var lmdats = LightmapSettings.lightmaps;
            lmdats[cmr.lightmapIndex].lightmapColor = lmObj.desiredLightmap; //var cLightmap = lmdat[cmr.lightmapIndex];
            LightmapSettings.lightmaps = lmdats;
            //cLightmap.lightmapColor = lmObj.desiredLightmap;
        }
    }
}
#

Then shove monobehavior on scene,populate asset with object , desired lightmap

#

launch the wizard and point it to that object with monobehavior attached.

deft fiber
#

So why the need to tweak the baked textures? I'd have assumed they're physically accurate to begin with

odd bluff
#

because light formulas are different

#

and hence expected components of lightmap are also

#

resulting image tracks the same, but assemblies of it are not

deft fiber
#

@odd bluff I've got two blend files, both for baking textures with GPU cycles
The second one never utilizes GPU at all and crashes a third of the time
I don't seek to blame the tool for it but it's why I assume cycles baking is not very robust, and what I've grown to expect after a couple of years of baking with it
But to be fair Progressive Lightmapper also falls back to CPU baking for a lot of people seemingly randomly, but it also gives warning about it
As far as I can tell, your only option for denoising blender bakes is in post? Allegedly the native denoise was in progress but not implemented
So if that's the case how's it comparatively an issue that progressive lightmapper doesn't do denoising right

odd bluff
#

because OSL will force it to CPU

deft fiber
# odd bluff does your second file materrials have any OSL in them?

Principled BSDF only in both cases
Using external baking I think would leave you without shadowmasking, directionality, light probes / APVs, and without light types and properties that don't have a direct analogy, at least not without extra work
Though if you don't need those then you won't miss them
People who seem dissatisfied with Unity's baking are usually happy with Bakery, it has settings for everything and purpotedly is all about the quality

odd bluff
#

that data doesn't come out of ether and is just magically there - it's still in the same lightmap data

#

just different arrays

deft fiber
odd bluff
deft fiber
#

Sounds like a bit of a nightmare to maintain everything twice over, especially with complex lights, but you definitely aren't afraid of extra work

odd bluff
deft fiber
#

A thing that works now? Last time I checked it was pretty barebones on both unity's and blender's side

odd bluff
#

it works alright'ish enough in blender 4.2. tho i am not using it at the moment, since for this experimental NPR bake i'm more after anime look rather than realistic.
But i know for sure blender support is high at the moment. i recnetly transfered rigged body from 3dsmax to blender through it - and it just worked. no bind pose bs - just one to another.

#

oh wait.

#

god damn it

#

looks like it got thrown out after 2020. again.

deft fiber
#

Blender's USD support you mean?

odd bluff
deft fiber
#

Ah
Might try the workflow as long as there's a way to not setup a lot of lights manually each time the lighting is changed, for the ability modify the bake rays with nodes
Still haven't found a way to denoise bakes other than the compositor, though

odd bluff
deft fiber
#

So not exactly optix
Needs lots of samples and twice the resolution to start with, sounds I could do it quicker with progressive lightmapper
But what's clear is our preferences for tradeoffs ^^

odd bluff
#

that or just have texel density low enough so it averages out

distant yew
#

only main light uses those cascades, if you don't set a main light I believe it will be whatever light is the brightest among directional lights or something like that.

#

you could also make a lightmap, then higjack the baked output for a cookie or projected decal.... though all of them seem to have resolution issues no matter how high res... I ended up making my own shader for it... though im not a shader expert by far, but its kinda okay

#

looks like you need more bounces

rancid island
#

what could possibly be causing this unnatural light border here? i'm using spot light with URP and anytime I put a spot light above the floor, it looks way too unnatural. I messed around with the spot light settings, mesh renderer settings, and the material the object uses and it still didn't resolve that sudden border the light produces. any clue why? never mind, the inner spot angle matched the outer spot angle in the spot light settings which produced that lol

civic ivy
#

I'm sure this problem gets posted a lot, but how do I fix this light leaking on realtime shadows? I know reducing shadow bias helps, but even at the minimum, it still has some light poking through (also creates strange artifacting on surfaces). I'm on 2022 using the standard render pipeline. The entire model is enclosed.

#

Happens with this model specifically, this is what it looks like when I use a spotlight.

#

And these are my import settings

odd bluff
# deft fiber Ah Might try the workflow as long as there's a way to not setup a lot of lights ...

turns out OIDN can be just used outside of blender. Make sure to install this https://github.com/sxysxy/OIDN-python , and
here's minimal code

import os

os.environ["OPENCV_IO_ENABLE_OPENEXR"]="1"
import cv2
import glob
import numpy as np
from pathlib import Path
import sys
from PIL import Image

here = Path(__file__).parent.absolute()
sys.path.append(here.parent.parent.absolute().as_posix())

import oidn

img = cv2.imread("Lightmap_Room.exr", cv2.IMREAD_UNCHANGED) #np.array(Image.open("Lightmap_Room.exr"), dtype=np.float32)

result = np.zeros_like(img, dtype=np.float32)

device = oidn.NewDevice()
oidn.CommitDevice(device)

filter = oidn.NewFilter(device, "RTLightmap")
oidn.SetSharedFilterImage(
    filter, "color", img, oidn.FORMAT_FLOAT3, img.shape[1], img.shape[0]
)
oidn.SetSharedFilterImage(
    filter, "output", result, oidn.FORMAT_FLOAT3, img.shape[1], img.shape[0]
)
oidn.CommitFilter(filter)
oidn.ExecuteFilter(filter)


cv2.imwrite(f"{here}/Lightmap_Room_Test.exr", result)


oidn.ReleaseFilter(filter)
oidn.ReleaseDevice(device)```
GitHub

Python Binding of Intel Open Image Denoise. Contribute to sxysxy/OIDN-python development by creating an account on GitHub.

deft fiber
# odd bluff turns out OIDN can be just used outside of blender. Make sure to install this ht...

Like I mentioned you can denoise bakes in the compositor too, which uses either optix or oidn, but it has to work without any ray information unlike with non-bake renders
I assume that's a similar situation you meant by "lack of sane in-situ denoising" with progressive lightmapper, though when using progressive updates I think it can at least be seen denoising during the bake and it can denoise direct, indirect and AO separately which at least prevents the three from smudging together as much

deft fiber
#

Spot lights in particular will lose shadow accuracy if their angle is very high

civic ivy
deft fiber
pallid gorge
#

How does Override Rendering Layer Mask in Probe Adjustment Volume works exactly? I am trying to make objects with certain Rendering Layer ignore APV and can't figure it out

tame mural
#

how would i go about making it so that lights are less intense on closer objects while maintaining the same intensity on farther objects? is there some post processing trick that i can do?

odd bluff
deft fiber
odd bluff
#

ray info

deft fiber
# odd bluff ray info

Cycles render denoising are very clearly improved if you use normal and albedo passes to help optix/oidn, which isn't an option for baking or any post denoising
I assumed progressive lightmapper would take advantage of having ray info to do something similar since it implements denoising into the process
But then again I don't know if lightmap baking tech in general can utilize ray info in that way

#

AI denoising is better than anything else but the characteristic smudges are still easy to run into in both engines

odd bluff
deft fiber
#

Yea, but does it work that way for lightmaps?

#

There's not exactly a "normal pass" for a lightmap

#

Because that stuff is designed to improve denoising in screen space, I'd guess it'd have to be a different implementation to do anything useful in UV space

odd bluff
deft fiber
odd bluff
#

i gave you the repo link.

deft fiber
#

Looks like nothing besides color, except for the screenspace normal and albedo

odd bluff
# deft fiber Looks like nothing besides color, except for the screenspace normal and albedo
def SetSharedFilterImage(filter_handle : int, name : str, data : np.ndarray, format : int, width : int, height : int, byteOffset : int = 0, bytePixelStride : int = 0, byteRowStride : int = 0):
    """
    Set filter parameters
    
    Args:
        filter_handle(int): Created by NewFilter 
        name(str): color/albedo/normal/output, See document of OIDN.
        data(np.array): data buffer, should be correct in size and dtype; should be c_contiguous when name == 'output'
        format:  Should be oidn.FORMAT_FLOAT3 for image
        width: width in pixel.
        height: height in pixel.
        byteOffset: default to 0
        bytePixel: default to 0
        byteRawStride: default to 0
    """```
deft fiber
#

Yes

odd bluff
#

so far this npr bake went much better than i hoped.

odd bluff
#

What i'm doing here is not using unity's portion of lightmapping code. instead i'm using manual RGBM encoding so that i can store 1.0+ values, 565 compression works fantastic with that, as long as colors are muted/greyscale on lightmap. Then use a custom shader to restore the lightmap range + UV1 to map it onto a texture atlas

#

completely valid approach for low-mid end mobile

desert dawn
#

yes if you could cause i really dont know

icy tundra
tame mural
#

look into light cookies

upper fable
# tame mural how would i go about making it so that lights are less intense on closer objects...

Tonemapping generally makes the lighting changes bit less extreme, but the falloff itself is controlled by the shader and differs between render pipelines. On URP at least it seems like you can quite easily modify the falloff function https://docs.unity3d.com/6000.1/Documentation/Manual/urp/lighting/custom-lighting-change-light-falloff.html. The default falloff function is presumably somewhat realistic but it sure is sometimes really hard to get objects even remotely close to evenly lit when objects nearby get so much light

night meadow
#

any idea why my static objects using batching static have a black flickering when usnig point lights in the scene ?

loud gazelle
#

I have this keypad on a wall. In idle the Keypad is emitting blue light, when accepting its material is changed to an emmissive green and when declining the same in red. I figured baking wouldnt work because then the wall would be lit up blue even if the keypad is green or red. I think about using RT lights, but they are all circular. any ideas on how to go about this?

loud gazelle
#

Can you eat that? kek

#

Thanks, imma read that

#

never heard of it

odd bluff
odd bluff
#

do a flared mesh around keypad which will have neutral light baked on it. then multiply by color of keypad in material

loud gazelle
loud gazelle
supple nacelle
#

Cookies are part of BIRP aren't they?

#

I haven't used them in it so not sure, but It thought they used to be a thing

#

No color support, its alpha only. But if your light is the color you can use the cookie to define its shape still

odd bluff
#

and also destructive the moment something moves into the range of emitter

supple nacelle
#

Really depends what he is trying for here. He can also do things like have the shader draw the light effect as a decal, or swap lightmaps, etc. Impossible to give the best answer without context.

#

But if the question is "how do I make my round spotlight square"... the first obvious answer is a cookie

#

It might of course be the wrong question ๐Ÿ™‚

stone kestrel
#

๐Ÿ‘‹

#

I wanted to tell in advance that I'm pretty new to lighting so sorry if my questions don't make sense.

What does baking lightmaps exactly do?

#

I've set up my lighting like this

#

And this is my directional light

#

But when I bake lightmaps the game becomes way more brighter, how does it exactly work?

supple nacelle
#

You are really going to need to read the docs for a question that broad

stone kestrel
supple nacelle
#

Probably a bunch of them

deft fiber
stone kestrel
#

Also what are exactly Realtime GI & Baked GI, and how to enable them?

deft fiber
odd bluff
stone kestrel
odd bluff
#

Additionally. https://simonschreibt.de/gat/doom-3-volumetric-glow/ https://hollowdilnik.com/2022/06/20/doom-glow.html cheapest effect for glow. i mean it - with modern lowest end mobile you can have hundreds of these on gpu no problem. Can be used for that keypad @loud gazelle

tropic tulip
#

Hello, guys! I have an issue in rendering lighting probably. Do you guys understand why this behaviour is happening when I am toggling flashlight on?

#

When I am dragging the flashlight away from the objects that remain in the dark they are behaving weirdly. Check how they are getting grey somehow

#

I will record a video rn

#

It's happening only on ultra quality.

prime moss
stone kestrel
#

๐Ÿ‘‹

#

I want to bake lights for both day and night sky states. How can I have two different lighting datas?

prime moss
#

thoughts on my lighting?

prime moss
#

or just two modes?

stone kestrel
#
[System.Serializable]
class Sky
{
    public SkyType type;
    public Light sun;
    public Material skybox;

    public void Apply()
    {
        RenderSettings.sun.enabled = false;

        RenderSettings.sun = sun;
        sun.enabled = true;

        RenderSettings.skybox = skybox;
    }
}

This is my approach on changing the sky

prime moss
stone kestrel
#

If I must create two scenes it isn't much of an issue really

prime moss
stone kestrel
#

Is it possible to do one-scene approach tho?

prime moss
#

I don't think it is

#

I could be wrong tho

#

but thing is, since you're going for two modes anyways, might aswell just make different scenes

#

instead of the daylight cycle I mean

stone kestrel
#

The buildings were going to be different in night too, it's probably better to do that yeah

#

Thanks!

prime moss
#

where depending on the daytime theres different things to do

stone kestrel
#

Nope, I'm making a horror game actually

#

The point is you'll wake up in the middle of the night and your surroundings would change

prime moss
#

that's dope af

#

I have yet to learn realtime lighting though, its really confusing

stone kestrel
stone kestrel
#

It's a difficult process but worth the result to be honest

fallen island
#

So I recently updated my shaders to hdrp and demoted back to urp and now I have pink materials in preview but when I use them theyre fine. Can I fix it somehow?

supple nacelle
tropic tulip
fallen island
#

But when I click 'Lit' again (even though it's selected, then the material reappears in the preview), and when I select another pink material, it's visible normally in the inspector and everywhere else except in the assets. When I click Ctrl + S or restart Unity, the materials in the assets go back to pink, but everything else is fine.

tropic tulip
fallen island
#

Make sure you have at lest forward+ and (second prtscr) per object limit to 8

#

its in assets -> settings

#

in every pipeline asset do it

#

should be good

tropic tulip
#

Yes but that goes for each quality level?

#

For very low, low I have 1

#

then I increase

#

when the quality increases

#

to med, high, very high and ultra

fallen island
#

if you want those flickering lights in low quality levels than don't change it lmao

tropic tulip
#

Its weird bro

fallen island
#

its not so cpu consuming so yk

tropic tulip
#

You have checked the video

fallen island
#

yes I did checked your video and I had the same issue

#

just change it to 8

#

everything will be fine

#

you can always change it back

tropic tulip
#

I just noticed that in most of my quality assets I had 1-2 per object additional lights probably this was causing the issue

fallen island
#

I even think it WAS causing the issue

tropic tulip
#

By the way, thank you very much! What about your issue?

fallen island
#

np

#

but what about my issue

tropic tulip
#

So, you have changed from built in pipeline to HDRP?

#

You dont know how to deal with think pink materials

fallen island
#

yeah but the thing is theyre only in the assets and everything else is fine I can use them normally

tropic tulip
#

Have you tried to upgrade materials?

#

Go to edit then rendering convert

#

or do it manually

#

When I changed to URP

#

omg there were so many pink materials

#

Finally fix them all

fallen island
#

I think I did that but let me try

#

yeah I did that

tropic tulip
#

You have to play with shaders btw

fallen island
#

I mean my materials are fine in scene tho

#

oh ok

tropic tulip
#

To tell you for URP there is an option

fallen island
#

you kind of helped me

tropic tulip
#

Universal Render pipeline I see you use it

#

but you have HDRP

#

I think its quiet different

fallen island
#

I have to change to other urp material and than change it back to lit.

#

Than it works

#

thanks

#

most of them are back I prob have to do the same think with my triplantar shader

#

(with triplantar it doesnt work but Im glad for lit materials its fine)

tropic tulip
#

Hey! Before you said I have to change per object limit to 8 but you didn't clarify it should be changed for all of my quality levels to 8?

fallen island
#

You can change it to 8 for every asset

tropic tulip
#

ok

#

Omg the worst part of the development process is lighting for me

fallen island
#

fr

tropic tulip
#

When working with lighting and rendering and all of these parts

fallen island
#

its like you dont know what is the problem but than it turns out its the easiest solution possible

tropic tulip
#

Yes the same goes with logic bugs in code

#

XD

#

There were situations where I was stuck in logic issues for hours and it was just a boolean or a state that I have changed by mistake

fallen island
#

ikr

#

for now I have 16 scripts in my game and you cant imagine how stupid mistakes Ive been making

tropic tulip
#

You are not the only one I have like 30-40 scripts right now

#

I have made many many

fallen island
#

the worst part is that when I get script from the internet or from youtube video bc I just dont understand how to make smth I often get stupid errors and waste at least 4h to realize I forgot to close smth with }

fallen island
#

anyways good luck with your game

tropic tulip
# fallen island the worst part is that when I get script from the internet or from youtube video...

I recommend not to copy paste thats for sure if you really dont know how to create something watch a tutorial and then try implementing it on your own that way you learn open documentation as well. Then save the system you have made somewhere for example create a folder take a screenshot for next time to have an idea of how implementing it again. Its all about hands on practice for example how to create player movement when you do like one, two, three or more times you will get used to it and next you are going to know how to implement it without every watching a tutorial for it.

#

But there are really different approaches and there are many many systems that you can create in code so its requires practice like everything else you do

fallen island
#

Ill try but yk coding isnt my goal in creating my game but want to do good storytelling thats why I dont really like to waste time with coding too much. But I watch tutorials cus theyre better than raw code copied from reddit post.

tropic tulip
#

Coding is the most important part of the whole development process

#

if you want to give life to your game you have to learn coding otherwise without programming you wont be creating games just static images XD

fallen island
#

I know

tropic tulip
#

I dont ignore the other specialisations just to note

#

All of them are contributing on a project

#

The think we all programmers do and basically a lot of developers is to learn different concepts like generalists

#

Because we are indie devs and we want to create a project on our own so you have to learn creating some certain things on your own without an artist or a game designer/level designer etc

fallen island
#

yeah thats the hard part

tropic tulip
#

Of course its not like being a filmmaker in filmmaking if you want to create a movie you wont do it on your own XD

#

The film industry has other difficulties

#

You need actors, video editors and others

#

In game dev its a bit different we can create a game without having a team

fallen island
#

I literally just fixed my problem and it was that my esc manu paused the game but when I clicked main menu button it havent unfreezed so nothing worked

#

Im so dumb bruh

tropic tulip
fallen island
#

Thats why I don't set deadlines for myself. Just doing my work ๐Ÿ˜‰

bright sequoia
#

my sky is like.. very pixilated ?

#

no idea where to fix that ):

#

wait thats a bad picture to show hold on

#

ah regardless its not showing well on the screenshot. i thought it was my monitor settings or nvidia settings but it looks relatively the same on other devices. anyone know a fix for that?

silver lynx
#

How can I have various cubemaps in the scene. More importantly how can I create cube maps based on the enviorment of the scene?

deft fiber
silver lynx
deft fiber
silver lynx
#

Will they also help with dark objects when I use Skybox as reflection source?

deft fiber
#

That means you should keep the intensity multiplier at 1 unless you need darkness outside of probe ranges

supple nacelle
#

Using reflections as a form of ambient lighting can get tricky, since that kind of light is very specular in nature

deft fiber
#

So if you're baking lightmaps you also should have light probes and reflection probes wherever the lighting changes

#

One reflection probe per room and multiple light probes per room generally

supple nacelle
#

Yeah, ideally you want baked and probes - but that can of course be tricky when injecting non-baked objects into a scene

#

Its always interesting to see how various games deal with dynamic objects in static scenes... to try and make those dynamic objects not stand out like a sore thumb

deft fiber
#

Tricky it can be, but probes are a necessary part of the workflow

supple nacelle
#

Yeah, you can cheat most of it. The usual unavoidable giveaway is the lack of real occlusion shadows that you get from baking. Dynamic objects always end up a bit "detached"

#

Unless they are of course inside of your realtime shadow cones

deft fiber
#

Usually it's fine since you can have them realtime shadows as well as SSAO

#

Even seamless

#

But the challenge is with lighting that's drastically different between different parts of the room, or with awkwardly shaped meshes

supple nacelle
#

yeah, SSAO can help connect them to the ground if they are in a place without direct realtime shadows

#

But they will lack any baked lighting on them

deft fiber
#

Like pipes running all over the wall architecture
They might not be feasible to lightmap but they are crossing over multiple light probes and reflection probes

#

Modern URP and HDRP luckily have APVs and spatially blended reflection probes so there's tools to deal with it

supple nacelle
#

For what I am working on I have not found a light probe solution, since I don't load scenes, I store room segments as prefabs

#

Prefab Baker lets me lightmap them, but I can't do light probes

#

The workflow of making some 100 room segments all as scenes is just not something I want to deal with

#

They can all get rotated and moved to connect, so scenes seems daunting as a solution

deft fiber
#

Can scenes even be loaded with an offset or rotation?

#

At least they can be loaded in async unlike prefabs I think

supple nacelle
#

They can be - or if not the static objects likely can be, but the authoring process is cumbersome with scenes - but if I find I have to use light probes I can always move to that

#

The authoring and testing with Prefab baker is just so much quicker and easier than dealing with scenes and scene loading. And when I start dealing with pooling of segments scenes really start to seem icky

deft fiber
#

You may be able to bake just the LPG and store it separately
Since afaik you can just read, write and move the light probes however needed

supple nacelle
#

Scenes might be the right answer, I have just always avoided them

deft fiber
#

Might be able to store light probe groups in an SO and write them onto runtime created LPGs at runtime

supple nacelle
#

I am just avoiding it for now. Mixed lights and lightmaps with reflection probes alone are getting me what I need - but I do find myself getting creative with placement to avoid the pitfalls

#

Very possible. I am avoiding falling into the trap of developing a whole lighting layer now until I get a core game loop I am happy with

#

Its easy to get lost in these things and end up not making a game, and just making "tools"

deft fiber
#

Always a danger

supple nacelle
#

Once I have a game loop I like, I will revisit the authoring

deft fiber
#

Would be cool if the editor had tools in it

supple nacelle
#

Yeah, I just wish these things weren't scene based and were just object based

#

Unity really wants to be scene based, and I really don't want to be ๐Ÿ™‚

deft fiber
#

I'd love a tool to manually create and modify probes
Could finally create areas of darkness for interiors without any baking

supple nacelle
#

Yeah, that would be very nice. And I am sure the API allows for it with what is exposed - but at that point I become an Asset Store creator again - which I don't want to be

#

Anyway, I am at the moment fine without light probes, so just putting a pin in it for maybe later

static igloo
#

hey, how to fix egacy Light Probes are enabled in the Projectโ€™s Render Pipeline. These are not supported by Terrain, therefore the Sceneโ€™s Ambient Probe will be used instead?

static igloo
deft fiber
#

Like it says the limitation is that you can't use Light Probes for Terrain so you have to use one of the alternatives

#

Usually you'd use lightmaps, but APVs may be an option too

static igloo
bright sequoia
lost pecan
#

I'm looking for a way to scale an object down in Unity, AFTER it's been lit. Or something that achieves that effect

lost pecan
#

Basically trying to use 3D models and lighting in-game, but scaled down to nearly flat so that it appears like pre-rendered graphics with dynamic lighting

#

ChatGPT says I can scale the model, without scaling the normals so that the lighting stays consistent. Can someone confirm it didn't make that up?

deft fiber
#

That'd be correct

lost pecan
#

Hell yeah, thanks.

deft fiber
#

Can be done with shader graph easily by scaling vertices along one axis

#

It won't affect shadowcasting though, since it doesn't rely on normals

lost pecan
#

I may not need it, but I'm curious as to how I might

deft fiber
# lost pecan Oh, good point.. is there a way to cast shadows as well?

It will cast shadows, but using the flatter mesh
If the vertices were not flattened in the shadowcasting pass, that would make for correct shadows but only against environment
For self shadowing and anything coming close to the object I think it'd reveal the shadows are detached in space

lost pecan
deft fiber
#

Yes

#

The flattened mesh would visually receive shadowing from that "ghost mesh"

lost pecan
#

What about vertex lighting? I dont mind the usual drawbacks of vertex lighting since this is a retro aesthetic anyway, could I cast shadows onto the mesh that way and have them flatten with it?

prisma valley
#

How do these things work?

#

I downloaded a sky bundle package, and these came with it.

atomic mural
#

is there a way to get a particle system to emit 2d lights? can't seem to get it to work and google isn't being very helpful either

atomic mural
#

yea i found that, is there no better way?

deft fiber
#

Useful for non-light objects as well
But if you want the light to inherit particle properties like color or intensity, you'll need to modify the script

deft fiber
pallid gorge
#

Is there a way to disable Adaptive Probe Volume on certain renderers like with the regular Light Probes?

prime moss
#

does anyone know why is my light behaving weirdly? shadows seem inconsistent and colors from materials don't help either

#

i am controlling the rotation of my sun (directional light) through that slider

#

running on urp, I posted something similar previously but got no answers

scarlet geyser
finite zinc
#

When i make a new light the previous one dissapears and it keeps going back and forth. how do i fix this? i am using realtime lighting by the way

finite zinc
#

How do i fix my shadows?

prisma valley
deft fiber
deft fiber
prime moss
#

the shop interiors have their cast shadows to off because when they are on, there are some weird outlines going on

#

I changed my sun's direction and it got better, but now im just dealing with my shop's interior not rendering correctly (its too bright for what is going on outside, unless I make the outside as bright, which tbh would make it good because it'd be visible)

#

yeah the inside isn't behaving with the light at all

prime moss
#

why does this happen? at first I thought it was post processing but the materials glow even without it (without the bloom obviously)

#

what am I doing wrong? I cant really setup a no post cam because it'll break my glass shader that cuts out the wall through a stencil shader

pallid gorge
prime moss
#

they happen on runtime aswell though

#

this is what happens

pallid gorge
#

I think your post processing is still ON somehow or you just have bloom render feature (if URP)

prime moss
#

i have the bloom render yes, but its supposed to be on

pallid gorge
#

check your Universal Render Data Asset

prime moss
#

the problem is with the material

pallid gorge
prime moss
#

yes

prime moss
#

it is not behaving with the light at all

pallid gorge
# prime moss the problem is with the material

not really, you see, bloom is not a perfect technology, it just takes most bright parts of the screen, blurs them and then bust slaps result on top of your screen. As you can see, your walls are perfectly white, which is the brightest color you can have

prime moss
#

the wall and floor materials of outside are perfectly fine

#

but the interior ones are just glowing too much

pallid gorge
prime moss
#

here ya go

#

theres even the info of the material at the side

pallid gorge
#

look, these materials are a lot less bright, so bloom just ignores them

prime moss
#

the base map has to be white to preserve the true color of the material I want, but it makes it glow, so how tf am I supposed to do anything?

pallid gorge
#

basically with bloom - yes, but there are some ways around it:

  1. if you want only light emmiters to glow, you can use Lens Flares, they are not perfect, since they are manual and pretty limited to a certain shapes or sprites. (There are some kind of Flare technology for bright areas on reflections, but I don't really know much)
  2. Eye brightness adaptation effect. This is a method that simulates eye adaptation to the bright colors. Basically, it takes area of most bright parts of the screen, and if it is bright or big enough, it makes whole screen brightness lower, which can help to reduce bloom effect on pure white walls.
  3. Use trigger Post Processing volumes to disable bloom in such areas.
  4. Write your own render feature to render objects that you need to glow separately from everything else. You can make this opposite one to render white walls separately from glowing objects though, bit I think it will make bloom cut off in some places
  5. Make bias in bloom higher and your walls slightly darker. Players won't notice they are not perfectly white if the whole game doesn't contain perfectly white objects, human eye will just adapt and pretend your walls are white
#

I hope this will help ๐Ÿฅน

pallid gorge
prime moss
#

this is with all visual effects not being displayed on my editor screen

#

and its not meant to be this bright, there is no emission, its just using urp's default lit shader

#

so something is affecting this and im unaware what it is

#

every object i create, its material glows a lot for some reasno

#

its not my sun either

pallid gorge
#

maybe ambient light color?

prime moss
#

you mean like a skybox?

pallid gorge
prime moss
prime moss
pallid gorge
#

try disabling it

prime moss
#

my intensity was at 5 no wonder lmao

#

but now everything looks dark af

pallid gorge
#

baking light will help you

prime moss
prime moss
pallid gorge
#

indirect and bounces make scene look cool with baked lightmaps

prime moss
#

it needs to be realtime

pallid gorge
#

there is mixed lighting and light scenarious

prime moss
pallid gorge
#

I am not really a mixed light guru, but there is plenty of info and tutorial on it in internet, but as I know, it will if you do it right

#

and I am not sure if I am allowed to say such things here but ||maybe you should use Unreal if you need scenes with great realtime light||, or as I know HDRP is better for realtime light ๐Ÿ™‚

prime moss
#

not right now anyways

prime moss
pallid gorge
#

yeah, it's the catch

prime moss
pallid gorge
prime moss
#

i think i dont have it setup correctly because it has a autogenerate ticked on

pallid gorge
#

by default all new lights you create are realtime

#

you can adjust settings in project settings and URD Asset + URP Asset

prime moss
#

well now I just need to get rid of this weird ray

#

i dont understand this at all

pallid gorge
#

yeah, lights can be a pain ass sometimes

torn pelican
#

lights are always a pain in the ass but then they endd up looking pretty so we forgive them. mostly.

deft fiber
# prime moss well now I just need to get rid of this weird ray

Assuming you are using realtime lighting you'll want to pad the outside of the corners with shadows only geometry to block light leaking
Fully sharp geometry corners from the perspective of a light appear as gaps, and also shadows are a bit offset from the surface which makes them leak through geometry that are too close to each other

prime moss
#

behind the scenes

deft fiber
#

Yes

#

Probably the best kind of "filler" mesh is a smooth-shaded shadows-only cube
Smooth shading ensures that the corners of it cannot also leak light through

prime moss
#

where do I make my cube shadow only?

deft fiber
#

But they can also be quads if it's beneficial to have it one-sided, or any shape if you need it to conform to more complex wall shapes

deft fiber
prime moss
#

thank you :D

#

something like this?

deft fiber
prime moss
#

it causes this in the runtime (by the window's sides you can see the shadow) maybe I should make it more distant?

prime moss
#

but yeah now its just tweaking around

deft fiber
#

You will have to tweak the positions and or sizes

#

The fillers don't have to be close to the walls, as long as they cover the corners from the light's point of view

prime moss
#

now it works, i had to put it on all faces except on the front so yeah

deft fiber
# pallid gorge there is mixed lighting and light scenarious

Mixed lights are static and not movable
They are baked but also utilize a realtime component for high quality direct lighting and shadowing
Lighting scenarios are specifically a feature of APVs, allowing you to swap or blend between more than one bake
Because it's APV, it will not help with direct lights or shadows but allows the ambient light to more or less match the change

#

Realtime GI would allow for realtime changes in indirect/bounce lighting, but it supplements realtime lighting so it won't help with their specific issues

#

Different render pipelines and different engines have their advantages and disadvantages but I would not recommend swapping without understanding of how those (dis)advantages would compare with the tech the project is currently using

prime moss
#

i can also make my script not count decimals and only whole numbers to make that process much easier

#

because realistically who tf cares if its 1 hour and 20 mins or 1 hour and 34 minutes

#

i tried using my app on a macos I work on (using parsec on my home computer atm) and shits so laggy, running at like 10 to 18 fps ๐Ÿ˜ญ

#

and my objective is to make this shit run on weaker computers at least at 30 fps

#

60 would be ideal for smoothness

deft fiber
#

You could, though bakes tend to take a lot of space on disk

prime moss
prime moss
#

i dont have a lot of things to reflect and bounce on in my project tbf

#

this is everything

deft fiber
#

Entirely depends on the quality you want relative to baked surface area

#

You can do test bakes and then calculate the size of the lightmap assets times the number of lightmaps you want

prime moss
#

in my case

deft fiber
#

I have no idea about neither how high quality you want it to be or how small your filesizes will need to be

prime moss
#

is there anyway I can derender these prefabs under the scene?

deft fiber
#

They're not rendered if they're outside of the camera's view frustum

prime moss
#

if i had to set one it'd be like 1gb?

deft fiber
#

That's for you to balance

prime moss
#

for my whole project that is

#

not each filesize

prime moss
#

cast shadows are off but their materials still reflect n stuff

#

wait no it shouldnt be off

#

because im cloning them onto the shopfront

deft fiber
prime moss
#

does lighting data keep on adding it up or does it reset each bake?

deft fiber
#

You can disable the renderer components or gameobjects entirely if you don't want them to be involved in any renderering even accidentally, including directional light shadow casting

deft fiber
#

Your realtime objects would be in another additive scene on top of that

prime moss
#

I could make each scene for each hour of the day, but that's goofy as shit

#

lighting is mainly the thing affecting my performance if I had to guess

pallid gorge
deft fiber
prime moss
prime moss
#

its an example

deft fiber
#

Example of a value?

#

In your case

prime moss
#

idk changing an UI text, a button doing x action

deft fiber
#

None of that would be in your static environment scene

#

All your gameplay would happen in a separate additively loaded scene

prime moss
#

and how would it even keep track of the tv placements of my scene?

#

specially after the fact that you can move it around

deft fiber
#

TV placements?

#

Nothing you bake lightmaps for can be moved, or removed without invalidating the baked lighting

#

So everything that's baked is static, and only needs to change if the time of day changes

#

That'd be you changing the active scene to one with different lighting

#

The gameplay scene(s) would be additively loaded and totally unaffected

#

They'd still get baked lighting via light probes from the active scene

#

Iirc it's possible to bake lighting into multiple scenes with another scene additively loaded, so the lighting scenes don't even need to have any geometry in them as long as the baked lighting is associated with geometry of another additive scene
Changing the active scene likewise gets all the static lighting from it

#

But in your case since it looks like your only static objects are a plane, a wall and a boxy room it wouldn't make a practical difference even if you duplicate all of those for each light scene
The lightmaps are the big thing spacewise

prime moss
deft fiber
#

Not immediately obvious before you understand baked lightmapping and also additive and active scenes

prime moss
deft fiber
prime moss
#

meaning light will always reflect from somewhere else

deft fiber
#

So I gathered

prime moss
deft fiber
#

What I'm explaining is what you would do if you wanted to have a set of baked lightmaps for every hour

#

Since that's what you asked about

prime moss
#

ah

#

well yeah but im having a hard time understanding it

deft fiber
#

Hard to understand if you're not familiar with the systems or workflows involved

prime moss
#

im just slow ๐Ÿ˜ญ

prime moss
#

and i dont count slapping some lights and calling it a day

deft fiber
#

If you want to know what kind of a performance boost you'd get with baked lighting, simply remove your lights from the scene and test then

prime moss
#

on the left its how my project currently looks like, same performance

#

not the same project btw

prime moss
#

and on older computers wont the transition from each scene to another be pretty noticiable?

deft fiber
prime moss
deft fiber
#

Simply put you can load multiple scenes at once, and unload them on command

#

Scenes work much the same as prefabs in practice
Main difference is that scenes contain scene specific data like environment lighting information, but they don't have a Transform and cannot hierarchically contain other scenes

#

Your game doesn't have to take place all in one scene, and there's no particular benefit to using just one scene at a time

deft fiber
#

@prime moss I want to clarify that this scene stuff is all what you would do if you really were swapping scenes for lighting all the time
It's not your only option, though you don't have many good options with your stated goal
Cheap global illumination with shadows is very ambitious

barren niche
#

I added URP to my existing 2D project. I've made a test scene that contains a gameobject with a spriterenderer using the sprite-lit-default material. With the global 2D light, I can clearly see the sprite being affected by the light source. However, the moment I add in a spot light, no matter configuration settings I use, it's pitch black. I've tried different Z positions as well.

prime moss
#

does anyone know how to make my texture not be affected by light? so it'll remain the same color regardless of light (and maybe even add a slight glow because its a screen)

supple nacelle
prime moss
#

how can I make this emissive object actually emit light outside of the lamp?

supple nacelle
#

Emissive is going to only apply to other objects when baked

prime moss
#

this barely baked in the scene

supple nacelle
#

Is that not the outcome you expected?

prime moss
prime moss
prime moss
#

but its obviously inside the lamp cover

supple nacelle
#

Materials can't act like lights in realtime. Maybe in 20 years

#

Your lamp cover has faces on the inside that are static?

prime moss
supple nacelle
#

You also are getting into the territory of subsurface scattering if you want your lamp shade to glow from the inside

prime moss
#

should I turn off the static and just rebake it?

supple nacelle
#

It needs to be static if you want emissive light to affect it

prime moss
#

ahh

#

it explains a lot actually

supple nacelle
#

Does that lampshade have inward facing faces as well? Or altneratively is its material two sided?

#

Either way, that shade will stop the light from passing through in the bake

prime moss
supple nacelle
#

If you want a glowing lamp shade, you will likely just want to make an emissive tecture for the shade itself

prime moss
supple nacelle
#

Unity might have some kind of transparency/scattering handling for baking, but I don't think so

prime moss
#

thats actually cleaver, and fits my stylized graphics anyways

supple nacelle
#

To the baker, your lampshade is a solid light blocking object

prime moss
supple nacelle
#

The main question I usually have to ask myself when dealing with any of these kinds of lights is "Am I planning to make this light togglable"

barren niche
#

I added URP to my existing 2D project. I've made a test scene that contains a gameobject with a spriterenderer using the sprite-lit-default material. With the global 2D light, I can clearly see the sprite being affected by the light source. However, the moment I add in a spot light, no matter configuration settings I use, it's pitch black. I've tried different Z positions as well. Does anyone have any ideas?

dense spruce
#

How can I achieve, in unity hdrp, a completly black scene when the directional light cannot illuminate anything (exemple: facing up when doing a day night cycle)?? Im tired of the scene always being a little bit illuminated. When I fixed it, all the shadows became 100% black, no transparency. I wanna have a dark scene and good looking shadows at the same time ๐Ÿ˜ญ ๐Ÿ™

#

๐Ÿฅ€

nova geyser
#

all my unlit textures are significantly darker than the base texture files for them. any ideas for a fix?

hearty siren
#

Is there a bug with Unity 6 + environmental lighting (skybox)?

CONTEXT:
I just checked between Unity5x (2022.3.62f1) + Unity 6x (6000.0.46f1 ++ 6000.2.0b3).

SANDBOX:

  1. URP (Universal Render Pipeline)
  2. Deferred Render Path
  3. Empty Clean Projects
  4. Using AllSky (Free Demo Assets)

SETTINGS

  1. Almost nothing was changed in each version in respect to the editor.
  2. Both are the exact same setup apart from engine version as far as I can show.

EXPECTATION:
Changing the Skybox in the Environment tab should have an affect on the world objects.

Did something change?
Am I missing something?
ThinkEyes

#

~ It looks like Lighting/Scene/"Workflow Settings" ("Recalculate Environment Lighting") is either remove or relocated in Unity 6.

This being checked ON = the result I want (5x) and OFF = acts like Unity 6x out of the box.

Does anyone have info on this?

--

What is really weird; is that if you set Environment Lighting Source from Skybox to Color; changing the Color+Emission works as expected. Just not when it's set to Skybox (as desired).

deft fiber
#

Probably because it was a source of a lot of confusion, because the automatic recalculation isn't saved anywhere so it disappears as soon as you swap scenes in play mode or build and run

#

You always had to Generate lighting to persistently save environment light into probes, but now it's more apparent when that's required

#

It's still confusing what exactly you're generating when Generating lighting though
Just to get scene lighting you don't need to bake Realtime GI or Baked GI

#

(also, Unity 5 is the version before Unity 2017)

deft fiber
nova geyser
#

i'll check out the global volume

#

yep i had tonemapping on

#

thanks a ton

hearty siren
# deft fiber It's still confusing what exactly you're generating when Generating lighting tho...

A lot of what you said here makes sense; especially for Baked Lighting Workflows.

But what are the Realtime Lighting Workflows now?

It seems the Skybox Material / Exposure doesn't even have an affect on Scene until you Generate Lighting (aka bake).

It seems like Realtime lighting workflows may be busted in Unity 6 unless I am missing something?
~ Especially pertaining to Skybox/EnvLighting/SkyboxMaterialUpdates
~

deft fiber
#

For example even if you have realtime lighting only, your materials can't get lit by the scene sky unless the sky has been baked into an ambient probe and a reflection probe which the shaders can then access for realtime lighting

#

That's what Generating lighting does without Realtime GI or Baked GI enabled

#

And it's what you had to do in previous unity versions as well if you wanted materials to respond to changes in the scene sky

#

Or if you do it at runtime, generate the two probes from a script
So it's not "busted"

#

Officially if you bake Realtime GI, then the scene probes will update in realtime
But it's a whole system so it may have more overhead than doing the update manually

#

Ironically it also relies on lightmapping
Though just for updating probes you don't have to use that part

boreal vault
little mica
#

Scene view darker than game view. I did almost everything to looks like a scene view but no luck. HDR, Post-processing etc. Any idea on this?

dense mural
#

Any reason why my area lights are not showing up at all in my scene? I have baked global illumination turned on, I checked that I have max bounces > 0 (2 right now), my objects that need to be lit are set to static and have contribute global illumination checked. Not sure what else it could be

deft fiber
dense mural
#

ill test rn

deft fiber
#

You should at least be getting environmental lighting

dense mural
#

I am getting directional light yeah

#

checking with a baked point light rn

deft fiber
#

Specifically so that they're drawn on the lightmap textures that you can see with scene view overlay or from the lighting window

dense mural
#

the walls are dark gray that should be lit, which I'm guessing means they aren't receiving light?

dense mural
#

sure one sec

#

it is an interior scene I should mention

#

some random floor tiles seem like they're getting light but some arent

deft fiber
# dense mural

Is that an overlay in the screenshot?
Anyway, because the lightmap texel squares are of random sizes and as you say some are getting light that means your meshes don't have lightmap UV maps

dense mural
#

yea that's my wallpaper, the window is slightly transparent I just never got around to changing that

dense mural
deft fiber
dense mural
#

when would I want to bake below 40 resolution? just for testing quickly while I'm developing?

#

I'm also getting weird shadows on my modular walls on the edges where they touch, I vaguely remember having this problem before and I think there's a normal bias setting or something somewhere that fixes that but idk if that's the right way to do it

deft fiber
dense mural
#

gotchu, makes sense

deft fiber
dense mural
#

gotchu, I'll give that a read. Thanks again for the help, much appreciated

deft fiber
deft fiber
boreal vault
#

not the SSAO, so i don't know

#

I will retry some things

deft fiber
boreal vault
deft fiber
#

Increasiong depth bias together with increasing the light's near plane probably is your only quick way to fight it

#

But both cause problems elsewhere the further up they go

#

A fix really would be to create a system that renders only the exposed faces of your geometry as quads

#

It'd be prudent for performance reasons as well

boreal vault
deft fiber
boreal vault
#

ohhh, before i was using plane and it bugged, but i neved tried quads

#

thanks i will try with it

deft fiber
#

If the player builds a 4x4 structure of pillars, there will be 16 visible faces, and 48 unseen concealed ones
Another 32 if the top and bottom are not removed
And an extra 160 if your floor and ceiling are also cubes for each grid square and not removed if blocked by a wall

deft fiber
boreal vault
#

a plane has more polygon, or a quad ?

deft fiber
#

A quad is one face made of four vertices / two triangles

#

"Plane" is not an exact term, unlike quad, so if you create a plane in blender it gives you a quad

boreal vault
#

oh yeah, 4 vertices instead of 121 ๐Ÿ’€
Thanks for all the infos :)

upbeat sinew
#

how can i fix this with baked lighting, im using a point light and the room is made with probuilder and the rest of the things in there in blender

upbeat sinew
deft fiber
#

Texel invalidity can appear in wrong places if you also have UV overlaps, c.9

high burrow
#

hi i have an issue, in scene view my point light is visible whereas in in game view it is not does anyone know how to fix this

deft fiber
#

Which means it's illuminating something that the camera is not seeing, or it's a lens flare of some kind

#

We'd have to know what

stone kestrel
#

๐Ÿ‘‹

#

I'm trying to use baked lights here, but although I've marked the two prefabs that can be seen on the screen and the terrain itself as static, it doesn't seem to work

#

Here's a comparison to the Mixed mode

supple nacelle
#

Where is the very soft shadow under the car coming from?

stone kestrel
stone kestrel
supple nacelle
#

I would assume that that shadow under the car is baking, its just a VERY low resolution bake map, or a bake map that is just covering WAY too much area for its size?

#

If that whole field is designated as a baked area, it must be stretching your map over a huge amount of area there

stone kestrel
#

These are my lighting settings, does it help resolving the issue?

stone kestrel
supple nacelle
#

You first need to understand what baking is doing here

stone kestrel
#

As far as I know baking is pre-generating lights for static objects

supple nacelle
#

If you want that all baked, its going to produce a LOT of map data, and you need your UV1 to be mapped in a way to keep the resultions in a reasonable range.

#

I don't know the best practices for that since I have never tried to bake a massive single area like that

#

But I would expect you need to break it up into smaller squares

stone kestrel
#

Well I'm not sure how baking works really, I'm in the state of learning it

#

So I shouldn't use baked lights for this terrain?

supple nacelle
#

It basically renders shadows to a 128x128 up to a 2096x2096 bitmap and uses UV1 by default

#

So the bigger your surface that UV2 covers, the fewer pixels per square inch

supple nacelle
#

Not sure what the standard best practice is for outdoors and light baking

#

You might be able to use the multipler on the Renderer to get it to produce multiple maps for one mesh

#

But I am just guessing

#

I have no idea if you can put numbers greater than 1 there to force it to create multiples

stone kestrel
#

I'll try

#

Also even if I set Light>General>Type to Realtime and hit Generate Lighting, my light still changes

#

Doesn't clicking Generate Lighting only bake lightmap?

supple nacelle
#

It may rebuild some reflection and light probes as part of that, but not sure

#

But if you switch to realtime, it may just not be clearing the baked data until you generate

deft fiber
deft fiber
# stone kestrel Doesn't clicking Generate Lighting only bake lightmap?

If Baked GI is enabled, lightmaps will be baked for any meshes that have Contribute GI static flag on and are set to receive GI from lightmaps
Even if no baked lights, the light generation will use the environmental light which any Contribute GI static objects will realistically occlude

#

If Baked GI (and Realtime GI) are disabled and you generate lighting, it will generate the scene's singular light probe and reflection probes, so that materials can be lit by the scene's environmental lighting / the skybox

stone kestrel
#

๐Ÿ‘‹

#

Why does this tree not have any shadows although it's prefab is marked as static + terrain's lightmap scale is 1?

stone kestrel
high burrow
prime moss
#

why isnt light reacting when I move my sun?

supple nacelle
supple nacelle
#

You may need to turn off all of your other lights, hard to tell what the main light is in that scene or what its expected to look like

deft fiber
deft fiber
prime moss
#

yes but the interior isnt getting lit, I tried baking those lights specifically (the point lights on the ceiling of the interior) and still the same result

#

so im out of ideas now

#

these are my light settings i guess

#

this is the best i come up with right now, but it's just wrong,

#

how can I make it seem lit, without those big ass circles?

#

or just make it the way it's supposed to be

deft fiber
#

Is the question about the sun or the interior lights?

prime moss
#

I have fixed them just now though, i baked the lighting inside and it now just works

prime moss
#

how do I fix this artifact?

#

that's a very odd thing to be happening

deft fiber
#

Note that you're also using realtime GI lightmaps in addition to "baked lightmaps"
It can be confusing because they're two different lightmap systems that can exist in parallel

pallid gorge
weak stream
#

any idea why the Unity Learn project for Creative Core - Animation looks like this ? darkening/lightening based on my scene view perspective

deft fiber
glass sinew
scarlet geyser
#

if you want a "real" until mode, you can find it in the Renderer Debugger

#

"Materials - Material Properties - Albedo"

weak stream
# deft fiber I'd guess it might be very wide SSAO, or a special shader on the meshes material...

I thought materials too, but it's just URP/Lit. I tried with no smoothness, specular highlight, nor env reflections. no improvement.

I also tested disabling PostProcessing and the only light (directional, which oddly doesn't seem to affect anything). it's like my editor cam is a directional light, right?

for more context, I started with a new installation of the same editor this Unity Learn project was saved with, 6000.0.16f1, and it loaded with that Render Graph warning. is that relevant?

I thought upgrading might help (6000.1.4f1), but again no improvement.

stone kestrel
#

๐Ÿ‘‹

#

What is exactly GI?

#

And how does mixed lighting work?

weak stream
weak stream
queen trout
#

is there a limit to how many lights you can cast on an object or something? why does this happen

queen trout
#

(all the buildings are a single model)

deft fiber
queen trout
stone kestrel
#

๐Ÿ‘‹

#

When I generate lighting, every side of my car is lit. As I'm using a directional light with a rotation, I only expect some sides to be lit. Why might that be?

deft fiber
stone kestrel
#

As can be seen, both sides are lit

deft fiber
stone kestrel
#

I only got this light object for lighting in my hiearchy

deft fiber
stone kestrel
deft fiber
#

Yes

stone kestrel
#

My intention is not that to be fair, I'm looking to fix this

deft fiber
#

Fix how?

stone kestrel
#

I mean, I wouldn't expect all sides of the car to be lit, looks weird

deft fiber
#

Should be pitch black on the shadowy side instead?

stone kestrel
#

Yeah

#

Oh, I think I found it

#

Seems like this part

deft fiber
stone kestrel
#

See, something like this

deft fiber
#

I would not darken all the reflections in the whole scene just to better approximate the reflection intensity on the shadowy side of one car
But perhaps that is acceptable in your situation

stone kestrel
deft fiber
#

Yes
Each area where the lighting changes noticeably benefits from a reflection probe

#

And you usually want one covering the whole scene at a lower priority

stone kestrel
deft fiber
#

Considering your whole scene has a grass floor
Then the reflections below won't be from the sky under the scene that's way brighter than your actual ground

deft fiber
stone kestrel
#

Makes sense

deft fiber
#

Then even shadowy areas have less of a disconnect between the surrounding brightness and the reflected brightness

#

The area where the car casts a shadow could even have its own local reflection probe that only covers the shady side smoothly using blend distance
Downside is that reflection probes can't be rotated

stone kestrel
#

This is how I set it up

#

And although I added this global reflection probe, when I change environment reflections' intensity multiplier value, there is still a bit of change

deft fiber
deft fiber
#

Preview not visible

#

If the window is not enabled at the bottom of the inspector, you can click the bar with two long horizontal lines to enable it

#

For whatever reason it shows a resizing cursor when hovering over it

stone kestrel
deft fiber
#

Looks right
In theory that should be the reflection on reflective objects, not the environment lighting

#

Additionally it's useful to create a sphere or a capsule in the scene with a smooth metallic material
That reveals you what reflections a real object would be getting in the scene at a specific location

stone kestrel
#

It looks like this

#

Oh yeah, it definitely works. I disabled the reflection probe I've created and it turned into a sky reflection

deft fiber
#

Never really tried it because intensity 1 is accurate

#

A pure chrome reflection shouldn't be darker (or brighter) than its surroundings really are

#

Locally shadowy areas are always a a bit of a problem for realtime rendering reflections
That's why SSR and RTX reflections are so popular
But darkening all reflections for the sake of a particular spot is unlikely to make things look more realistic, since it'll make every reflective material less correct

stone kestrel
#

But it seems like it works for the entire scene

#

I'm sending a video

deft fiber
# stone kestrel

I'd expect this is because probe blending is disabled in graphics quality / URP asset

stone kestrel
#

Thank you so much, learnt a lot of things today

glass sinew
prime moss
#

how can I make these artifacts disappear? they are so weird, they only show up around 4am and 8pm

#

its baked lights (the sun is realtime however)

#

could it be a material thing?

prime moss
#

fixed it, it was a shadow thing, i worked it out

#

in case anyone is having the same issue, what I did in my case is have planes around the scenery and set them to shadows only, and make them static, and check contribuite global illumination

#

they are setup like this to stop shadow artifacting on my interior

stone kestrel
#

๐Ÿ‘‹ I've imported Tokyo Street environment. It has multiple reflection probes in different locations with same intensity, but it also has Intensity Multiplier in Environment Reflections to 1 too. Why are additional reflection probes used in this case?

supple nacelle
#

As you move away from one and toward the other, there should be a crossfade that happens, based on the settings of the probe

stone kestrel
stone kestrel
supple nacelle
#

yeah, the skybox itself shouldn't even be seen as a probe if you have probes. But those probes can have the skybox rendered into them when they bake themselves

#

But normally, there is only one probe that is used as a reflection at a time. the SRPs allow an option to blend those, where it will crossfade a mix of two if you move between two of them

#

blend distance is the "buffer" around the box where this probe will crossfade with any other overlapping probe box

#

Intensity is just your typical multiply to the texture for that probe

#

Usually best to keep intensity at 1, otherwise you will start juggling some unrealistic and hard to manage reflection behaviours

supple nacelle
supple nacelle
stone kestrel
#

The skybox probe and the ones we manually create

supple nacelle
#

The skybox doesn't blend though

#

The skybox is just (optionally) what your render probes will use as as the clear flag

#

The probes themselves are what crossfade, based on which one the object with the reflective texture is closest to

#

Assuming you have blending enabled

#

The skybox will be used as well if you have no probes, its the fallback

static igloo
#

Hey, I have this weird bug for a while now, and I can't find a fix.

Throughout my game I only use Area Lights, and at some point they break and even though lighting walls and props, they won't light the terrain. What could be done, please?

#

Got this warning also

icy elk
#

I have only 1 light source on my scene (unless skybox counts), it's on the left you can see it selected in the screenshot
why are there shadows on my walls going from right to left?

supple nacelle
#

Are you sure that is the light in our scene? And you aren't just not noticing the default scene light? Or is it possible you baked that light in the previous positon, moved it, and didn't rebake?

prime sedge
#

First time baking, I'm guessing there is no progress or % indicator just thiss?

#

well damn ๐Ÿคฃ

#

Just noticed this my bad

supple nacelle
#

NM, misread you. Looks like you requested the bake

#

Yeah, the progress bar is down there since you can keep working. A modal progress bar would be annoying as hell

icy elk
supple nacelle
#

It would just be one of the first objects in the default scene if its there... like Main Light

#

If you turn off the light that you think is your only light, do the lights go out?

icy elk
#

this is the one I added

#

I'm not new to unity, just never played with lighting

icy elk
#

thought it's not completely dark

#

with light on

#

I disabled the shadows on my walls, but the golems still have shadows and they're not affected when I move my light

supple nacelle
#

Moving the light won't affect directional

#

its angle is its angle, regardless of location

#

it simulated infinite distant light, like a sun

#

so where it is makes no difference

#

Its rotation is all that matters

icy elk
#

lol, so I just need to adjust the rotation, thx ๐Ÿ™‚

supple nacelle
#

yup

icy elk
#

guess I really need to go watch some tutorials on this ๐Ÿ™‚

#

yeah that works

supple nacelle
#

Its different than the other light modes

prime sedge
supple nacelle
#

Just might be a bit slow for your first bakes

prime sedge
#

Yeah only another 30 mins not too bad tbh

supple nacelle
#

You can bring those sliders way down, just to get your settings in the ballpark

#

just nice for it to be < min so you can see if you are wildly off somewhere before committing to an hour bake

prime sedge
#

Yeah i'm worried i'm gonna have to delete this map anyway as some stuff is probably goofed up

supple nacelle
#

Then I would personally just keep those settings stupid low this early in dev

#

Will look blorpy, but you just want to make sure your lights are in balance and covering what you think they are covering at this point

prime sedge
#

I'll let this bake finish and have a look and then probably watch a few videos on best 'quick bake' settings and good 'final bake' settings

supple nacelle
#

Just pulling those sample sliders way to the left will cut your bake time WAY down. Can also shrink the map size. Half the size = 1/4 the render time

prime sedge
#

What's a good final bake setting?

supple nacelle
#

All the way up ๐Ÿ™‚

#

It really just comes down to how long you are willing to wait for bakes. The longer you are willing to wait, the better it will be

#

There is no quick and easy answer, because it completely varies with the nature of your geometry

#

But you will reach a point with those sliders with moving them any further to the right doesn't really make a noticeable difference... and that is about where you want to probably be

prime sedge
#

It's a very dark game that relies on atmospherics alot so I want to make sure I get it right for sure

#

I didnt realise how important lighting would be before I started this but it makes a huge difference.

#

Same room with/without tweaked lighting/post processing

#

Ah I messed up I think, Half my objects in the scene are not marked as 'static' lol

prime sedge
#

Or the light isnt going to 'hit them'