Skip to content
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

WIP: set a minimum amount of lighting #199

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@illwieckz
Copy link
Member

illwieckz commented Apr 7, 2019

The last time I updated The Dark Mod, I got a bug: there was no lighting. But I noticed everything was still visible. So I discovered that this stealth game relying a lot on darky zones never has pure black dark zones:

no light

no light

no light

I remembered the usual complain about the Unvanquished game being too darky, and I thought the idea was nice and I wanted the feature in Dæmon too, it's a gameplay issue.

Then I was yet another time annoyed by the ugly darky blotches of our non-sRGB lightmaps. And then the light came to my mind. If there is no pure dark zones, there can't be dark blotches.

Dark blotches come from the fact the current color curve does not have so much steps in the dark part, hence the shadows coming from average grey to pure black in one step.

So I implemented this hack. For every shadow color component between 0 and 0.18, rescale it between 0.06 and 0.18. The 0.06 value was chosen the empirical way by testing with some maps suffering a lot from the bug, and some other maps to ensure nothing wrong occurs. The 0.18 value was arbitrarily chosen without much thinking.

I really have no idea about the way to name this feature. Currently, the cvar is named r_floorLight, I highly recommend yourself to try this.

It's an easy hack to greatly improve the looking of our maps. sRGB lightmaps will tamper the need for such hack for good looking purpose, but since it's a good feature to always keep a minimum amount of light, it may be good to keep the feature and just adjust the numbers for the sRGB curve.

Note: it looks less good in thumbnails because the dark stuff being less contrasted, but it looks better in game this way:

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

floorlight

There is one issue though, the usual "black" texture hack does not work anymore:

floorlight

@illwieckz

This comment has been minimized.

Copy link
Member Author

illwieckz commented Apr 7, 2019

Note: for some unknown reason I have to delete ~/.local/share/unvanquished/glsl between each vid_restart when I switch r_floorLight value.

@illwieckz

This comment has been minimized.

Copy link
Member Author

illwieckz commented Apr 7, 2019

Note that when maps are not really contrasted with this feature it just means the given maps have very low light, since it would mean that the average light of the given scenes would be very near the color step from where the grey becomes pure black…

@slipher

This comment has been minimized.

Copy link
Contributor

slipher commented Apr 8, 2019

Well this is a great cheat code for the humans 😛

Do we really want to have settings like that though? Which give an advantage to people who know to turn them on?

Alternatively, it could be turned on by default, but it seems bad that the renderer is not faithfully rendering what the output image should be according to the inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.