How do I get the color to shade ground with?

How do I get the color to shade ground with?

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

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

How do I get the color to shade ground with?

Post by zwzsg »

So, the ground of a Spring map is shaded according to which direction it faces and where the sun is.

I'd like to know what the gl.Color I should apply to a Lua textured quad so it's shaded just like the ground is.

Because currently all my Lua drawn textures are fully lit, and it breaks the melting in the map.

I'm sure that with all the Lua coders around, one has already written down the formula to get the shading according to sun position and the face normal, and it would be a waste of time to attempt to figure it myself anew.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: How do I get the color to shade ground with?

Post by Kloot »

Bind the ground shading texture ($shading) and modulate yours with it.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: How do I get the color to shade ground with?

Post by zwzsg »

I wish I'd understand what you mean.

Edit: Nevermind, I didn't understand half of what I did, but I've gotten half decent results.
Post Reply

Return to “Lua Scripts”