-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
[3.x] Implement glow map effect #93133
Conversation
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.
Documentation itself is fine
This looked good to me from preliminary look last week, however we are in feature freeze for 3.6 so will bump to 3.7 (I don't think we have a 3.7 milestone yet but leaving as 3.x). |
Great! I hope it will be included in 3.6, there is still a lot of time between beta -> RC1-2 -> release. |
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.
Tested locally (rebased on top of 3.x
26405db), it works as expected.
Testing project: truck_town_at_night_3.x.zip
The only thing I'm slightly wary of here is whether the glowmap is having a cost even when not used in the shader. It seems to create the sampler and use an if statement to branch into the texture lookup, even if the texture is not being used. I don't know whether the shaders on mobile especially will be able to optimize this out. An alternative might be to add a |
You can see the impact on various Mali devices using the Mali Shader Compiler. I've set up a demo in ShaderPlayground with this code https://shader-playground.timjones.io/8878ac907e47866464793e70c46da22d. You can just delete the lines to see the impact. On the default Mali G78, this code doesn't harm "best case performance" which measures the case where the branch fails. It does increase typical case texture fetchs by 25% and texture fetches are the bottleneck here, so I would expect some performance impact. Looking at older devices (Mali G31, T720), the texture fetches are impacted more, however, on such low end devices, we become instruction bound on the arithmetic unit instead. So the impact of the extra texture might be minimal. |
We decided that Actually, @Chaosus would you be able to rebase just in case as it's been a few months since this was updated? |
fdc5d56
to
5d1e7e5
Compare
Done |
Thanks! |
This will make it possible even on 3.x:
Adds
glow_map
andglow_map_strength
properties toEnvironment
and a new method calledenvironment_set_glow_map
toVisualServer
(I did not add additional parameterenvironment_set_glow
because then we need to add a 14 parameter support to D_METHOD and several other internal method for bindings). Yes, I understand that this in incompatible with 4.x, but it's better than expand the existed bindings too much (If not, I will try to fix it) ?You can test this change with this asset library template: