diff --git a/engine/src/core-data/Common/MatDefs/Light/Lighting.vert b/engine/src/core-data/Common/MatDefs/Light/Lighting.vert index a74fe9438..03996c022 100644 --- a/engine/src/core-data/Common/MatDefs/Light/Lighting.vert +++ b/engine/src/core-data/Common/MatDefs/Light/Lighting.vert @@ -99,6 +99,9 @@ void lightComputeDir(in vec3 worldPos, in vec4 color, in vec4 position, out vec4 } float lightComputeSpecular(in vec3 norm, in vec3 viewdir, in vec3 lightdir, in float shiny){ + if (shiny <= 1.0){ + return 0.0; + } #ifndef LOW_QUALITY vec3 H = (viewdir + lightdir) * vec3(0.5); return pow(max(dot(H, norm), 0.0), shiny); diff --git a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java index bd38bd2e1..31bd7b39b 100644 --- a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java +++ b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java @@ -125,6 +125,12 @@ public class LwjglDisplay extends LwjglAbstractDisplay { } Display.setVSyncEnabled(settings.isVSync()); + + if (created.get()){ + Display.releaseContext(); + Display.makeCurrent(); + Display.update(); + } if (!created.get() || pixelFormatChanged){ ContextAttribs attr = createContextAttribs(); diff --git a/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag b/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag index 3233c3158..c06cca739 100644 --- a/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag +++ b/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag @@ -161,6 +161,9 @@ float lightComputeDiffuse(in vec3 norm, in vec3 lightdir, in vec3 viewdir){ } float lightComputeSpecular(in vec3 norm, in vec3 viewdir, in vec3 lightdir, in float shiny){ + if (shiny <= 1.0){ + return 0.0; + } #ifdef WARDISO // Isotropic Ward vec3 halfVec = normalize(viewdir + lightdir);