#archived-lighting
1 messages ยท Page 42 of 1
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
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
There's no such bounce light thing, light limit is per object for each light whose range reaches the object
So the second theory is right, light ranges are important for limiting the reach of lights for staying under the limit
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
So would the solution be to make in every pipeline asset per game object limit at 8?
That's easy to test isn't it
Yeah but Im on my phone rn and my computer is off so yk just asking ๐
It most likely would
If not, that implies you have a script that directly changes the light limit
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?
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
I think I would rather increse the limit. I just imagine my game would look much worse with less range on lights.
Indeed, for the sake of quality levels actually being able to improve performance it needs to be seriously considered if keeping the count high is acceptable
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
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)
Ik but I have to have overlaping lights to not make my rooms too dark bc my game doesnt have any other light sources like directional light
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
"Have to" is situational
Baked lighting could be an option
yeah, generally you sound like you might be falling into the "ambient light" trap
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
Checked my only script that could have had these and nothing there so its not the problem.
Are you opposed to baked lights for some reason with your use case?
Or just environmental light
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
I think you'll need to get more empirical than that about it
How's it the script that could have something relevant if it has nothing relevant
And how do we know if it doesn't turn out to have something relevant
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
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.
also all this only happens in the editor, its fine in build
Ive checked one of my scripts that Ive only earlier added possibility to change graphics settings and I deleted everything in there that was able of touching graphics settings so if there are other scripts that are generated automaticly I sould check than let me know please.
Hope I havent skipped anything
Closed not closet*
"can't have 2 lights" because of operating in closed environment so using many point lights to simulate bulbs
I don't know what that means
Might need a visual example when you're able to provide
Baked lights are only baked if you have baked the lighting into lightmaps (and light probes) through the lighting window with the baked lightmap workflow, otherwise they render as realtime
I'd scrutinize every script that's in your assets folder
There are no automatically created scripts that wouldn't be visible to you to my knowledge
When you can show it we would also like to see your projects settings > quality tab
Smth like this. This is start of my game for example
So I have to render them and it doesnt work if I just change it to baked?
Certainly points to an editor bug or a hardware problem
Haven't seen that kind of thing happen personally
Probes are in most situations a necessary companion to lightmaps
Yes, setting lights to baked indicates they should be baked when you bake lighting
Baking process itself calculates light rays and stores them in textures/probes
There's many steps to the process so best to look for instructions and practice it
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.
It's impossible not to work within the logic of our current assumptions
If it happens anyway we have to scrutinize our assumptions
It's useful, but can be quite a swamp
I recommend to try simple environmental lighting before diving into lightmapping
(You also have to Generate environment lighting from the lighting window, but Realtime GI and Baked GI should not be enabled unless you're ready to do lightmapping)
Though of course environment lighting is everywhere equally, so you won't have any dark corners
Than Ill have no idea how to proceed.
For now I only have rendered light in rendering > lightning (if Im not mistaken) I clicked there generate lightning and I got a folder for every scene I generated lightning in.
Yeah really sucks, doubt its a hardware problem, but idk what to do really got any ideas?
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
Likewise if it looks like there's no reason for it, try to reproduce the issue elsewhere, in another project for example
Like playing chess but there is no intuition to help you find a solution
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)
It's pretty much like scientific testing with the particularly weird problems
Simple as possible tests until you find the right variable
Yeah, this sounds more professional.
Yeah
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.
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
I also think its really small issue but Im just not so good at using unity to pinpoint the problem
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
Well I did that when I was trying to install hdrp and ultimately came back to urp so that wouldnt help in this case
Useful that it's ruled out ^^
Yeah. Ok thanks for help once again I really have to get some sleep bc I now have ony 5h left so gn.
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
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
@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
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
Because shape keys affect normals in a weird way / don't affect them right
I don't remember the workarounds, legacy shape keys may have been one
I also tried the auto-generated lightmap, but it still didn't change a thing. Thank you for the link! I did a lot of searching but didn't stumble into this one.
That really helps! Thank u as always @deft fiber
No artifacts here but your lighting looks overall strange this time
Change something else?
yeah, it's the opposite direction light that I put to test haha, I'm fixing it already, no potential issues ahead. Thanks
If you see no issues after tweaking it, that's good
Though in my experience light direction alone cannot do that
Looks more like the normal maps have changed their color space with the characteristic dull sheen and inconsistent direction and strength of reflections
Fixed it already. Next is adding volumetrics
Is it possible to bake Skybox lighting, or it is trickier than it sounds?
Bake in what sense?
THis
Clarify?
Change of subject, I ran into another problem.
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
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
Is it possible to make the skybox visible but not allow it to emit any light?
Yes, you can set environment lighting source to a black color, and environment reflection source to the black skybox texture
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
So one of those was the culprit?
The description of "flashing random colors and a strange face" sounded really weird
yeah that seemed to fix it, idk i can check if it does the same in the new project. but youre right thoes flashing random colors and the strange face are really weird, unless it was just some shader spazzing out i can check
Flashing could be NaN errors which sometimes happen with lightmaps and more commonly with custom shaders, but they're usually black and white
tried disabling domain & scene reloading and rebaking the lights in stuff in both projects
in the new project its fixed, in the old project it still happens
cant seem to replicate the flashing and strange face
maybe it has something to do with me upgrading from like 2021 to 6
Can you show what it looks like, if it still happens in the old one
before and after:
What's the "face"
havent been able to replicate it but think it was just some decal that kinda looked like a face
when it flashed i kinda saw the screen in a muted non lit r, b or g tone
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
oof yeah guess i shouldve guessed something like this would happen
What do you mean by re-making the render pipeline assets?
If you're using URP or HDRP, create new render pipeline assets and renderer assets from the create asset menu, set to values of the old assets, and assign in graphics and quality settings
Not relevant if you're on BiRP, which wouldn't have Resident Drawer either
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.
Nothing really changed at least when I did
Is setting the new asset in quality settings all you have to do?
In that situation yes but I didn't mean it as a solution to your problem
It's for if you decide to make a new project and move your assets over there to weed out random issues that may rise from using old RP assets
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
Ah alright
Using urp but i dont know anything about what the resident drawer even is lol, its a completely new term to me
Where can I find it?
It's supposed to be used with U6 but I'm mentioning it because I've had project upgrade related issues with it
Yeah I do have the option but can't turn on gpu culling cuz my shaders require compatibility mode to be on
tried turning whatever i could of it on and nothing happened
GPU occlusion culling is a different thing
Resident Drawer being on is usually what causes issues
ah alright
yeah no it was like that even when off :/
("Usually" referring to the rare cases where there's rendering issues due to upgrading)
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)
First make sure the normal map is imported as type: normal map
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.
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
What's your workflow exactly? As far as I know there isn't really a way to bake the sort of lightmaps in blender which unity uses, and even if you did you couldn't easily use them because you're missing the lightmap atlasing process
But it's not something I've looked into much
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
Matching exposure to what, the result in unity?
yeah
I don't think clamping the light can result in a "correct" lightmap, what's the problem being solved?
๐ i just said that blender overblows it into 2.0 color values in exr. unity doesn't
I mean what's the reason for baking in blender
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.
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
pardon, i meant progressive. it's dog slow too
When baking with GPU? Presuming you have a GPU of sorts
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
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
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
not post-sampling but in-situ akin to optix/openimagedenoise
then explain to me why unity takes 10+ minutes on a single bake with more mediocre results at same settings, while cycles takes 2
That's not what the Direct Denoiser setting is for?
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
I don't know the technical details of either system so I can't contest
They have been continuously working on it though for years now
My experience baking with blender has always been that it's slow, not that precise and doesn't really let you configure anything about it
yeah you are completely off base here
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
Completely? Seems harsh
I don't have a strong preference for either because I use them for different tasks so I'm open to any new information
I wish it was easier to get lightmaps into unity from blender without having to go through hoops
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.
So why the need to tweak the baked textures? I'd have assumed they're physically accurate to begin with
because light formulas are different
and hence expected components of lightmap are also
resulting image tracks the same, but assemblies of it are not
@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
does your second file materrials have any OSL in them?
because OSL will force it to CPU
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
that's incorrect. because as i said - you bake a low params first in unity. that gives directionality, shadowmasking and light probes. script just replaces color component in scene's lightmap
that data doesn't come out of ether and is just magically there - it's still in the same lightmap data
just different arrays
I missed the point that you're baking the whole scene twice in parallel with everything set up, not just to have some dummy lightmaps
Interesting workflow
yeah but in unity it's minimal bake. 256x256, which is okay for directional
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
it might've been. but USD format is a thing. it transfers light params pretty uniformly. unlike fbx.
A thing that works now? Last time I checked it was pretty barebones on both unity's and blender's side
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.
Blender's USD support you mean?
...nevermind again. the docs are all over the place. https://docs.unity3d.com/Packages/com.unity.importer.usd@1.0/manual/index.html
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
Lower resolution on import and do bilinear sampling. that will act as subsampling 2x2+ ๐
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 ^^
that or just have texel density low enough so it averages out
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
I see. Thank you
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
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.
This is the model if anyone wants to check what could be wrong with it
And these are my import settings
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)```
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
This is not an issue with the mesh, but your lights' shadow settings like bias, resolution and near plane potentially
Spot lights in particular will lose shadow accuracy if their angle is very high
So that model and light positioning is just simply a no-go if even setting the bias to 0? (I've fiddled with the other shadow settings too)
Positioning and thickness of the model are what affect the most if you've run out of leeway with biases
Bias is necessary to avoid shadows issues on the illuminated side
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
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?
it doesn't need to have it. why? because OIDN is an AI denoiser. it's good enough without it because op is quite understandable.
Sorry, good enough without it, "it" being what? I glanced many topics there
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
uh.....you can supply that info to external denoiser too
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
it has lightmap specific mode
So does it take any particular extra data as additional inputs? Or just the color
i gave you the repo link.
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
"""```
Yes
so far this npr bake went much better than i hoped.
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
yes if you could cause i really dont know
I was ASKING for an example, because you were vague as hell. I can't read your mind.
bumping this ^^
look into light cookies
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
any idea why my static objects using batching static have a black flickering when usnig point lights in the scene ?
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?
You might be looking for Light Cookie here?
you can do a flared mesh with edges acting like baked lights. code white, bake on plane, color by keypad color
what?
do a flared mesh around keypad which will have neutral light baked on it. then multiply by color of keypad in material
ahh doesn't seem to work as I am on the Built In renderpipeline
I will look into that, thank you for the suggestion
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
doing a cookie for this scenario is kinda expensive
and also destructive the moment something moves into the range of emitter
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 ๐
๐
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?
You are really going to need to read the docs for a question that broad
Is there a video that introduces you to lighting? I think that'd help me better for starting on this topic
Probably a bunch of them
Environment lighting multiplier being 3 would be the natural explanation
Generating lighting doesn't necessarily bake lightmaps, if Realtime GI or Baked GI aren't enabled, and if you don't have both Contribute GI -static geometry and baked or mixed type lights
I think that was it
Also what are exactly Realtime GI & Baked GI, and how to enable them?
Systems you definitely have to understand to use
I would recommend reading docs as suggested
https://docs.unity3d.com/6000.1/Documentation/Manual/Lightmapping-landing.html
There's also video guides for Baked GI specifically like the official one: https://youtu.be/KJ4fl-KBDR8
Or these two unofficial ones that have a bit more info than the minimum:
https://youtu.be/okYhs6kQ0xw
https://youtu.be/XzJe4W96Mgc
And once you're baking you'll certainly want this troubleshooting guide: https://discussions.unity.com/t/lightmapping-troubleshooting-guide/895352
Flared mesh will work in any case regardless. if he needs a light - he can always add a point light later
I'll check these out, thank you
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
TL;DR: Iโve recreated the Doom Glow effect in a vertex shader and made it work for any convex planar shape. Grab the plugin here: https://github.com/hollowdilnik/GlowingQuad!
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.
does anyone know how to fix my shadows? they seem to be inverted?
๐
I want to bake lights for both day and night sky states. How can I have two different lighting datas?
thoughts on my lighting?
do you have a daylight cycle?
or just two modes?
Two modes, I'll be setting the skyboxes manually
[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
I'm assuming you're going to use those modes in the same scene
Yeah that's what I was aiming to do
If I must create two scenes it isn't much of an issue really
that would make it easier tbh
Is it possible to do one-scene approach tho?
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
The buildings were going to be different in night too, it's probably better to do that yeah
Thanks!
even better then
do you happen to be making a puzzle game?
where depending on the daytime theres different things to do
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
Thanks for the comment!
Same for me, I'm just starting
It's a difficult process but worth the result to be honest
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?
Did you commit to your git prior to that upgrade?
Hello, guys! I am getting some very weird behaviour with lighting on very low, low, medium and ultra quality levels. Could you please guys help me? Recommend maybe anything on whats causing most likely the issue?
https://imgur.com/a/RKtWSUG
Well, no.
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.
are you using urp?
Yes I am using
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
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
if you want those flickering lights in low quality levels than don't change it lmao
Its weird bro
its not so cpu consuming so yk
You have checked the video
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
I just noticed that in most of my quality assets I had 1-2 per object additional lights probably this was causing the issue
I even think it WAS causing the issue
By the way, thank you very much! What about your issue?
So, you have changed from built in pipeline to HDRP?
You dont know how to deal with think pink materials
yeah but the thing is theyre only in the assets and everything else is fine I can use them normally
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
To tell you for URP there is an option
you kind of helped me
Universal Render pipeline I see you use it
but you have HDRP
I think its quiet different
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)
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?
You can change it to 8 for every asset
fr
When working with lighting and rendering and all of these parts
its like you dont know what is the problem but than it turns out its the easiest solution possible
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
ikr
for now I have 16 scripts in my game and you cant imagine how stupid mistakes Ive been making
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 }
damn ๐ฅ
anyways good luck with your game
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
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.
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
I know
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
yeah thats the hard part
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
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
Cool!
Hey! I don't know if that ever happened to you or to anyone here but there are times that when I am working on my game for example i just sometimes ignore the time I am spending on it haha. Really want to stick on a schedule but sometimes I really can't because there are so many things that I have to work on ๐
Thats why I don't set deadlines for myself. Just doing my work ๐
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?
How can I have various cubemaps in the scene. More importantly how can I create cube maps based on the enviorment of the scene?
Reflection probe components, which you can bake individually
I cannot see any pixelation on any of my devices
Will they also help with dark objects when I use Skybox as reflection source?
In the sense that the skybox reflection probe will be used for objects that are not in the range of any reflection probe component
That means you should keep the intensity multiplier at 1 unless you need darkness outside of probe ranges
Using reflections as a form of ambient lighting can get tricky, since that kind of light is very specular in nature
You always need both ambient (diffuse) environmental lighting as well as environmental reflections (specular) for a correct appearance because materials use both
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
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
Tricky it can be, but probes are a necessary part of the workflow
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
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
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
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
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
There's been some improvement to using light probes in that context in U6
https://portal.productboard.com/8ufdwj59ehtmsvxenjumxo82/c/2144-api-to-move-positions-of-light-probes-at-runtime
Though I don't know what it'd be like exactly to use scenes instead of prefabs for that purpose
Can scenes even be loaded with an offset or rotation?
At least they can be loaded in async unlike prefabs I think
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
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
Scenes might be the right answer, I have just always avoided them
Might be able to store light probe groups in an SO and write them onto runtime created LPGs at runtime
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"
Always a danger
Once I have a game loop I like, I will revisit the authoring
Would be cool if the editor had tools in it
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 ๐
I'd love a tool to manually create and modify probes
Could finally create areas of darkness for interiors without any baking
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
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?
Fix in what sense?
as in my area lights to stop not showing on terrain
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
how could I use one of the alternatives?
Hmm yeah I realized on my phone it looks good.
I'm looking for a way to scale an object down in Unity, AFTER it's been lit. Or something that achieves that effect
In what kind of situation?
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?
That'd be correct
Hell yeah, thanks.
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
Oh, good point.. is there a way to cast shadows as well?
I may not need it, but I'm curious as to how I might
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
For casting shadows before flattening.. you mean the shadows would be cast on the mesh, the mesh would flatten, but it would leave the shadows floating in place wrapped around a sort of ghost of the original mesh?
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?
How do these things work?
I downloaded a sky bundle package, and these came with it.
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
yea i found that, is there no better way?
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
It's the only way
If someone's made a more fleshed out version of the script, I haven't seen it
Is there a way to disable Adaptive Probe Volume on certain renderers like with the regular Light Probes?
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
what if you set the "Cast Shadows" on the plane to "Two Sided"
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
Thank you so much!
Increase resolution and enable soft shadows
If directional light increase shadow distance and or enable cascades
Look into pixel light limits per object
I guess it did help, but it doesnt make sense as to why at 5pm its brighter
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
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
Try disabling these three checkboxes, if glow will stay, may God help you, if not, this will give you more information on where does this glow is coming from
I think your post processing is still ON somehow or you just have bloom render feature (if URP)
i am on urp
i have the bloom render yes, but its supposed to be on
check your Universal Render Data Asset
the problem is with the material
so you have bloom turned on?
yes
but i sent you a screenshot without it here, its not meant to look like that
it is not behaving with the light at all
here
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
which is not meant to be a thing
the wall and floor materials of outside are perfectly fine
but the interior ones are just glowing too much
can you show them?
look, these materials are a lot less bright, so bloom just ignores them
so if I want a white wall i can go fuck myself?
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?
basically with bloom - yes, but there are some ways around it:
- 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)
- 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.
- Use trigger Post Processing volumes to disable bloom in such areas.
- 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
- 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 ๐ฅน
Such type of question is very often in game development tho
I dont really understand your point here, the problem isnt the post processing, it's the materials themselves
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
maybe ambient light color?
you mean like a skybox?
the source is coming from my skybox and not a color
try disabling it
baking light will help you
i cant have baked lights, i have a time slider
indirect and bounces make scene look cool with baked lightmaps
it needs to be realtime
there is mixed lighting and light scenarious
that wont work with my daylight slider will it?
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 ๐
switching to ue aint really an option
not right now anyways
yeah but hdrp is heavy as shit to run
yeah, it's the catch
how do i even setup realtime light??
back to this!
i think i dont have it setup correctly because it has a autogenerate ticked on
by default all new lights you create are realtime
you can adjust settings in project settings and URD Asset + URP Asset
lights are always a pain in the ass but then they endd up looking pretty so we forgive them. mostly.
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
you mean like make a filler for those walls?
behind the scenes
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
where do I make my cube shadow only?
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
"Cast Shadows" field
I expect that'll work
As long as the filler geometry covers the edges/corners where the leaking happens
it causes this in the runtime (by the window's sides you can see the shadow) maybe I should make it more distant?
it still escapes a bit
but yeah now its just tweaking around
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
now it works, i had to put it on all faces except on the front so yeah
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
since I have a time from 0 to 24 and all decimals (i made a script that rounds them up to like 1.1, 1.2, etc) couldnt I bake each hour of the day?
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
You could, though bakes tend to take a lot of space on disk
(i5 8th gen and integrated gpu btw)
how much would it be on my case?
i dont have a lot of things to reflect and bounce on in my project tbf
this is everything
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
what quality would you recommend me?
in my case
I have no idea about neither how high quality you want it to be or how small your filesizes will need to be
is there anyway I can derender these prefabs under the scene?
They're not rendered if they're outside of the camera's view frustum
i dont really have a limit, i just want for regular office computers (usually 200gb of total storage) to run it at 60fps without making it like 10gb
if i had to set one it'd be like 1gb?
That's for you to balance
yeah but they have shadows bouncing on them in the world view
cast shadows are off but their materials still reflect n stuff
wait no it shouldnt be off
because im cloning them onto the shopfront
If they're out of the camera's view, they won't be rendered
Editor's scene view is irrelevant for in game performance
how would I even do that?
does lighting data keep on adding it up or does it reset each bake?
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
Normally baked lighting is per-scene which you'd swap at runtime
Your realtime objects would be in another additive scene on top of that
so it does reset after each bake because its all on one scene
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
Oh, thank you, didn't know that
I don't see what's that goofy about it
Probably much more straightforward than what you have to do to track and swap scene lighting separately from scenes
A - I have so many things on my scene that cloning it 23 times is so pointless, I'd have to change 24 times the same value for 1 small change
B - doesnt it weight even more on the performance??
What "value"?
its an example
idk changing an UI text, a button doing x action
None of that would be in your static environment scene
All your gameplay would happen in a separate additively loaded scene
and how would it even keep track of the tv placements of my scene?
specially after the fact that you can move it around
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
I mean the only light is the sun
Not immediately obvious before you understand baked lightmapping and also additive and active scenes
to which I do have a daylight cycle
What of it?
wdym what of it, its controllable and each hour its a different position
meaning light will always reflect from somewhere else
So I gathered
yeah but I dont get your point at all
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
Hard to understand if you're not familiar with the systems or workflows involved
im just slow ๐ญ
yeah, its my first time tinkering around with lighting to be fair
and i dont count slapping some lights and calling it a day
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
on the left its how my project currently looks like, same performance
not the same project btw
im aware of that, but I need to find out how to keep the same objects on all hierchies, maybe prefabing everything? but then how could I make the tv that I spawn and move around remain exactly on the same spot in the previous scene?
and on older computers wont the transition from each scene to another be pretty noticiable?
Do you know about additive scenes?
clue me in please
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
@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
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 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)
Not just looking for an unlit shader/material?
that did both in one, thank you lmao
how can I make this emissive object actually emit light outside of the lamp?
Emissive is going to only apply to other objects when baked
this barely baked in the scene
Is that not the outcome you expected?
so I should just have a point light in there?
nope, maybe because I misunderstood how emissive materials work
this is what im expecting (sort of)
but its obviously inside the lamp cover
Materials can't act like lights in realtime. Maybe in 20 years
Your lamp cover has faces on the inside that are static?
yeah they are, odd, I dont recall ever messing with static objects on this project
You also are getting into the territory of subsurface scattering if you want your lamp shade to glow from the inside
should I turn off the static and just rebake it?
It needs to be static if you want emissive light to affect it
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
the materials are rendering both faces if thats what you mean
If you want a glowing lamp shade, you will likely just want to make an emissive tecture for the shade itself
why didnt I ever think of this ๐ญ
Unity might have some kind of transparency/scattering handling for baking, but I don't think so
thats actually cleaver, and fits my stylized graphics anyways
To the baker, your lampshade is a solid light blocking object
wait now i know why i didnt, because my boy made the whole thing into a plane ๐ญ
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"
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?
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 ๐ญ ๐
๐ฅ
all my unlit textures are significantly darker than the base texture files for them. any ideas for a fix?
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:
- URP (Universal Render Pipeline)
- Deferred Render Path
- Empty Clean Projects
- Using AllSky (Free Demo Assets)
SETTINGS
- Almost nothing was changed in each version in respect to the editor.
- 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?

