Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	editor/CHANGES
  • Loading branch information
JamesTKhan committed Jul 27, 2023
2 parents b5d1236 + a5ea338 commit ddff4e9
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ allprojects {

ext {
appName = "Mundus"
gdxVersion = '1.11.0'
gdxVersion = '1.12.0'
visuiVersion = '1.5.0'
kryoVersion = '5.2.0'
junitVersion = '4.13.2'
Expand Down
14 changes: 10 additions & 4 deletions commons/src/main/com/mbrlabs/mundus/commons/Scene.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.mbrlabs.mundus.commons;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Color;
Expand Down Expand Up @@ -84,6 +85,7 @@ public class Scene implements Disposable {
protected FrameBuffer fboWaterReflection;
protected FrameBuffer fboWaterRefraction;
protected FrameBuffer fboDepthRefraction;
private boolean isMRTRefraction = false;

private DepthShader depthShader;

Expand Down Expand Up @@ -178,7 +180,7 @@ public void render(float delta) {
modelCacheManager.update(delta);

if (sceneGraph.isContainsWater()) {
if (!Gdx.graphics.isGL30Available()) {
if (!isMRTRefraction) {
captureDepth();
}
captureReflectionFBO();
Expand Down Expand Up @@ -322,10 +324,14 @@ protected void renderShadowMap() {

protected void initFrameBuffers(int width, int height) {
fboWaterReflection = new NestableFrameBuffer(Pixmap.Format.RGB888, width, height, true);
if (Gdx.graphics.isGL30Available()) {

// Despite supporting MRT on WebGL2, the depth precision is far worse then doing a separate depth pass frustratingly.
isMRTRefraction = Gdx.graphics.isGL30Available() && Gdx.app.getType() != Application.ApplicationType.WebGL;

if (isMRTRefraction) {
NestableFrameBuffer.NestableFrameBufferBuilder frameBufferBuilder = new NestableFrameBuffer.NestableFrameBufferBuilder(width, height);
frameBufferBuilder.addBasicColorTextureAttachment(Pixmap.Format.RGB888);
frameBufferBuilder.addDepthTextureAttachment(GL30.GL_DEPTH_COMPONENT24, GL30.GL_UNSIGNED_SHORT);
frameBufferBuilder.addDepthTextureAttachment(GL30.GL_DEPTH_COMPONENT24, GL30.GL_UNSIGNED_INT);
fboWaterRefraction = frameBufferBuilder.build();
} else {
fboWaterRefraction = new NestableFrameBuffer(Pixmap.Format.RGB888, width, height, true);
Expand Down Expand Up @@ -442,7 +448,7 @@ private Texture getRefractionTexture() {

private Texture getRefractionDepthTexture() {
Texture refractionDepth;
if (Gdx.graphics.isGL30Available()) {
if (isMRTRefraction) {
refractionDepth = fboWaterRefraction.getTextureAttachments().get(DEPTH_ATTACHMENT);
} else {
refractionDepth = fboDepthRefraction.getColorBufferTexture();
Expand Down
5 changes: 3 additions & 2 deletions editor/CHANGES
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[0.5.1]
[0.5.1] ~
- Added FPS launcher argument, always call setForegroundFPS
- Fix mouse picking by not rendering inactive game objects to picker
- Fix removed terrain in helper lines
- Fix undo removed light component on selected game object
- Fix Material culling value being reset to GL_NONE by editor
- Fix crash on Asset Usage tool when Light Component in scene
- Updated libGDX to 1.12.0

[0.5.0]
[0.5.0] ~ 06/28/2023
- [Breaking Change] Lighting systems updated, visibly different. See PR#184
- Convert Water Shader to an Uber Shader
- Water Shader Enhancements (visible depth, toggle reflection/refraction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,13 @@ public void glDrawRangeElements (int mode, int start, int end, int count, int ty
check();
}

@Override
public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, int offset) {
incrementCalls();
gl30.glTexImage2D(target, level, internalformat, width, height, border, format, type, offset);
check();
}

@Override
public void glTexImage3D (int target, int level, int internalformat, int width, int height, int depth, int border, int format,
int type, Buffer pixels) {
Expand All @@ -1240,6 +1247,13 @@ public void glTexImage3D (int target, int level, int internalformat, int width,
check();
}

@Override
public void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, int offset) {
incrementCalls();
gl30.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, offset);
check();
}

@Override
public void glTexSubImage3D (int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth,
int format, int type, Buffer pixels) {
Expand Down
5 changes: 4 additions & 1 deletion gdx-runtime/CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[0.5.0] ~
[0.5.1] ~
- Updated libGDX to 1.12.0

[0.5.0] ~ 06/28/2023
- [Breaking Change] Terrain API modified to closer reflect Models
- [Breaking Change] ShadowMapper class removed. Replaced with MundusDirectionalShadowLight
- Lighting systems updated, visibly different. See PR#184
Expand Down

0 comments on commit ddff4e9

Please sign in to comment.