From 5cc9a6a9a433ced1518b653e4935527538da5523 Mon Sep 17 00:00:00 2001 From: Josephine Rueckert Date: Sun, 22 Oct 2023 15:39:39 +0200 Subject: [PATCH 1/3] qa: make final field static --- .../rendering/dag/nodes/FinalPostProcessingNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/FinalPostProcessingNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/FinalPostProcessingNode.java index 03272b2..7c8389c 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/FinalPostProcessingNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/FinalPostProcessingNode.java @@ -53,6 +53,7 @@ public class FinalPostProcessingNode extends AbstractNode implements PropertyChangeListener { public static final SimpleUri POST_FBO_URI = new SimpleUri("engine:fbo.finalBuffer"); private static final ResourceUrn POST_MATERIAL_URN = new ResourceUrn("CoreRendering:post"); + private static final int noiseTextureSize = 1024; private WorldRenderer worldRenderer; private RenderingConfig renderingConfig; @@ -78,7 +79,6 @@ public class FinalPostProcessingNode extends AbstractNode implements PropertyCha private Vector3f tint = new Vector3f(.0f, .0f, .0f); - private final int noiseTextureSize = 1024; public FinalPostProcessingNode(String nodeUri, Name providingModule, Context context) { super(nodeUri, providingModule, context); From 45ddced2fd6cdf2f6668998d03626db13d58fb31 Mon Sep 17 00:00:00 2001 From: Josephine Rueckert Date: Sun, 22 Oct 2023 16:38:36 +0200 Subject: [PATCH 2/3] qa: if statement nesting not necessary --- .../rendering/dag/nodes/DeferredPointLightsNode.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/DeferredPointLightsNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/DeferredPointLightsNode.java index 2d1d527..7b5b895 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/DeferredPointLightsNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/DeferredPointLightsNode.java @@ -151,11 +151,9 @@ public void process() { lightGeometryMaterial.setInt("texSceneOpaqueNormals", 1, true); lightGeometryMaterial.setMatrix4("viewProjMatrix", activeCamera.getViewProjectionMatrix()); - if (renderingConfig.isDynamicShadows()) { - if (renderingConfig.isCloudShadows()) { - lightGeometryMaterial.setFloat("time", worldProvider.getTime().getDays(), true); - lightGeometryMaterial.setFloat3("cameraPosition", cameraPosition, true); - } + if (renderingConfig.isDynamicShadows() && renderingConfig.isCloudShadows()) { + lightGeometryMaterial.setFloat("time", worldProvider.getTime().getDays(), true); + lightGeometryMaterial.setFloat3("cameraPosition", cameraPosition, true); } if (renderingConfig.isDynamicShadows()) { From e8750ca01147fc1f216227ac8a9a5d5f4e26951f Mon Sep 17 00:00:00 2001 From: Josephine Rueckert Date: Sun, 22 Oct 2023 16:57:56 +0200 Subject: [PATCH 3/3] qa: remove unused local variable --- .../rendering/dag/nodes/SimpleBlendMaterialsNode.java | 2 -- .../corerendering/rendering/dag/nodes/WorldReflectionNode.java | 1 - 2 files changed, 3 deletions(-) diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/SimpleBlendMaterialsNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/SimpleBlendMaterialsNode.java index 86c8339..dcf17c2 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/SimpleBlendMaterialsNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/SimpleBlendMaterialsNode.java @@ -47,8 +47,6 @@ public SimpleBlendMaterialsNode(String nodeUri, Name providingModule, Context co @Override public void setDependencies(Context context) { - Camera playerCamera = context.get(WorldRenderer.class).getActiveCamera(); - BufferPairConnection bufferPairConnection = getInputBufferPairConnection(1); addOutputBufferPairConnection(1, bufferPairConnection); addOutputFboConnection(1, bufferPairConnection.getBufferPair().getPrimaryFbo()); diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/WorldReflectionNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/WorldReflectionNode.java index baaf6f2..fa29bdc 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/WorldReflectionNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/WorldReflectionNode.java @@ -101,7 +101,6 @@ public WorldReflectionNode(String nodeUri, Name providingModule, Context context public void setDependencies(Context context) { addDesiredStateChange(new ReflectedCamera(activeCamera)); // this has to go before the LookThrough state change - DisplayResolutionDependentFbo displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFbo.class); FBO reflectedFbo = getInputFboData(1); addOutputFboConnection(1, reflectedFbo); addDesiredStateChange(new BindFbo(reflectedFbo));