-
Notifications
You must be signed in to change notification settings - Fork 63
renderer: rework tone mapper and SSAO enablement #1577
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
Conversation
Note that it renames Other related |
b8e1026
to
4bcd615
Compare
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.
This still has the issue of not being able to instantly turn tonemapping on/off.
The naming should be consistent since that works better with console auto-complete. |
08acdd5
to
5d3777f
Compare
Now unified. |
I'm not considering this an issue. I can see the annoyance when testing stuff, but normal usage never randomly switches such option. For the annoyance of having to do a |
I don't agree with the assumption "normal users should never want to toggle settings". How are you supposed to decide whether you want to use a setting without turning it off and on to compare the two configurations? |
Using an uniform to disable the feature means the code is actually executed on hardware not supporting modern branching and then the renders still have to wait for the compute to be done and discarded. Here the disabled feature was still eating 30% of the performance on the testbed I was using when noticing it I'm not saying it would not be nice to be able to toggle that without any |
The problem here is that headers need to be regenerated. Shaders sources are all in a hashmap for built-in shaders. |
That's part of implementation details to be discussed there: |
That is why I suggested just disabling based it on the GLSL version. Clearly such hardware is incapable of running it at a playable framerate when it's enabled. |
One thing is that I don't know what kind of hardware can truly branch. For example AMD TeraScale (the previous-to-current architecture) is GL 4.5 but has some VLIW architecture and I'm not sure they are good at branching because of that. I can test on them, but in general I prefer to skip building the disabled code. |
Proper branching at ~GTX 600 series, so probably around the same for AMD. Plus, all of those Terascale GPUs are at least a decade and a half old. |
5d3777f
to
7ede8db
Compare
In fact, tone-mapping is cheap on high-end GLSL 120 cards, so, GLSL version doesn't matter. What matters is: is the hardware low-end or not? Here is an ATI RV570 (Radeon X1950 PRO), it only supports OpenGL 2.1 with GLSL 120, but it has no problem at running the tone mapper:
This runs at 80 fps on “HDReady” It should be noted that this card is currently plugged in as a secondary card and is rendering through This is actually a good example of GL 2.1 card that is brings a very nice playing experience. The 0.55.2 benchmark gets 50 fps on Actually it looks like this card even does branching properly, as the non-latched implementation also shows the frame rate difference on disablement. So we can't use the GL or GLSL version to detect the card would suffer from tone mapping, we would have to resort on card family detection if we want to disable the feature (that would be really annoying). But the good thing is that by doing this testing I noticed that frame rate was the same with or without tone mapping on Tone mapping requires Actually I would prefer to disable the build of the tone mapper when the tone mapper is actually disabled, this is much much cleaner. |
Something like an |
9afc991
to
778ddd2
Compare
That's what I just did. This may be an acceptable compromise for now, but this is ugly. 🫣 The day we can do some lazy shader permutation rebuild I will likely revert that. |
778ddd2
to
13955a1
Compare
Revert to what? |
Revert to my first implementation of the commit: #if defined(r_toneMapping)
…
#endif |
4ecc379
to
743eab1
Compare
Another option is to run this shader a few times while measuring performance to see if it has an effect, then cache the result in some cvar (and only check again if the detected hardware changes). |
743eab1
to
9cc8ed1
Compare
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.
LGTM
Rework tone mapper and ssao enablement.
Extracted from: