Xonotic Forums
Performance Suggestion - no shaders in reflection shader - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12)
+--- Thread: Performance Suggestion - no shaders in reflection shader (/showthread.php?tid=1213)



Performance Suggestion - no shaders in reflection shader - master[mind] - 11-15-2010

I had another performance concept idea:

Just having realtime world lights and relief mapping on is not an issue, but when there is a reflection, the result drops framerate considerably. The problem is, there is wasted processing being applied to the reflection. If one is using the "good" setting or lower, any shader effects are almost unnoticeable whether off or on in the reflection. So maybe the ability to kill relief/offset mapping, and optionally kill normal maps and gloss in the reflection would boost framerate with out much loss to visual quality. I doubt the transition would be noticeable since the reflection is already slightly blurry and wavy...or usually wavy. This combined with the ability to kill dynamic lights on non world light sources would be some nice compromises for those not using 2 480's in SLI.


RE: Performance Suggestion - no shaders in reflection shader - CuBe0wL - 11-15-2010

As far as I can tell: well done reflections (on warpzones) eat a lot less FPS even on high quality, than enabling HDR lighting, so I don't think they are so much showstoppers.


RE: Performance Suggestion - no shaders in reflection shader - jngdwe - 11-15-2010

I would recommend working on water reflection performance. It is a total fps killer for me, the smallest map with water on even blurry setting will drop my fps at least 80%


RE: Performance Suggestion - no shaders in reflection shader - master[mind] - 11-15-2010

Not the actual rendering of the warpzone, but the fact that it is rendering other shaders when it's rendering the warpzone. i.e. The reflection shader is using the normal map, gloss, offset, relief, hdr, bloom, etc shaders. While hdr and bloom would be a noticable removal, removing relief mapping would not be visually different(by much) but would speed up rendering considerably. Also, in my testing,

HDR made only a slight framerate change.
Relief mapping made more of a change.
Realtime world lights made little change.
It's only when Realtime world lights, several dynamic lights, relief mapping, and warpzones are visible in the same scene that framerate takes a massive hit. Removing the requirement for dynamic weapon lights and setting warpzones to use only basic shaders(normal maps, gloss) will provide the best balance, but neither of these options are implemented, even though seperate dynamic lights seems like it should be disabled...


RE: Performance Suggestion - no shaders in reflection shader - Lee_Stricklin - 11-18-2010

(11-15-2010, 05:39 PM)master[mind] Wrote: I had another performance concept idea:

The problem is, there is wasted processing being applied to the reflection. If one is using the "good" setting or lower, any shader effects are almost unnoticeable whether off or on in the reflection. So maybe the ability to kill relief/offset mapping, and optionally kill normal maps and gloss in the reflection would boost framerate with out much loss to visual quality. I doubt the transition would be noticeable since the reflection is already slightly blurry and wavy...or usually wavy. This combined with the ability to kill dynamic lights on non world light sources would be some nice compromises for those not using 2 480's in SLI.

The offset mapping can't possibly be noticeable on a reflection that is being shown on water. Only at a stand still while the player is actually looking for it can I imagine the other stuff (except bloom) being noticeable. If there is a way to stop that from drawing on a water-based reflection then there would be virtually no drop in visual quality, but a possible boost in the frame rate not to mention less sudden slow-downs.


RE: Performance Suggestion - no shaders in reflection shader - master[mind] - 11-18-2010

Exactly Lee, lighting effects would be the only noticable differences. Hmmmm...one other nice customizable option would be selectable levels of Relief Mapping iterations. I could pick a lower level for performance purposes. And finally, I notice that offset mapping actually looks pretty flawed, any that stretches farther than a few pixels, the texture repeats, and the normal map isn't properly aligned...is that just a tweaking issue? I really need to just delve into the code....


RE: Performance Suggestion - no shaders in reflection shader - Lee_Stricklin - 11-19-2010

(11-18-2010, 11:31 PM)master[mind] Wrote: Exactly Lee, lighting effects would be the only noticable differences. Hmmmm...one other nice customizable option would be selectable levels of Relief Mapping iterations. I could pick a lower level for performance purposes. And finally, I notice that offset mapping actually looks pretty flawed, any that stretches farther than a few pixels, the texture repeats, and the normal map isn't properly aligned...is that just a tweaking issue? I really need to just delve into the code....

It doesn't really do anything for performance, but you can tweak the offset mapping to your liking (if you have relief mapping enabled) through a Cvar and set it's depth to anything you want. I'll post it when I find out where it was.


RE: Performance Suggestion - no shaders in reflection shader - master[mind] - 11-19-2010

Ah, that would be great. Cause offset just doesn't look right. That's why I don't want to sacrifice Relief mapping, but the performance hit with realtime lighting is too massive.


RE: Performance Suggestion - no shaders in reflection shader - Lee_Stricklin - 11-20-2010

(11-19-2010, 02:54 PM)master[mind] Wrote: Ah, that would be great. Cause offset just doesn't look right. That's why I don't want to sacrifice Relief mapping, but the performance hit with realtime lighting is too massive.
Try messing around with:

r_glsl_offsetmapping_scale

The default value for that is 0.02


RE: Performance Suggestion - no shaders in reflection shader - master[mind] - 11-20-2010

Well, 0.011 seemed the best balance between distortion and 3dishness. 0.008 removed all distortion but Non deep textures lost all visibility of having offset mapping applied. The distortion I'm referring to is...
[Image: 0.02.png]
That. It's at 0.02

Here it is at 0.011:
[Image: 0.011.png]

And finally at 0.008(all distortion is mostly gone):
[Image: 0.011.png]

But watch what happens to the brick.
0.02:
[Image: brick0.02.png]

0.008:
[Image: brink0.008.png]

Now the 3d effect is almost non visible.

But this should be the proper stretching used:
[Image: proper_stretch_0.02.png]

That's basically what relief mapping does. And it looks much better. Because of that glitch in the offset mapping, the lighting effect on the texture also gets distorted. Just stretching the texture at that point would solve the problem. If limits are removed on how much a texture can be stretched and shrunk, the quality of the offset map would improve greatly. Even using a simple scaling method(like nearest neighbor) would probably work fine.


RE: Performance Suggestion - no shaders in reflection shader - Lee_Stricklin - 11-28-2010

Here's a comparison between MAXED OUT (except AA) VS EXTREMELY LOW settings when looking through the warp zone on Stormkeep. Keep in mind that warp zone texture also went down in quality when you compare these. Assuming that the water reflections shader has any similarities to warp zones in that they draw everything, then it would be beneficial to find a way to tell it to not draw certain things. *My brain just about fried after reading that, oh well I'm pretty sure you'll get what I'm trying to say*


MAXED OUT
[Image: brpq74y72aqlnbnvpsj_thumb.jpg]

Settings
[Image: 9kv2emhgwjlfjvstosy_thumb.jpg]

EXTREMELY LOW
[Image: mqq58hn0iasquo33xrg_thumb.jpg]

Settings
[Image: 943tw2afzpmlgw0cu6fr_thumb.jpg]

NOTE: Ignore where it says custom on my reflections setting. That was caused by me customizing my shadow resolutions. My reflections level if I remember correctly was set to good.