Skip to content

Commit

Permalink
Merge remote-tracking branch 'tera/develop' into lwjgl3
Browse files Browse the repository at this point in the history
# Conflicts:
#	engine/src/main/java/org/terasology/engine/subsystem/lwjgl/LwjglGraphics.java
#	engine/src/main/java/org/terasology/rendering/ShaderManagerLwjgl.java
  • Loading branch information
DarkWeird committed Jun 8, 2020
2 parents 10f639b + ed19955 commit b377ec1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ private void checkOpenGL() {
capabilities.OpenGL15,
capabilities.OpenGL20,
capabilities.OpenGL21, // needed as we use GLSL 1.20
capabilities.OpenGL30,
capabilities.OpenGL32,
capabilities.OpenGL33,

capabilities.GL_ARB_framebuffer_object, // Extensions eventually included in
capabilities.GL_ARB_texture_float, // OpenGl 3.0 according to
Expand All @@ -349,9 +346,6 @@ private void checkOpenGL() {
"OpenGL15",
"OpenGL20",
"OpenGL21",
"OpenGL30",
"OpenGL32",
"OpenGL33",
"GL_ARB_framebuffer_object",
"GL_ARB_texture_float",
"GL_ARB_half_float_pixel"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GLContext;
import org.terasology.engine.subsystem.DisplayDevice;
import org.terasology.engine.subsystem.lwjgl.LwjglDisplayDevice;
import org.terasology.entitySystem.systems.RegisterMode;
Expand Down Expand Up @@ -113,6 +114,9 @@ public void renderOpaque() {

@Override
public void renderAlphaBlend() {
if(!GLContext.getCapabilities().OpenGL33) {
return;
}
PerspectiveCamera camera = (PerspectiveCamera) worldRenderer.getActiveCamera();
Vector3f cameraPosition = camera.getPosition();
Matrix4f viewProjection = new Matrix4f(camera.getViewProjectionMatrix())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.google.common.collect.Sets;
import org.lwjgl.Version;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GL20;
Expand Down Expand Up @@ -102,7 +103,11 @@ public void initShaders() {
addShaderProgram("toneMapping");
addShaderProgram("sky");
addShaderProgram("chunk");
addShaderProgram("particle");
if (GL.createCapabilities().OpenGL33) { //TODO remove this "if" when rendering will use OpenGL3 by default
addShaderProgram("particle");
} else {
logger.warn("Your GPU or driver not supports OpenGL 3.3 , particles disabled");
}
addShaderProgram("shadowMap");
addShaderProgram("lightBufferPass");
addShaderProgram("lightGeometryPass");
Expand Down

0 comments on commit b377ec1

Please sign in to comment.