Lighting effect - unity3d

The following screenshot is taken from a road that consists of several equal parts:
They all belong to a Blender model and have Shading set to Flat.
The scene has just one directional light and the parts of the road are used to bake a light map.
Material is set to use Mobile / Vertex Lit (Only Directional Lights) shader but I tested other shaders like Mobile / Unlit as well.
I don't get this effect when I take a model consisting of 8 road parts using a repeating texture - at least not in the middle. So it's not related to broken tileability of the texture. But it is visible then at the end as well
The texture import settings are:
Question: Is this the regular behaviour of the standard shaders? Can't believe it, but If so how to omit this when writing my own shader?
I would appreciate if someone could shed some light on this ;-)

It's a problem with normals. Easy fix is to make Unity recalculate all the normals (In model import settings switch Normals -> Import to Normals -> Calculate).

hard to know without seeing more context, but if the objects are lightmapped, make sure to check that they are not reusing the same lightmap texture. #jaceck's suggestion about normals is a good one too.

I do not know if it is this you want, but there is also a component called Line Render that draws a line.

Related

How can I use baked lighting on sprites? / How to light up a large area in 2D?

I'm having trouble figuring out how to light up large area(s) of sprites in Unity 2D. My previous knowledge on Unity's lighting is zero.
I first tried using a large amount of point lights and using the "Sprites/Diffuse" material, but about only five would actually render at a time, so I guess there's a limit on that.
Then I tried putting in an area light. That didn't do anything, so that's when I started doing research about baked lighting on sprites (and baked lighting in general). I found stuff like this but I couldn't get it to work either because it's outdated or because I don't know what I'm doing. Other answers I've come across seem to assume that the reader knows anything about lighting in Unity in the first place which, to be honest, I don't. Unity's documentation website had some information on it, but no tutorials that go into how to set up baked lighting.
I've tried a bunch of different combinations of materials (like using the "Standard" shader for the sprites instead of "Sprites/Diffuse", emission, ect.) and I enabled "Baked Global Illumination" in Lighting>Settings.
If baked lighting isn't possible on sprites (or isn't worth the trouble), what are the alternatives?
Edit: I made sure not to have the lights pointing the wrong direction, and I do realise that Unity2D is just like painting onto a piece of paper in Unity3D. I was able to get point lights to work, but only a few at a time. I don't need to do the entire screen at once, I need to do a large specific area at once.
some tips...
working with sprites your in 2d... when you add a light, switch to 3d mode, and rotate to make sure your light is pointed at your objects, and oriented so as not to be on the same plane, or level with them, as this will cast all the light behind them.
if your trying to light up everything on the screen(in camera) attach an area light to the camera at the cameras position, point it where the camera points, and then in the inspector on the right, you can change its variables. intensity, range, width, height etc.
Emissive Texture:
https://www.youtube.com/watch?v=oa6kW5HhRd4
For some reason, I never even thought about going into the asset store. I found this for free, and it looks like it will work: Light2D.

Unity3D, Glass Shader, prevent rifts

I'm new to Unity and 3D and currently working on a 3D model of a smartphone. I have a Mesh that uses Standard shader with glass material. This mesh covers all of the surface, and is able to fill in any rifts that exist on the model.
My glass material looks like this:
The properties:
The model:
The problem is that this shader is black, it's covering other elements of the model, like camera, if I remove it, the model will look like this:
which is ok, but you may see that there are little gaps near to the camera, the rifts:
I have no idea how to fill this gaps and use glass shader in the same time.
Also, I cannot use Standard shader, because it doesn't work on mobile devices.
I tried to apply any other Glass Shaders with lower LOD, which seem to work, but the gaps still remain.
Any help is highly appreciated.
Okay, so I played around with the Standard Shader and the main problem you have is that it has no transparency at all. You won't be able to look through it if it has no alpha.
What I did to get results that seemed "okay" is:
I set the rendering mode to Transparent
I set the color to #0024050C
I set the Metallic to 0
I set the Smoothness to 0.9
I kept everything else on default
There may be a comparable version for the Standard (Specular) setup:
Same values as above
Specular to #181818FF
Source to Specular Alpha
And as far as I know, the Standard Shader should work on mobile with some features disabled.

Unity Lighning (shader, lightmap or blender UV issue?)

I have the following scene
As you can see the ball in front of me has a very extreme shadow on it's back. How could I make it less extreme? I would like to still see the triangles that compose the Ico sphere but darker and without having to change the sun's position.
I tried to play with my light values, shader value, changed shaders, etc. but without any success. I guess I'm lacking some basic knowledges regarding lightning. Any help / tip would be greatly appreciated!
Thanks.
Models which have light issues or seem to have a permanent black poly may have flipped normals and will not display light correctly. Whichever 3d modelling program is used to make the models will be able to flip a normal for you.

Make pixel lighting like terraria and starbound

I'm making a 2D sandbox game like "Terraria" and "Starbound". This is my game
The light is filling the whole terrain but i don't want it. I want following:
You're probably using Directional Lighting, which illuminates the whole terrain equally in the direction you made it.
You could use Spot Lights or Point Lights, which will illuminate only the surface you want to.
Edit: although using this method, this could take way more resources due to the number of single lights placed throughout the map.

created a model in blender, imported into Unity and not affected by light

I created a hand model in blender, imported it into my scene in Unity and it does not get affected by my lights.
I created some seam lines and unwrapped the thing. I have other elements that I created in a similar way and the only difference I can appreciate here is that this one is not a mesh renderer, it is a skinned mesh renderer, because it has bones inside.
This is how it looks like, you can see the "torch light" focusing to it, making a round of light, and the hand is getting weird lights, like only the reflected light from below or something.
Those are the settings of the mesh
Looks like the normals are wrong. You can try to invert normals in blender or change the import settings (in Unity) of your hand mesh to calculate normals instead of using the normals in the blend file (See normals & tangents section here).
It is definitely an issue with normals. Something wrong is going on during exporting probably.
Try Calculate option under Normals in Importer settings
Hope that helps.