Does anyone have docu for the dynamic lighting gadget?

Does anyone have docu for the dynamic lighting gadget?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Does anyone have docu for the dynamic lighting gadget?

Post by Silentwings »

See topic.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Does anyone have docu for the dynamic lighting gadget?

Post by Beherith »

Code: Select all

		void DecayColors() {
			const bool expAmbientDecay  = (decayFunctionType.x != 0.0f);
			const bool expDiffuseDecay  = (decayFunctionType.y != 0.0f);
			const bool expSpecularDecay = (decayFunctionType.z != 0.0f);

			if (expAmbientDecay) {
				ambientColor *= ambientDecayRate;
			} else {
				ambientColor -= ambientDecayRate;
			}

			if (expDiffuseDecay) {
				diffuseColor *= diffuseDecayRate;
			} else {
				diffuseColor -= diffuseDecayRate;
			}

			if (expSpecularDecay) {
				specularColor *= specularDecayRate;
			} else {
				specularColor -= specularDecayRate;
			}
		}
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: Does anyone have docu for the dynamic lighting gadget?

Post by jamerlan »

I just want to ask again. Maybe spring devs can help:

Is it possible to implement dynamic lightening for lasers?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Does anyone have docu for the dynamic lighting gadget?

Post by Kloot »

bolt-style lasers: yes, easily
beam-style lasers: nope

for the rest: http://springrts.com/wiki/Lua_UnsyncedCtrl#Rendering
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Does anyone have docu for the dynamic lighting gadget?

Post by Silentwings »

thanks!
Post Reply

Return to “Lua Scripts”