HI,
Now when I change the Normal Map value it does not change the look (bumpiness) of the model … 5.6.0b6
HI,
Now when I change the Normal Map value it does not change the look (bumpiness) of the model … 5.6.0b6
Hi Griffo!
Are you using progressive lightmapper? If so, directional mode is not added yet, the support for normal maps will become available later (very soon, rest assured that we’re working on it). Also, please read our official post for progressive lightmapper to learn more information about it: Progressive CPU Lightmapper - Unity Engine - Unity Discussions
@kemalakay Hi,
I’ve tried both, Progressive Lightmapper and Enlighten.
When I change the Normal Map value in the standard shader on any model it does nothing.
So I opened a new project, put a plane and a sphere in the scene, made 2 materials, one for the floor and one for the sphere, added a albedo and a Normal Map, all looks fine, the tried changing the Normal Map value on both, no change.
So I decided to export the package for you to have a look at, then I opened another new project and imported the package I’d just exported for you and guess what, yes now when I change the Normal Map values on both objects it works the bumpiness alters on the objects.
So now I go back the the project I setup and still the same, no effect by changing the Normal Map values.
So to me it looks like a bug, I can’t send you my main project its just to big, I can’t even think of exporting it then opening it in a new project to see if that will work because again its so big I think it would take ages.
Could you please try what I have just done and see if you can reproduce it, thanks.
Hi @Griffo ,
Thank you for exporting the package but apparently, it’s not attached to your post. Can you please upload it? I can gladly have a look at it.
Thanks!
Hi @kemalakay
Sorry, if you read my post again you will see that once I exported the project it worked, I could adjust the Normal Map value and see the difference.
It was when I built the new project that the Normal Map value would not do anything so sending you the project would be useless.
Can yo do as I did above and open a new project and put a plane and a sphere in the scene and see if it happens to you please.
Like I said as my original project is so big I can’t export it out then re-import it back in as with the results I got above that should then have the Normal Map values working again!!
Thanks.
I’ve still got this problem can not changing the normal map value does nothing … 5.6.0b8
Hi @Griffo
Please report this issue with your project as a bug or alternatively, send me your project through PM/here so I can have a look. We don’t experience this issue with normal maps.
Thanks
Hi @kemalakay
OK, here is the file.
Please create a new project, then import my custom package, open my Test_Scene_00.
Now please go Materials, Floor_00, you will notice you can alter the Normal Map value and see it altering in the scene, all is ok.
Now please go Build Settings and change platform to iOS, now try changing the Normal Map value, nothing happens.
Switching the build back to PC the Normal Map value works again.
I appreciate you help.
My system is 5K iMac, macOS Sierra.
Thanks.
As far as i’m aware this has always been the case, the Standard shader normalmap value is not supported on mobile platforms in order to reduce the performance cost. Instead you’ll need to modify the source normalmap texture to your desired result.
Thats strange, because I don’t remember the normalmap value not working before 5.6.0b6
Also that seem a pointless exercise to remove it, as the user should have the decision to use it or not, and I’m sure most new mobiles will cope easily with normal maps …
Well I know it was true as of 5.2 - 5.4 as I ran into the exact same problem. Not sure if it has been changed since, though I don’t see why, since the decision due to performance issues is sound. However I do agree it would have been nice if Unity had provided developers an option to enable normalmap scaling or not in the shader on mobile.
Edit: Checking the Unity Standard Shader source ( 5.6) I see that it has a check for shader level >= 30. So perhaps this only affects gles 2.0 level hardware which was my minimum spec. That might also explain why you didn’t notice it before as the behavior of the shader can change depending on api support of the device you test on?
Hi @Noisecrime
It’s a bug … Just got this from a bug report I sent in …
Hi,
Thank you for submitting a bug to Unity.
We have identified this issue as a duplicate of an existing known bug and we will be closing the issue. The information you have supplied will help us further in the resolution.
You can track this bug in our issue tracker: https://issuetracker.unity3d.com/issues/editor-normal-map-gives-artefacts-on-mobile-platforms
If you have further questions, feel free to contact us.
Regards,
Aurimas
QA Team
Hmm, it might be, it might not. Getting a reproducible/duplicate report does not mean that Unity has confirmed its a bug, just that the behavior has been confirmed. Its quite likely that it might be passed onto a developer who will then say its by design, specifically in this case as a performance optimization for mobile. Alternatively they might decide that its no longer a performance issue with current hardware and fix it. Basically I’m just cautioning over expecting this to be addressed in the near future as it might not.
However looking at the shader code again I noticed something I missed last time.
half3 UnpackScaleNormal(half4 packednormal, half bumpScale)
{
#if defined(UNITY_NO_DXT5nm)
return packednormal.xyz * 2 - 1;
#else
half3 normal;
normal.xy = (packednormal.wy * 2 - 1);
#if (SHADER_TARGET >= 30)
// SM2.0: instruction count limitation
// SM2.0: normal scaler is not supported
normal.xy *= bumpScale;
#endif
normal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));
return normal;
#endif
}
As far as I’m aware, no mobile platform ( Android/iOS) supports DXT compression, meaning that the unpacked normal will NEVER have the normalmap strength value applied to it, regardless of the supported shader level api!
This could be considered a bug, as the first condition is preventing any other code from executing on mobile devices, where as in reality if a mobile device supports shader level 3.0 or more one ‘might’ consider the hardware performant enough that it can handle scaling the normalmap.
So the code can be ‘fixed’ relatively easily, however it will require considerably more processing power than not scaling the normal, as not only do you have to unpack then scale, but also renormalize. Which is why i’m hesitatent in thinking Unity will fix this at this point in time. If they do I hope they will include it as a user define, as its important to avoid this type of performance drain if you are not using bumpscale.
If you want to fix this yourself I guess the following should work in UnityStandardUtils.cginc ( untested )
half3 UnpackScaleNormal(half4 packednormal, half bumpScale)
{
#if defined(UNITY_NO_DXT5nm)
#if (SHADER_TARGET >= 30)
// SM2.0: instruction count limitation
// SM2.0: normal scaler is not supported
half3 normal;
normal = (packednormal.xyz * 2 - 1);
normal.xy *= bumpScale;
normal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));
return normal;
#else
return packednormal.xyz * 2 - 1;
#endif
#else
half3 normal;
normal.xy = (packednormal.wy * 2 - 1);
#if (SHADER_TARGET >= 30)
// SM2.0: instruction count limitation
// SM2.0: normal scaler is not supported
normal.xy *= bumpScale;
#endif
normal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));
return normal;
#endif
}