-
-
Notifications
You must be signed in to change notification settings - Fork 57
normal map attenuation properties #1461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: protocol_changes
Are you sure you want to change the base?
normal map attenuation properties #1461
Conversation
334833f
to
ab39980
Compare
This might be a weird question to ask after you open this PR, but why should we expose the normal map attenuation? |
fair question! yes it’s kinda like the shadow settings. normal maps are for small details which become high frequency noise at a distance, causing artifacts like moire patterns. we fade them out over a distance to hide this, but the distance at which we want to fade can depend on the scale of the objects/normal maps, so it’s nice to make it configurable for creators other engines have similar things I believe |
Sounds like the distance should be set based on render resolution and how large a normal map is rendered in relation to its resolution (or how detailed it is, if we can find that out). |
Currently lack of normal maps on distant objects makes normal mapped terrain look very flat, and having this setting is a very welcome improvement that was requested by several artists. I think it's a really good idea to allow it to "Inherit" like other settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Everything looks good :)
I just tested it and everything works very well, but currently there's no Inherit functionality, so it makes using this feature very difficult. I think zones should inherit it by default, like skyboxes for example. |
Inheritance would be good to have. |
There doesn't seem to be any performance decrease, I think shader always samples normal map?
I don't think so. The worlds I tested looked much better with longer normal map distance, and normal maps become softer in the distance naturally thanks to mipmaps.
True. Considering amount of existing content though, maybe it would be best to test and see if there are any problems, and if exisitng worlds look better or worse with longer distance? I'd be happy to help testing and gather comparison screenshots. |
If there is no real rendering cost impact. Then I see no reason to have this as a property. There is not artistic value to reduce that "normal map "rendering distance. So inheritence would become pointless too. Maybe turn this as an interface graphical setting (if it's not already that) |
I will test a bit more and see if I can find world where attenuation is needed - for now it looks like having normal maps at all distances looks much nicer in most worlds. |
I think the problematic case is going to be more like:
in those cases the mip maps start to break down. trilinear blending would probably help but not completely. if I remember correctly hifi ran into this problem for some event or environment, hence the introduction of the fade out so if that were true, even if it’s not used much, seems like we’d need a property for it. but can certainly bump up the defaults (there’s no cost, like 74 said), and definitely add inheritance (would add a new mode) but if that’s NOT true and we decide it’s not necessary, I can certainly make it just a graphics setting or something (and still bump up defaults) |
@HifiExperiments That's a really good point, I need to test more and see what happens at sharply angled surfaces |
oh! possibly:
overte/libraries/gpu/src/gpu/Texture.h Line 163 in 4cbde7e
but…is that sufficient? |
closes #1139
per the open question in the issue, I didn't yet implement a mode for this. do we want to be able to set this to "inherit" etc.? if that's something we want I can add it, these properties are just slightly different than other zone properties so not sure?
Funding
This project is funded through NGI Zero Core, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.