Hi, I'm creating a tool to try and created seamless objects when placed on one another. As a test, I have two planes which are both using the same material. With the top one, I'm doing a raycast and setting the uv using textureCoords of each of the vertices and setting the normals using the normal from the raycastHit. The texture is matching perfectly, but the normal isn't. As you'll see below, even though the normals are the using the hit value, the whole plane is much darker than the one below. Is it not as simple as matching the normal from the plane below? Are there any additional calculations I need to do to get that working correctly? Many Thanks!
I'm not sure if directional lights obey this rule, but for other types of light sources you can only achieve the same level of light on a surface if the angle between the vertex-to-lightsource vector and the normal is the same, and the distance between the vertices and the lightsource is equal. Check out the built-in shaders to see the full equation https://github.com/TwoTailsGames/Unity-Built-in-Shaders/blob/master/CGIncludes/UnityCG.cginc The stuff you want to look at is the ShadeVertexLightsFull function for example.
That's only the case for per vertex point lights, specifically those that are set to non-important. It won't affect directional lights in any way. However I wonder if the issue is the ambient lighting and not the directional lighting or vertex normals. Does your scene use light probes at all? By default Unity gets the ambient lighting for an object by calculating a spherical harmonic at the center of the object's bounds. When you have to objects of different sizes, their SH will come from a different location unless you override the location it gets its ambient lighting from using the anchor override on the renderer component.
Thanks both. I don't have light probes in the scene. bgolus - great suggestion with the directional and ambient, I'd been focusing on the normals themselves, but went into lighting to try a different ambient value, as soon as I tweaked it the second mesh fixed itself, so something in the lighting side needed to be updated, or maybe it did a recalculate bounds which helped with the harmonic? Anyway, its working now so thanks a bunch!