Unity Lighting problems - visual-studio

I'm about to make a 3D Scene in Unity, where you can move through a house.
But right now I'm stuck with the lighting of the scene. What I wanted to try is to bake my directional light (Sun) into the Scene. But right there is my first problem:
If I didn't bake something (clear baked data) it looks quite good, but after baking, the Scene is really dark, what I don't understand, because I set Environment Light and before the Bake everything just looks fine.
Here are some samples before the baking, of the settings and after the baking:
notBaked(no Lightmaps!)-LightingSettings-Scene
notBaked(no Lightmaps!)-LightingSettings-Environment
not Baked(no Lightmps!)-DirectionalLight(Sun)
while Baking - ReflectionProbeSettings
Baked Light
As you can see, the Scene gets really dark and it seems that for any reason, the ambient Light/Environment Light is missing after the bake.
Another problem is the warning of overlapping UV's. What's the reason for that and how can I fix it?
The aim of the project is to also publish it as a WebGL version. But if I build it as a WebGL version and try it on my server, the textures doesn't work. I looked up in the internet and read that directional lightmaps doesn't work for WebGL. But if I switched the directional Mode to non-Directional and replaced the directional light and only baked a Point light, the Texturemaps also didn't work in WebGL.. Does anybody know, how to use lightmaps for WebGL?
Thanks a lot!!

Related

Certain Parts of Terrain Too Dark

Certain Parts of my terrain seem quite dark.I dont know why. As you can see in the image the left part is dark and the right is normal. It feels like shadow or some lighting problem.
Screenshot :
It's dark because you're using a single, directional light that's being a blocked by the wall on the left. Have a look at the Lighting window for your Scene:
Unity Manual for Lighting Window
There, you can play with settings like the "environment lighting" and its source. By adjusting this, you should be able to add a base amount of illumination throughout the scene.
If that doesn't work, you'll need to add more lighting objects to your scene. You can try to balance more directional lights from other directions. Or you can add local lights like spot/area lights to illuminate surfaces left in shadow by your directional light.

Street neon sign's glow effect

Does anyone have any suggestion of how to implement such a light glow effect in Three.js ?
There is a TextGeometry mesh
Some BoxGeometry mesh as a background
How to make this glow between them?
I tried to put many PointLight between text and box, but after about 20 of PointLights the scene become very slow. I tried to put some RectAreaLights — but the same.
Does anyone have any suggestion of how to implement such a light glow effect in Three.js ?
The typical way of doing this is via post-processing. three.js offers a so called "Bloom" pass which is demonstrated in the following example: webgl_postprocessing_unreal_bloom. I suggest you start with this setup.
but after about 20 of PointLights the scene become very slow. I tried to put some RectAreaLights — but the same.
It's no good approach in general to add that number of light sources to a three.js scene. If you place some small sphere meshes (based on THREE.SphereGeometry) with a bright material color onto the text, you should get a good result with bloom pass.

substance painter export gltf in webgl(three.js) is totally black

When I import my model (.fbx) to draw a texture in the substance painter and export it to the .gltf format, I find that the metal I paint is gone and replaced by the shiny black, and then when I put the exported model in the three.js/examples/webgl_load_gltf.html case, I found that my model was dark and needed to be added a directLight can only see a point, the effect is not very good, but the case of importing the painter painter does not have any problems.
It looks as good as the model in the original example.
I would like to know what causes this two problems.
The problem is that your demo has only a single instance of HemisphereLight. The materials of your meshes are instances of MeshStandardMaterial with metalness values of 1.0. Since hemisphere lights are sources of indirect diffuse light, they are not reflected by pure metals. More information about this topic in: https://github.com/mrdoob/three.js/issues/9228
You should use a different light setting e.g. add a directional light. Or try to fix the material settings in your model.
DUDE I JUST WENT THROUGH THIS, it was a nightmare. I had a very shiny gold car with windows and all types of shit going on. Looked great as a USDZ! Then tried to export GLTF. Black.
Turned off all channels except normal and base color, looked fine.
Then went and turned on metallic and again black.
Then i realized "Oh, I didn't bake my mesh maps" like an idiot. Boom, metallic, roughness and opacity all suddenly worked.
Always ALWAYS bake your mesh maps. Substance is pointless without it.
I know this is 2 years old but apparently all the early adopters of Substance figured this out long ago, so this is for you, random person just learning this stuff. AR is only going to become more in demand, thank god I know how to make it cross-platform now.

Light 2D and Performance issues

I want to make a 2D game that will use 2 kinds of lights (Spotlight and Point Light). I need the game to be completly dark unless there is a light in the area and the light to not pass through walls. I tried lots of stuff and plugins to try and make this possible but nothing worked for me.
So I thought I would try to add 3D walls with an Orthographic camera so that I would have the light stop at the walls and cast shadows and make it look 2D at the same time. (Top-down View)
My questions are:
Is there a better way to do this without needing the 3D stuff?
I believe that I will probably have some performance issues if I keep the 3D stuff. Is there a way to fix that since the final output from the orthographic camera is 2D? Like maybe an option to render it as 2D and not having the game process all those triangles? (I want it as light as possible because I also want to port on phones)

Light bleeding through objects

I probably miss some basic concept, because I tried all light forms and materials, but I can't stop the light going through the plane or vice-versa.
I'd expect that light from the pointlight source is stopped by the object, but it doesn't seem to be the case.
I'm such an idiot :)
Light source should be set to cast shadow. Plane should be set to cast shadow, box should be set to receive shadow.

Resources