~ 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).
Iirc that's because they're doing away with the automatic recalculate option entirely
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)
There's more than one potential reason for it but the main one is the shader
"Textures" can't be unlit so it's important know what material/shader we're looking at
If it is an unlit shader, then it's likely that the appearance is affected by post processing
The default volume overrides have a very flat tonemapping but no adjustments to bring the color contrast back up
oops, meant material instead of texture, i'm bad with terminology
i'll check out the global volume
yep i had tonemapping on
thanks a ton
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
~
"Baked" lighting is kind of a vague term because a lot of realtime lighting relies on pre-baked data
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
Any idea on how to solve this ?
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?
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
Any baked type lights having an effect on lightmaps at all?
ill test rn
You should at least be getting environmental lighting
Specifically so that they're drawn on the lightmap textures that you can see with scene view overlay or from the lighting window
just pulled that up, not quite sure what I'm looking at here though
the walls are dark gray that should be lit, which I'm guessing means they aren't receiving light?
Can you show it?
sure one sec
it is an interior scene I should mention
some random floor tiles seem like they're getting light but some arent
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
yea that's my wallpaper, the window is slightly transparent I just never got around to changing that
is that something I'd have to fix in blender?
You can enable lightmap UV generation for each mesh in mesh import settings
If you bake at below 40 resolution (which is quite a lot) you'll also need to decrease the minimum lightmap resolution for each as well
yep, that did it. Thank you man, really appreciate the help, couldn't figure that one out lmao
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
Often yes, though UV overlaps aren't necessarily a problem them (though they can be)
How much resolution you need depends on the scene and hardware requirements
Lightmaps are big files to store and load into memory, so in a big area you might end up with an excessive amount for no tangible visual benefit
gotchu, makes sense
Biases are only for realtime lighting, seams and modular geometry are pretty much always a problem for baking
https://forum.unity.com/threads/lightmapping-troubleshooting-guide.1340936/ c.10
gotchu, I'll give that a read. Thanks again for the help, much appreciated
I'd make a new scene to test and verify it doesn't happen there too
By default the scene view should use the same shading and post processing as long as you haven't turned off shaded view and post processing from scene window's options
First determine if it's caused by the light's shadow, or by SSAO
Turn both of them off and then both on alone
The bias seem to be the issue
But also the shadow of the light :/
I maybe found something but the corner is a bit destroy :/
Yes, that's what it looks like, hence the test not to spend time guessing
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
Damn, even for simple cube ?
You can probably imagine how quickly the cost adds up
Your floor is made cubes, which is 6 times more faces than if they were quads
ohhh, before i was using plane and it bugged, but i neved tried quads
thanks i will try with it
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
A plane is functionally the same as a quad for most purposes, but it has a lot more polygons
a plane has more polygon, or a quad ?
In Unity plane has many
You can see it in wireframe view
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
oh yeah, 4 vertices instead of 121 ๐
Thanks for all the infos :)
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
I removed the static flag from the light model, that reduced it a bit, but its still there, i also tried messing with the lightmapper settings but that didnt do anything
Texel invalidity
https://discussions.unity.com/t/lightmapping-troubleshooting-guide/895352 c.15
Texel invalidity can appear in wrong places if you also have UV overlaps, c.9
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
Lights are not visible on their own
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
๐
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
Where is the very soft shadow under the car coming from?
To be honest I'm not sure, I just marked my car prefab as Static and applied it to children also
But it obviously didn't work since this is the expected result
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
These are my lighting settings, does it help resolving the issue?
Well I want the entire terrain to be a baked area
You first need to understand what baking is doing here
As far as I know baking is pre-generating lights for static objects
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
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?
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
I am not the right person to answer, I have never baked outdoor scenes
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
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?
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
You could, but you can't expect any reasonably sharp baked shadows
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
๐
Why does this tree not have any shadows although it's prefab is marked as static + terrain's lightmap scale is 1?
It seems like it only happens in terrain details and not prefabs. Why is that?
hi thanks for the advice, i forgot to add the lens flare layer in my camera
why isnt light reacting when I move my sun?
Not sure what we are looking at, but if your light is baked that would be a likely cause.
it is not baked
its in realtime
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
Can you get the sunlight to show up at all if you rotate it in editor outside of play mode?
you mean this?
Seems to be working?
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
Is the question about the sun or the interior lights?
interior lights
I have fixed them just now though, i baked the lighting inside and it now just works
Start by trying to determine what's causing it
Lightmap debug views for example
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
Hello everyone, can someone please help me figure this out? https://discussions.unity.com/t/how-to-use-adaptive-probe-volume-rendering-layer-mask
any idea why the Unity Learn project for Creative Core - Animation looks like this ? darkening/lightening based on my scene view perspective
I'm just starting this Unity 6 tutorial https://learn.unity.com/pathway/creative-core/unit/animation/tutorial/66fc66f1edbc2a0094cf3a8c?version=6
I'd guess it might be very wide SSAO, or a special shader on the meshes materials
any idea why scene view shading behaves in this weird way? it's unlit draw mode..
it's okay in unlit draw mode
if you want a "real" until mode, you can find it in the Renderer Debugger
"Materials - Material Properties - Albedo"
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.
Same as above, unlit draw mode
hah, didn't notice theirs was the same issue. what a simple fix, thanks!
try the little (?) buttons on the UI and you'll get relevant documentation. after hopping around a bit, I think this is what you want
is there a limit to how many lights you can cast on an object or something? why does this happen
(all the buildings are a single model)
Yes
Per object pixel light limit
Graphics quality settings determine what the limit is, or if deferred rendering is in use which has no limit in exchange for some drawbacks
darn, so would i have to split all the buildings into seperate models?
๐
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?
Yes, assuming the application is using the same light limit with forward rendering
Decreasing light ranges also helps, and a mesh can be split as many times as needed
As can be seen, both sides are lit
alright, thanks
The only light I see on the shadowy side is from the reflection probe that seems to be introducing a reflection of a bright white ground
I don't have a reflection probe on the scene though
I only got this light object for lighting in my hiearchy
There always is one based on the environment lighting settings
By default generated from the skybox
So you're saying this is something intended?
Yes
My intention is not that to be fair, I'm looking to fix this
Fix how?
I mean, I wouldn't expect all sides of the car to be lit, looks weird
Should be pitch black on the shadowy side instead?
Now that would be "weird"
Oh, I didn't mean pitch black, my bad
See, something like this
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
To only change car's reflection, I assume I should use a reflection probe?
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
Why would I follow that approach instead of using skybox reflections? Just trying to understand
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
Your sky has some kind of white void as the "ground"
You want reflections to show the grass and the trees below, not the white void
Makes sense
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
So I created a reflection probe that covers my whole terrain but didn't see much of a change from skybox reflections
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
What does the probe's cubemap look like
Inspector preview
This?
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
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
It looks like this
Oh yeah, it definitely works. I disabled the reflection probe I've created and it turned into a sky reflection
Yeah looks right
I guess it's possible the environment lighting intensity sliders affect probes as well
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
I've created a reflection probe specific to the car for this
But it seems like it works for the entire scene
I'm sending a video
I'd expect this is because probe blending is disabled in graphics quality / URP asset
Yup, it was this
Thank you so much, learnt a lot of things today
daaaain you are the real MVP, thanks a bunch! that's exactly what I was looking for!!
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?
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
๐ 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?
Multiple probes are so you get a reflection that more closely approximates what you would see at that location is all. They aren't additive. If that is what you are asking?
As you move away from one and toward the other, there should be a crossfade that happens, based on the settings of the probe
How are they not additive though? If I change intensity multiplier in environment reflections, some reflections also change too. So they have to blend in, no?
So what you're saying is those reflection probes are to catch the expected reflections instead of the ones from skybox?
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
If you change the skybox/environment multiplier, then that skybox will be brighter in the baked probes, wherever they see sky
So we can say they blend in?
Blend into what?
Blend with each other
The skybox probe and the ones we manually create
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
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
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?
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?
First time baking, I'm guessing there is no progress or % indicator just thiss?
well damn ๐คฃ
Just noticed this my bad
Might want to lower you baking settings until you are really ready to bake? Or turn off automatic? Unless this bake is what you wanted.
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
yeah there's only one light object in my scene, unless it's hidden somewhere by default that I don't know about?
not sure what default scene light is, I might have removed that if it's an object
might have baked the light, but I tried rebaking, through rendering -> lighting menu, but it doesn't change anything
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?
yes
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
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
lol, so I just need to adjust the rotation, thx ๐
yup
Its different than the other light modes
I just went with the default bake settings as it's my first time so not even sure what it's set at really quality wise
Just might be a bit slow for your first bakes
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
Yeah i'm worried i'm gonna have to delete this map anyway as some stuff is probably goofed up
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
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
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
What's a good final bake setting?
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
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
All objects that dont/wont move I should mark as static right?
Or the light isnt going to 'hit them'

