I wonder if someone could explain why Detail Normal Scale on the Lit shader has the following weird behavior: Adjusting it seems to change the direction that light is coming from, as though I were rotating a skybox around the object.
Here’s an example. In this case, I’m sliding the “Detail Normal Scale” from 0 to 2 under the Detail Inputs section of the material:
This is a simple Lit shader, to which I’ve assigned a Detail map. The detail map looks like this:
So why does it look like the lighting is moving across the surface of the object?
I make my Detail Maps in Substance Designer, using the following utility:
Am I doing something wrong?
Can you clarify what you mean by that? I haven’t shown a normal map. The image I showed is the Detail map I created. The components of the detail map are shown here:
https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@7.4/manual/Mask-Map-and-Detail-Map.html
The detail map contains the R and G components of a normal map, sent into A and G respectively. The other two channels are albedo and smoothness. Maybe I’m misunderstanding which normal map you’re referring to.
Your setup in substance seems correct.
But I see the texture is imported as sRGB, where it should be linear, and this might explain the bad lighting issue.
Edit: Nevermind the incorrectness in this past. See my post further down.
Thanks, I didn’t know that made any difference. I tried unchecking sRGB on the texture import inspector, but that doesn’t seem to change the behavior significantly. I’d say it looks a little better with sRGB unchecked, but the weird lighting effect is still noticeable. Was there something else I should have done to the texture? I re-exported it from Substance Designer using linear color space, and here’s what it looks like in Unity now:
I was also wondering if there was some place I could find a Detail Map that’s known to work properly, which I could use to verify it’s not just something weird I’m doing in generating my detail map? I’ve also uploaded a lower-res version of the detail map I’m using, in case there’s some way to verify it’s correct.
Edit: Nevermind the incorrectness in this past. See my post further down.
Well, it does seem to be something wrong with my actual textures, though I don’t know what the problem is yet. I looked in the Spaceship Demo that Unity released (Unity Blog), hoping to find some detail maps being used. And I found some. I tried using them in my project, just to test out whether it gave me the same weird lighting, but those detail maps actually work properly.
I don’t yet know why one texture works properly while the other doesn’t, but I’ll dig deeper into how I’m generating the textures in Substance Designer. I’ll update this when/if I figure it out, but my current theory is I’m just doing something wrong exporting the textures from Substance Designer.
Well, I’m not sure what caused me to think that unchecking sRGB on the texture import settings wasn’t enough, byut it now seems that all I needed to do. At this point, I don’t need to reexport any of my detail maps, I just needed to uncheck sRGB, and at this point they all work completely as expected.
Thanks for the help with this. It makes me wonder if some of my other issues are due to textures being flagged as sRGB when they shouldn’t be. I’ll have to read up on why and when I should be using sRGB textures.
Quick general answer for sRGB :
If it’s not to use directly as a pure color information (ex: split channels data, like in the mask map), don’t check it, and use linear color space.
1 Like
Thanks. Looks like I’ve got all my Mask Maps set to sRGB as well, which is probably causing exaggerated metalness and AO on some of my textures. Good stuff to know.