-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix dynamic lights intensity, cleanup #1425
Fix dynamic lights intensity, cleanup #1425
Conversation
Why don't we nuke the |
b628f0a
to
0670349
Compare
Right, done now. |
50875cb
to
ffb8083
Compare
light->l.scale = -intensity; | ||
else | ||
light->l.scale = intensity; | ||
if ( light->l.inverseShadows ) { |
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.
The forward lighting shader checks the sign of u_LightScale to check for inverse lights. These are said to be already broken, but it would be nice to set the scale to 1 or -1 to at least gesture at how it was supposed to work
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.
scale
is already removed there, so there's nothing to set.
ffb8083
to
3993866
Compare
DaemonEngine/Daemon#1425 NUKEs random light scaling, this sets the dynamic light values to compensate for that.
I have created a PR in res-weapons repo for this: UnvanquishedAssets/res-weapons_src.dpkdir#32. |
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 ingame and feels good
There are some maps with particle systems with dynamic lights, so not everything can be made the same by only adjusting the game’s own assets. Also there are some places where dynamic light intensities from config files are clamped to [0, 1] (yeah that’s stupid and shouldn’t be done), so that’s something we would need to watch out for if adjusting configs. |
Which maps?
Yes, that is particles and beams/trails. Those look fine though. |
For example usstremor at viewpos 112 -306 86 6 2. Here is an index where all map particle systems with one can be found under
We have particle and trail systems using dynamic lights in Why don't we just add back the scaling factors to anywhere the lights are used on the gamelogic side? This is an easy way to avoid unwanted changes to assets. I doubt designers are coming in with a specific expectation like 'the illumination should be equivalent to fullbright at distance 200 with intensity 17.4', so the arbitrary factor doesn't hurt anything. |
Thanks, I'll test those once I update this/Unvanquished-side branch.
I tried with those initially, but they ended up looking wrong because of the 8-bit precision limit.
I agree, I've been thinking about doing just that. |
3993866
to
d6d0194
Compare
This was a cheat cvar used for dynamic lights that have no intensity set, and set to 2.0 for absolutely no reason whatsoever.
…ET() to RE_AddDynamicLightToScene() These were largely doing the same thing, use just one function instead.
This has largely the same functionality as trap_R_AddLightToScene().
This was only used to scale the light's colour, just multiply the colour with it earlier on instead.
d6d0194
to
2585690
Compare
I've added a fix for that to the Unvanquished-side pr. Both the dynamic lights on maps and those produced by weapons look fine to me with that change. |
DaemonEngine/Daemon#1425 NUKEs random light scaling, this sets the dynamic light values to compensate for that.
Cgame-side pr: Unvanquished/Unvanquished#3184
Dynamic light config update for weapon flash colours: UnvanquishedAssets/res-weapons_src.dpkdir#32
r_lightScale
cvar, which is used for dynamic lights, but it's a cheat cvar and always set to 2.0, and essentially only used for dynamic lights spawned from moversRE_AddDynamicLightToSceneQ3A()
and renamedRE_AddDynamicLightToSceneET()
toRE_AddDynamicLightToScene()
because they're essentially the sametrap_R_AddAdditiveLightToScene()
Fixes #61:
![unvanquished_2024-11-09_184524_000](https://private-user-images.githubusercontent.com/10687142/384630171-46238578-300f-4565-89f8-3c9eee0953c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Mzc3NDQsIm5iZiI6MTczODkzNzQ0NCwicGF0aCI6Ii8xMDY4NzE0Mi8zODQ2MzAxNzEtNDYyMzg1NzgtMzAwZi00NTY1LTg5ZjgtM2M5ZWVlMDk1M2M0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDE0MTA0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhYzUwNTdhMzZjZmU3NzQ3NmUwMmRjZWMyYzJmZDc3NTg0M2I5YzQ5OWYxNjBiNjczZjJhNThiOGQyYzZkMTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.mVZ2mbBMgnNGCDWLj8S5dafJL7DE8N_mXhf50-vfKNQ)
![unvanquished_2024-11-09_184725_000](https://private-user-images.githubusercontent.com/10687142/384630180-39d031d9-b235-4582-9c80-3d3af0bf1e60.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Mzc3NDQsIm5iZiI6MTczODkzNzQ0NCwicGF0aCI6Ii8xMDY4NzE0Mi8zODQ2MzAxODAtMzlkMDMxZDktYjIzNS00NTgyLTljODAtM2QzYWYwYmYxZTYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDE0MTA0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU3OTEyMjRkMGM4Mzc5MTYzYTNmNjdjOTQzM2NmMWNhNjgwMGJkZWU4MGZlODZmODRlZGZlMDQ1MDZlNjg1MDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.cLirJ2difMwo_s55ze2Xf295mf4YyQ3CN48JKlp-5HA)
hq-beta28
:Before:
After:
tremtest
:Before:
After: