From: Latif Khalifa Date: Tue, 5 Jul 2011 23:15:56 +0000 (+0000) Subject: Implemented "FullBright" attribute for textures X-Git-Tag: 2.8~413 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c978232d24be29b2f88bcf08fddf0b97e96d0982;p=radegast%2Fradegast.git Implemented "FullBright" attribute for textures git-svn-id: https://radegast.googlecode.com/svn/trunk@951 f7a694da-4d33-11de-9ad6-1127a62b9fcd --- diff --git a/Radegast/GUI/Rendering/Rendering.cs b/Radegast/GUI/Rendering/Rendering.cs index 6115dd9..5574019 100644 --- a/Radegast/GUI/Rendering/Rendering.cs +++ b/Radegast/GUI/Rendering/Rendering.cs @@ -1510,6 +1510,9 @@ namespace Radegast.Rendering if (teFace == null) continue; + int lightsEnabled; + GL.GetInteger(GetPName.Lighting, out lightsEnabled); + if (pass != RenderPass.Picking) { bool belongToAlphaPass = (teFace.RGBA.A < 0.99) || data.TextureInfo.HasAlpha; @@ -1520,6 +1523,11 @@ namespace Radegast.Rendering // Don't render transparent faces if (teFace.RGBA.A <= 0.01f) continue; + if (teFace.Fullbright && lightsEnabled != 0) + { + GL.Disable(EnableCap.Lighting); + } + switch (teFace.Shiny) { case Shininess.High: @@ -1613,6 +1621,11 @@ namespace Radegast.Rendering GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0); } + + if (teFace.Fullbright && lightsEnabled != 0) + { + GL.Enable(EnableCap.Lighting); + } } GL.BindTexture(TextureTarget.Texture2D, 0);