From eb5e1067a7418bb4acf8bda674b47ea64fef76ea Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 17 Dec 2023 18:04:57 +0100 Subject: [PATCH] Qa/checkstyle (#76) * qa corerendering, shorten lines. * qa corerendering, declaration order, no * import. * qa corerendering, - unused imports. * qa corerendering, whitespace after comma. * qa corerendering, constant upper case, intellij suggestion of final vars. * qa corerendering, javadoc contains deprecated flag. * qa corerendering, - unused logger. * chore: remove unused imports --------- Co-authored-by: jdrueckert --- .../rendering/CoreRenderingModule.java | 80 ++++++++++++++----- .../dag/nodes/AmbientOcclusionNode.java | 6 +- .../rendering/dag/nodes/BackdropNode.java | 7 +- .../dag/nodes/BufferClearingNode.java | 4 +- .../dag/nodes/DeferredMainLightNode.java | 15 ++-- .../dag/nodes/DeferredPointLightsNode.java | 20 +++-- .../dag/nodes/FinalPostProcessingNode.java | 39 +++++---- .../rendering/dag/nodes/OutlineNode.java | 3 +- .../dag/nodes/OutputToScreenNode.java | 6 +- .../dag/nodes/PrePostCompositeNode.java | 45 +++++++---- .../rendering/dag/nodes/ShadowMapNode.java | 10 ++- .../dag/nodes/SimpleBlendMaterialsNode.java | 2 - .../rendering/dag/nodes/ToneMappingNode.java | 3 +- .../dag/nodes/UpdateExposureNode.java | 4 - .../dag/nodes/WorldReflectionNode.java | 1 - 15 files changed, 160 insertions(+), 85 deletions(-) diff --git a/src/main/java/org/terasology/corerendering/rendering/CoreRenderingModule.java b/src/main/java/org/terasology/corerendering/rendering/CoreRenderingModule.java index 562037f..f4a541a 100644 --- a/src/main/java/org/terasology/corerendering/rendering/CoreRenderingModule.java +++ b/src/main/java/org/terasology/corerendering/rendering/CoreRenderingModule.java @@ -2,7 +2,29 @@ // SPDX-License-Identifier: Apache-2.0 package org.terasology.corerendering.rendering; -import org.terasology.corerendering.rendering.dag.nodes.*; +import org.terasology.corerendering.rendering.dag.nodes.AlphaRejectBlocksNode; +import org.terasology.corerendering.rendering.dag.nodes.ApplyDeferredLightingNode; +import org.terasology.corerendering.rendering.dag.nodes.BackdropNode; +import org.terasology.corerendering.rendering.dag.nodes.BackdropReflectionNode; +import org.terasology.corerendering.rendering.dag.nodes.BufferClearingNode; +import org.terasology.corerendering.rendering.dag.nodes.DeferredMainLightNode; +import org.terasology.corerendering.rendering.dag.nodes.DeferredPointLightsNode; +import org.terasology.corerendering.rendering.dag.nodes.DownSamplerForExposureNode; +import org.terasology.corerendering.rendering.dag.nodes.FinalPostProcessingNode; +import org.terasology.corerendering.rendering.dag.nodes.InitialPostProcessingNode; +import org.terasology.corerendering.rendering.dag.nodes.LateBlurNode; +import org.terasology.corerendering.rendering.dag.nodes.OpaqueBlocksNode; +import org.terasology.corerendering.rendering.dag.nodes.OpaqueObjectsNode; +import org.terasology.corerendering.rendering.dag.nodes.OutlineNode; +import org.terasology.corerendering.rendering.dag.nodes.OutputToScreenNode; +import org.terasology.corerendering.rendering.dag.nodes.OverlaysNode; +import org.terasology.corerendering.rendering.dag.nodes.PrePostCompositeNode; +import org.terasology.corerendering.rendering.dag.nodes.RefractiveReflectiveBlocksNode; +import org.terasology.corerendering.rendering.dag.nodes.ShadowMapNode; +import org.terasology.corerendering.rendering.dag.nodes.SimpleBlendMaterialsNode; +import org.terasology.corerendering.rendering.dag.nodes.ToneMappingNode; +import org.terasology.corerendering.rendering.dag.nodes.UpdateExposureNode; +import org.terasology.corerendering.rendering.dag.nodes.WorldReflectionNode; import org.terasology.engine.context.Context; import org.terasology.engine.core.subsystem.DisplayDevice; import org.terasology.engine.rendering.cameras.Camera; @@ -34,6 +56,8 @@ public class CoreRenderingModule extends ModuleRendering { + private static int initializationPriority = 1; + private DisplayResolutionDependentFbo displayResolutionDependentFbo; private ShadowMapResolutionDependentFbo shadowMapResolutionDependentFbo; private ImmutableFbo immutableFbo; @@ -41,8 +65,6 @@ public class CoreRenderingModule extends ModuleRendering { private ShadowMapNode shadowMapNode; private DisplayDevice displayDevice; - private static int initializationPriority = 1; - // Created in renderingModuleRegistry trough reflection and Constructor calling public CoreRenderingModule(Context context) { super(context); @@ -103,7 +125,8 @@ private void addGBufferClearingNodes(RenderGraph renderGraph) { // FULL_SCALE, FBO.Type.HDR, fullScale); BufferPair gBufferPair = new BufferPair(legacyGBuffers.getLastUpdatedFbo(), legacyGBuffers.getStaleFbo()); - BufferClearingNode lastUpdatedGBufferClearingNode = new BufferClearingNode("lastUpdatedGBufferClearingNode", context, providingModule, + BufferClearingNode lastUpdatedGBufferClearingNode = new BufferClearingNode( + "lastUpdatedGBufferClearingNode", context, providingModule, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); lastUpdatedGBufferClearingNode.addInputFboConnection(1, gBufferPair.getPrimaryFbo()); lastUpdatedGBufferClearingNode.addOutputBufferPairConnection(1, gBufferPair); @@ -123,7 +146,8 @@ private void addSkyNodes(RenderGraph renderGraph) { // don't make them output buffer pair when they only clear 1 of the buffers. Prone to error Node backdropNode = new BackdropNode("backdropNode", providingModule, context); renderGraph.connectBufferPair(lastUpdatedGBufferClearingNode, 1, backdropNode, 1); - ((AbstractNode) backdropNode).addOutputBufferPairConnection(1, lastUpdatedGBufferClearingNode.getOutputBufferPairConnection(1).getBufferPair()); + ((AbstractNode) backdropNode).addOutputBufferPairConnection( + 1, lastUpdatedGBufferClearingNode.getOutputBufferPairConnection(1).getBufferPair()); renderGraph.addNode(backdropNode); //renderGraph.connect(lastUpdatedGBufferClearingNode, backdropNode); @@ -198,8 +222,10 @@ private void add3dDecorationNodes(RenderGraph renderGraph) { private void addReflectionAndRefractionNodes(RenderGraph renderGraph) { Node applyDeferredLightingNode = renderGraph.findNode("CoreRendering:applyDeferredLightingNode"); - FboConfig reflectedBufferConfig = new FboConfig(BackdropReflectionNode.REFLECTED_FBO_URI, HALF_SCALE, FBO.Type.DEFAULT).useDepthBuffer(); - BufferClearingNode reflectedBufferClearingNode = new BufferClearingNode("reflectedBufferClearingNode", providingModule, context, reflectedBufferConfig, + FboConfig reflectedBufferConfig = + new FboConfig(BackdropReflectionNode.REFLECTED_FBO_URI, HALF_SCALE, FBO.Type.DEFAULT).useDepthBuffer(); + BufferClearingNode reflectedBufferClearingNode = new BufferClearingNode( + "reflectedBufferClearingNode", providingModule, context, reflectedBufferConfig, displayResolutionDependentFbo, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderGraph.addNode(reflectedBufferClearingNode); @@ -211,12 +237,16 @@ private void addReflectionAndRefractionNodes(RenderGraph renderGraph) { renderGraph.connectFbo(reflectedBackdropNode, 1, worldReflectionNode, 1); renderGraph.addNode(worldReflectionNode); - FboConfig reflectedRefractedBufferConfig = new FboConfig(RefractiveReflectiveBlocksNode.REFRACTIVE_REFLECTIVE_FBO_URI, FULL_SCALE, FBO.Type.HDR).useNormalBuffer(); - BufferClearingNode reflectedRefractedBufferClearingNode = new BufferClearingNode("reflectedRefractedBufferClearingNode", providingModule, - context, reflectedRefractedBufferConfig, displayResolutionDependentFbo, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + FboConfig reflectedRefractedBufferConfig = new FboConfig( + RefractiveReflectiveBlocksNode.REFRACTIVE_REFLECTIVE_FBO_URI, FULL_SCALE, FBO.Type.HDR).useNormalBuffer(); + BufferClearingNode reflectedRefractedBufferClearingNode = new BufferClearingNode( + "reflectedRefractedBufferClearingNode", providingModule, + context, reflectedRefractedBufferConfig, displayResolutionDependentFbo, + GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderGraph.addNode(reflectedRefractedBufferClearingNode); - Node chunksRefractiveReflectiveNode = new RefractiveReflectiveBlocksNode("chunksRefractiveReflectiveNode", providingModule, context); + Node chunksRefractiveReflectiveNode = new RefractiveReflectiveBlocksNode( + "chunksRefractiveReflectiveNode", providingModule, context); renderGraph.connectBufferPair(applyDeferredLightingNode, 1, chunksRefractiveReflectiveNode, 1); renderGraph.connectFbo(reflectedRefractedBufferClearingNode, 1, chunksRefractiveReflectiveNode, 1); renderGraph.connectFbo(worldReflectionNode, 1, chunksRefractiveReflectiveNode, 2); @@ -266,30 +296,37 @@ private void addBloomNodes(RenderGraph renderGraph) { } private void addExposureNodes(RenderGraph renderGraph) { - SimpleBlendMaterialsNode simpleBlendMaterialsNode = (SimpleBlendMaterialsNode) renderGraph.findNode("CoreRendering:simpleBlendMaterialsNode"); - // FboConfig gBuffer2Config = displayResolutionDependentFbo.getFboConfig(new SimpleUri("CoreRendering:fbo.gBuffer2")); // TODO: Remove the hard coded value here - DownSamplerForExposureNode exposureDownSamplerTo16pixels = new DownSamplerForExposureNode("exposureDownSamplerTo16pixels", providingModule, + SimpleBlendMaterialsNode simpleBlendMaterialsNode = + (SimpleBlendMaterialsNode) renderGraph.findNode("CoreRendering:simpleBlendMaterialsNode"); + // TODO: Remove the hard coded value here + // FboConfig gBuffer2Config = displayResolutionDependentFbo.getFboConfig(new SimpleUri("CoreRendering:fbo.gBuffer2")); + DownSamplerForExposureNode exposureDownSamplerTo16pixels = + new DownSamplerForExposureNode("exposureDownSamplerTo16pixels", providingModule, context, displayResolutionDependentFbo, FBO_16X16_CONFIG, immutableFbo); renderGraph.connectFbo(simpleBlendMaterialsNode, 1, exposureDownSamplerTo16pixels, 1); renderGraph.addNode(exposureDownSamplerTo16pixels); - DownSamplerForExposureNode exposureDownSamplerTo8pixels = new DownSamplerForExposureNode("exposureDownSamplerTo8pixels", providingModule, context, + DownSamplerForExposureNode exposureDownSamplerTo8pixels = + new DownSamplerForExposureNode("exposureDownSamplerTo8pixels", providingModule, context, immutableFbo, FBO_8X8_CONFIG, immutableFbo); renderGraph.connectFbo(exposureDownSamplerTo16pixels, 1, exposureDownSamplerTo8pixels, 1); renderGraph.addNode(exposureDownSamplerTo8pixels); - DownSamplerForExposureNode exposureDownSamplerTo4pixels = new DownSamplerForExposureNode("exposureDownSamplerTo4pixels", providingModule, context, + DownSamplerForExposureNode exposureDownSamplerTo4pixels = + new DownSamplerForExposureNode("exposureDownSamplerTo4pixels", providingModule, context, immutableFbo, FBO_4X4_CONFIG, immutableFbo); renderGraph.connectFbo(exposureDownSamplerTo8pixels, 1, exposureDownSamplerTo4pixels, 1); renderGraph.addNode(exposureDownSamplerTo4pixels); - DownSamplerForExposureNode exposureDownSamplerTo2pixels = new DownSamplerForExposureNode("exposureDownSamplerTo2pixels", providingModule, context, + DownSamplerForExposureNode exposureDownSamplerTo2pixels = + new DownSamplerForExposureNode("exposureDownSamplerTo2pixels", providingModule, context, immutableFbo, FBO_2X2_CONFIG, immutableFbo); renderGraph.connectFbo(exposureDownSamplerTo4pixels, 1, exposureDownSamplerTo2pixels, 1); renderGraph.addNode(exposureDownSamplerTo2pixels); - DownSamplerForExposureNode exposureDownSamplerTo1pixel = new DownSamplerForExposureNode("exposureDownSamplerTo1pixel", providingModule, context, + DownSamplerForExposureNode exposureDownSamplerTo1pixel = + new DownSamplerForExposureNode("exposureDownSamplerTo1pixel", providingModule, context, immutableFbo, FBO_1X1_CONFIG, immutableFbo); renderGraph.connectFbo(exposureDownSamplerTo2pixels, 1, exposureDownSamplerTo1pixel, 1); renderGraph.addNode(exposureDownSamplerTo1pixel); @@ -339,10 +376,11 @@ private void addFinalPostProcessingNodes(RenderGraph renderGraph) { renderGraph.connectFbo(firstLateBlurNode, 1, secondLateBlurNode, 1); renderGraph.addNode(secondLateBlurNode); - FinalPostProcessingNode finalPostProcessingNode = new FinalPostProcessingNode("finalPostProcessingNode", providingModule, context/*finalIn1*/); + FinalPostProcessingNode finalPostProcessingNode = + new FinalPostProcessingNode("finalPostProcessingNode", providingModule, context/*finalIn1*/); renderGraph.connectBufferPair(initialPostProcessingNode, 1, finalPostProcessingNode, 1); - renderGraph.connectFbo(toneMappingNode,1, finalPostProcessingNode, 1); - renderGraph.connectFbo(secondLateBlurNode, 1, finalPostProcessingNode,2); + renderGraph.connectFbo(toneMappingNode, 1, finalPostProcessingNode, 1); + renderGraph.connectFbo(secondLateBlurNode, 1, finalPostProcessingNode, 2); renderGraph.addNode(finalPostProcessingNode); // renderGraph.connect(toneMappingNode, firstLateBlurNode, secondLateBlurNode); diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/AmbientOcclusionNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/AmbientOcclusionNode.java index 9d01451..814086e 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/AmbientOcclusionNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/AmbientOcclusionNode.java @@ -124,8 +124,10 @@ public void setDependencies(Context context) { addOutputBufferPairConnection(1, bufferPairConnection); int texId = 0; - addDesiredStateChange(new SetInputTextureFromFbo(texId++, lastUpdatedGBuffer, DepthStencilTexture, displayResolutionDependentFBOs, SSAO_MATERIAL_URN, "texDepth")); - addDesiredStateChange(new SetInputTextureFromFbo(texId++, lastUpdatedGBuffer, NormalsTexture, displayResolutionDependentFBOs, SSAO_MATERIAL_URN, "texNormals")); + addDesiredStateChange(new SetInputTextureFromFbo(texId++, lastUpdatedGBuffer, DepthStencilTexture, displayResolutionDependentFBOs, + SSAO_MATERIAL_URN, "texDepth")); + addDesiredStateChange(new SetInputTextureFromFbo(texId++, lastUpdatedGBuffer, NormalsTexture, displayResolutionDependentFBOs, + SSAO_MATERIAL_URN, "texNormals")); addDesiredStateChange(new SetInputTexture2D(texId, generateNoiseTexture().getId(), SSAO_MATERIAL_URN, "texNoise")); if (ssaoSamples == null) { diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/BackdropNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/BackdropNode.java index ca93b20..12bcb4a 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/BackdropNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/BackdropNode.java @@ -49,6 +49,8 @@ public class BackdropNode extends AbstractNode implements WireframeCapable { private static final int STACKS = 128; private static final int RADIUS = 1024; + SphereBuilder builder = new SphereBuilder(); + private WorldRenderer worldRenderer; private BackdropProvider backdropProvider; @@ -75,8 +77,6 @@ public class BackdropNode extends AbstractNode implements WireframeCapable { private float turbidity; private final Mesh sphereMesh; - SphereBuilder builder = new SphereBuilder(); - public BackdropNode(String nodeUri, Name providingModule, Context context) { super(nodeUri, providingModule, context); @@ -160,7 +160,8 @@ public void process() { // Shader Parameters - skyMaterial.setFloat3("zenith", getAllWeatherZenith(backdropProvider.getSunDirection(false).y, turbidity), true); + skyMaterial.setFloat3("zenith", getAllWeatherZenith(backdropProvider.getSunDirection(false).y, turbidity), + true); skyMaterial.setFloat("turbidity", turbidity, true); skyMaterial.setFloat("colorExp", backdropProvider.getColorExp(), true); skyMaterial.setFloat4("skySettings", sunExponent, moonExponent, skyDaylightBrightness, skyNightBrightness, true); diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/BufferClearingNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/BufferClearingNode.java index 8423588..e972bad 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/BufferClearingNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/BufferClearingNode.java @@ -23,6 +23,7 @@ public class BufferClearingNode extends AbstractNode { private int clearingMask; private FBO fbo; /** + * @deprecated * Constructs the node by requesting the creation (if necessary) of the FBO to be cleared * and by requesting for this FBO to be bound by the time process() gets executed. Also * stores the clearing mask, for use in process(). @@ -34,7 +35,8 @@ public class BufferClearingNode extends AbstractNode { * Non GL_*_BIT values will be accepted but might eventually generate an opengl error. * @throws IllegalArgumentException if fboConfig, fboManager are null and if clearingMask is zero. */@Deprecated - public BufferClearingNode(String nodeUri, Name providingModule, Context context, FboConfig fboConfig, BaseFboManager fboManager, int clearingMask) { + public BufferClearingNode(String nodeUri, Name providingModule, Context context, FboConfig fboConfig, BaseFboManager fboManager, + int clearingMask) { super(nodeUri, providingModule, context); boolean argumentsAreValid = validateArguments(fboConfig, fboManager, clearingMask); diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/DeferredMainLightNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/DeferredMainLightNode.java index 17122ee..c20a7af 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/DeferredMainLightNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/DeferredMainLightNode.java @@ -116,14 +116,19 @@ public void setDependencies(Context context) { DisplayResolutionDependentFbo displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFbo.class); int textureSlot = 0; - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, DepthStencilTexture, displayResolutionDependentFBOs, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueDepth")); - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, NormalsTexture, displayResolutionDependentFBOs, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueNormals")); - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, LightAccumulationTexture, displayResolutionDependentFBOs, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueLightBuffer")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, DepthStencilTexture, + displayResolutionDependentFBOs, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueDepth")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, NormalsTexture, + displayResolutionDependentFBOs, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueNormals")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, LightAccumulationTexture, + displayResolutionDependentFBOs, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueLightBuffer")); if (renderingConfig.isDynamicShadows()) { - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, getInputFboData(1), DepthStencilTexture, shadowMapResolutionDependentFBOs, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneShadowMap")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, getInputFboData(1), DepthStencilTexture, + shadowMapResolutionDependentFBOs, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneShadowMap")); if (renderingConfig.isCloudShadows()) { - addDesiredStateChange(new SetInputTexture2D(textureSlot, "engine:perlinNoiseTileable", LIGHT_GEOMETRY_MATERIAL_URN, "texSceneClouds")); + addDesiredStateChange(new SetInputTexture2D(textureSlot, "engine:perlinNoiseTileable", + LIGHT_GEOMETRY_MATERIAL_URN, "texSceneClouds")); } } } 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 7b5b895..9e55ac0 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 @@ -111,8 +111,10 @@ public void setDependencies(Context context) { DisplayResolutionDependentFbo displayResolutionDependentFbo = context.get(DisplayResolutionDependentFbo.class); int textureSlot = 0; - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, DepthStencilTexture, displayResolutionDependentFbo, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueDepth")); - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, lastUpdatedGBuffer, NormalsTexture, displayResolutionDependentFbo, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueNormals")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, DepthStencilTexture, + displayResolutionDependentFbo, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueDepth")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, lastUpdatedGBuffer, NormalsTexture, + displayResolutionDependentFbo, LIGHT_GEOMETRY_MATERIAL_URN, "texSceneOpaqueNormals")); } private boolean lightIsRenderable(LightComponent lightComponent, Vector3f lightPositionRelativeToCamera) { @@ -169,7 +171,8 @@ public void process() { lightGeometryMaterial.setMatrix4("invViewProjMatrix", activeCamera.getInverseViewProjectionMatrix(), true); cameraPosition.sub(lightCamera.getPosition(), activeCameraToLightSpace); - lightGeometryMaterial.setFloat3("activeCameraToLightSpace", activeCameraToLightSpace.x, activeCameraToLightSpace.y, activeCameraToLightSpace.z, true); + lightGeometryMaterial.setFloat3("activeCameraToLightSpace", activeCameraToLightSpace.x, activeCameraToLightSpace.y, + activeCameraToLightSpace.z, true); } // Actual Node Processing @@ -182,7 +185,7 @@ public void process() { final Vector3f lightPositionInTeraCoords = locationComponent.getWorldPosition(new Vector3f()); Vector3f lightPositionRelativeToCamera = new Vector3f(); - lightPositionInTeraCoords.sub(activeCamera.getPosition(),lightPositionRelativeToCamera); + lightPositionInTeraCoords.sub(activeCamera.getPosition(), lightPositionRelativeToCamera); if (lightIsRenderable(lightComponent, lightPositionRelativeToCamera)) { lightGeometryMaterial.setCamera(activeCamera); @@ -200,12 +203,15 @@ public void process() { // setting shader parameters for the light position in camera space Vector3f lightPositionInViewSpace = new Vector3f(lightPositionRelativeToCamera).mulPosition(activeCamera.getViewMatrix()); - lightGeometryMaterial.setFloat3("lightViewPos", lightPositionInViewSpace.x, lightPositionInViewSpace.y, lightPositionInViewSpace.z, true); + lightGeometryMaterial.setFloat3("lightViewPos", lightPositionInViewSpace.x, lightPositionInViewSpace.y, + lightPositionInViewSpace.z, true); // set the size and location of the sphere to be rendered via shader parameters Matrix4f modelMatrix = new Matrix4f(); - modelMatrix.scale(lightComponent.lightAttenuationRange); // scales the modelview matrix, effectively scales the light sphere - modelMatrix.setTranslation(lightPositionRelativeToCamera); // effectively moves the light sphere in the right position relative to camera + // scales the modelview matrix, effectively scales the light sphere + modelMatrix.scale(lightComponent.lightAttenuationRange); + // effectively moves the light sphere in the right position relative to camera + modelMatrix.setTranslation(lightPositionRelativeToCamera); lightGeometryMaterial.setMatrix4("modelMatrix", modelMatrix, true); unitSphereMesh.render(); 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 7c8389c..776c7f8 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 @@ -45,7 +45,7 @@ * An instance of this class adds depth of field blur, motion blur and film grain to the rendering * of the scene obtained so far. Furthermore, depending if a screenshot has been requested, * it instructs the ScreenGrabber to save it to a file. - * + *

* If RenderingDebugConfig.isEnabled() returns true, this node is instead responsible for displaying * the content of a number of technical buffers rather than the final, post-processed rendering * of the scene. @@ -53,18 +53,18 @@ 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 static final int NOISE_TEXTURE_SIZE = 1024; - private WorldRenderer worldRenderer; - private RenderingConfig renderingConfig; - private ScreenGrabber screenGrabber; + private final WorldRenderer worldRenderer; + private final RenderingConfig renderingConfig; + private final ScreenGrabber screenGrabber; - private Material postMaterial; + private final Material postMaterial; - private Random randomGenerator = new FastRandom(); + private final Random randomGenerator = new FastRandom(); - private CameraTargetSystem cameraTargetSystem; - private Camera activeCamera; + private final CameraTargetSystem cameraTargetSystem; + private final Camera activeCamera; @SuppressWarnings("FieldCanBeLocal") @Range(min = 0.0f, max = 1.0f) @@ -75,9 +75,9 @@ public class FinalPostProcessingNode extends AbstractNode implements PropertyCha private StateChange setBlurTexture; private StateChange setNoiseTexture; private StateChange setVignetteInputTexture; - private Mesh renderQuad; + private final Mesh renderQuad; - private Vector3f tint = new Vector3f(.0f, .0f, .0f); + private final Vector3f tint = new Vector3f(.0f, .0f, .0f); public FinalPostProcessingNode(String nodeUri, Name providingModule, Context context) { @@ -116,13 +116,18 @@ public void setDependencies(Context context) { addOutputBufferPairConnection(1, bufferPairConnection); int texId = 0; - addDesiredStateChange(new SetInputTextureFromFbo(texId++, this.getInputFboData(1), ColorTexture, displayResolutionDependentFbo, POST_MATERIAL_URN, "texScene")); - addDesiredStateChange(new SetInputTextureFromFbo(texId++, lastUpdatedGBuffer, DepthStencilTexture, displayResolutionDependentFbo, POST_MATERIAL_URN, "texDepth")); - setBlurTexture = new SetInputTextureFromFbo(texId++, this.getInputFboData(2), ColorTexture, displayResolutionDependentFbo, POST_MATERIAL_URN, "texBlur"); - addDesiredStateChange(new SetInputTexture3D(texId++, "engine:colorGradingLut1", POST_MATERIAL_URN, "texColorGradingLut")); + addDesiredStateChange(new SetInputTextureFromFbo(texId++, this.getInputFboData(1), ColorTexture, + displayResolutionDependentFbo, POST_MATERIAL_URN, "texScene")); + addDesiredStateChange(new SetInputTextureFromFbo(texId++, lastUpdatedGBuffer, DepthStencilTexture, + displayResolutionDependentFbo, POST_MATERIAL_URN, "texDepth")); + setBlurTexture = new SetInputTextureFromFbo(texId++, this.getInputFboData(2), ColorTexture, + displayResolutionDependentFbo, POST_MATERIAL_URN, "texBlur"); + addDesiredStateChange(new SetInputTexture3D(texId++, "engine:colorGradingLut1", POST_MATERIAL_URN, + "texColorGradingLut")); // TODO: evaluate the possibility to use GPU-based noise algorithms instead of CPU-generated textures. - setNoiseTexture = new SetInputTexture2D(texId++, TextureUtil.getTextureUriForWhiteNoise(noiseTextureSize, 0x1234, 0, 512).toString(), POST_MATERIAL_URN, "texNoise"); + setNoiseTexture = new SetInputTexture2D(texId++, TextureUtil.getTextureUriForWhiteNoise(NOISE_TEXTURE_SIZE, + 0x1234, 0, 512).toString(), POST_MATERIAL_URN, "texNoise"); setVignetteInputTexture = new SetInputTexture2D(texId++, "engine:vignette", POST_MATERIAL_URN, "texVignette"); @@ -154,7 +159,7 @@ public void process() { postMaterial.setFloat("grainIntensity", filmGrainIntensity, true); postMaterial.setFloat("noiseOffset", randomGenerator.nextFloat(), true); - postMaterial.setFloat2("noiseSize", noiseTextureSize, noiseTextureSize, true); + postMaterial.setFloat2("noiseSize", NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE, true); postMaterial.setFloat2("renderTargetSize", lastUpdatedGBuffer.width(), lastUpdatedGBuffer.height(), true); } diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/OutlineNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/OutlineNode.java index fd733ad..9ee9ed1 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/OutlineNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/OutlineNode.java @@ -85,7 +85,8 @@ public void setDependencies(Context context) { outlineMaterial = getMaterial(OUTLINE_MATERIAL_URN); int textureSlot = 0; - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, lastUpdatedGBuffer, DepthStencilTexture, displayResolutionDependentFBOs, OUTLINE_MATERIAL_URN, "texDepth")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, lastUpdatedGBuffer, DepthStencilTexture, + displayResolutionDependentFBOs, OUTLINE_MATERIAL_URN, "texDepth")); } /** diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/OutputToScreenNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/OutputToScreenNode.java index 58204e6..bb96c78 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/OutputToScreenNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/OutputToScreenNode.java @@ -48,7 +48,8 @@ public OutputToScreenNode(String nodeUri, Name providingModule, Context context) @Override public void setDependencies(Context context) { addDesiredStateChange(new EnableMaterial(OUTPUT_TEXTURED_MATERIAL_URN)); - bindFbo = new SetInputTextureFromFbo(0, this.getInputFboData(1), ColorTexture, displayResolutionDependentFBOs, OUTPUT_TEXTURED_MATERIAL_URN, "target"); + bindFbo = new SetInputTextureFromFbo(0, this.getInputFboData(1), ColorTexture, displayResolutionDependentFBOs, + OUTPUT_TEXTURED_MATERIAL_URN, "target"); addDesiredStateChange(bindFbo); lastUpdatedGBuffer = getInputBufferPairConnection(1).getBufferPair().getPrimaryFbo(); @@ -102,7 +103,8 @@ public void handleCommand(String command, String... arguments) { private void setFbo(FBO fbo) { removeDesiredStateChange(bindFbo); - bindFbo = new SetInputTextureFromFbo(0, fbo, ColorTexture, displayResolutionDependentFBOs, OUTPUT_TEXTURED_MATERIAL_URN, "target"); + bindFbo = new SetInputTextureFromFbo(0, fbo, ColorTexture, displayResolutionDependentFBOs, OUTPUT_TEXTURED_MATERIAL_URN, + "target"); addDesiredStateChange(bindFbo); worldRenderer.requestTaskListRefresh(); } diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/PrePostCompositeNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/PrePostCompositeNode.java index 9ea49db..94c8f92 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/PrePostCompositeNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/PrePostCompositeNode.java @@ -141,25 +141,38 @@ public void setDependencies(Context context) { displayResolutionDependentFbo = context.get(DisplayResolutionDependentFbo.class); textureSlot = 0; - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneOpaque")); - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, DepthStencilTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneOpaqueDepth")); - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, NormalsTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneOpaqueNormals")); - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, LightAccumulationTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneOpaqueLightBuffer")); - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, getInputFboData(4), ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneReflectiveRefractive")); - setReflectiveRefractiveNormalsInputTexture = new SetInputTextureFromFbo(textureSlot++, getInputFboData(4), NormalsTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneReflectiveRefractiveNormals"); - - setEdgesInputTexture = new SetInputTextureFromFbo(textureSlot++, getInputFboData(2), ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texEdges"); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, + ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneOpaque")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, + DepthStencilTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, + "texSceneOpaqueDepth")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, + NormalsTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneOpaqueNormals")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, + LightAccumulationTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, + "texSceneOpaqueLightBuffer")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, getInputFboData(4), + ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, + "texSceneReflectiveRefractive")); + setReflectiveRefractiveNormalsInputTexture = new SetInputTextureFromFbo(textureSlot++, getInputFboData(4), + NormalsTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, + "texSceneReflectiveRefractiveNormals"); + + setEdgesInputTexture = new SetInputTextureFromFbo(textureSlot++, getInputFboData(2), + ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texEdges"); if (localReflectionsAreEnabled) { - // setReflectiveRefractiveNormalsInputTexture = new SetInputTextureFromFbo(textureSlot++, getInputFboData(4), NormalsTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneReflectiveRefractiveNormals"); + // setReflectiveRefractiveNormalsInputTexture = new SetInputTextureFromFbo(textureSlot++, getInputFboData(4), + // NormalsTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneReflectiveRefractiveNormals"); addDesiredStateChange(setReflectiveRefractiveNormalsInputTexture); } if (ssaoIsEnabled) { if (texSsaoSlot < 0) { texSsaoSlot = textureSlot++; } - setSsaoInputTexture = new SetInputTextureFromFbo(texSsaoSlot, getInputFboData(1), ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSsao"); + setSsaoInputTexture = new SetInputTextureFromFbo(texSsaoSlot, getInputFboData(1), + ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSsao"); addDesiredStateChange(setSsaoInputTexture); } if (outlineIsEnabled) { @@ -169,7 +182,8 @@ public void setDependencies(Context context) { if (texHazeSlot < 0) { texHazeSlot = textureSlot++; } - setHazeInputTexture = new SetInputTextureFromFbo(texHazeSlot, getInputFboData(3), ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneSkyBand"); + setHazeInputTexture = new SetInputTextureFromFbo(texHazeSlot, getInputFboData(3), + ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneSkyBand"); addDesiredStateChange(setHazeInputTexture); } } @@ -199,7 +213,8 @@ public void process() { if (volumetricFogIsEnabled) { prePostMaterial.setMatrix4("invViewProjMatrix", activeCamera.getInverseViewProjectionMatrix(), true); - prePostMaterial.setFloat3("volumetricFogSettings", 1f, volumetricFogGlobalDensity, volumetricFogHeightFalloff, true); + prePostMaterial.setFloat3("volumetricFogSettings", 1f, volumetricFogGlobalDensity, volumetricFogHeightFalloff, + true); } if (hazeIsEnabled) { @@ -235,7 +250,8 @@ public void propertyChange(PropertyChangeEvent event) { if (texSsaoSlot < 0) { texSsaoSlot = textureSlot++; } - setSsaoInputTexture = new SetInputTextureFromFbo(texSsaoSlot, getInputFboData(1), ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSsao"); + setSsaoInputTexture = new SetInputTextureFromFbo(texSsaoSlot, getInputFboData(1), + ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSsao"); addDesiredStateChange(setSsaoInputTexture); } else { removeDesiredStateChange(setSsaoInputTexture); @@ -258,7 +274,8 @@ public void propertyChange(PropertyChangeEvent event) { if (texHazeSlot < 0) { texHazeSlot = textureSlot++; } - setHazeInputTexture = new SetInputTextureFromFbo(texHazeSlot, getInputFboData(3), ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneSkyBand"); + setHazeInputTexture = new SetInputTextureFromFbo(texHazeSlot, getInputFboData(3), + ColorTexture, displayResolutionDependentFbo, PRE_POST_MATERIAL_URN, "texSceneSkyBand"); addDesiredStateChange(setHazeInputTexture); } else { removeDesiredStateChange(setHazeInputTexture); diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/ShadowMapNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/ShadowMapNode.java index 54b4d03..1f1057e 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/ShadowMapNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/ShadowMapNode.java @@ -51,10 +51,11 @@ public class ShadowMapNode extends ConditionDependentNode implements PropertyCha public static final SimpleUri SHADOW_MAP_FBO_URI = new SimpleUri("engine:fbo.sceneShadowMap"); private static final ResourceUrn SHADOW_MAP_MATERIAL_URN = new ResourceUrn("CoreRendering:shadowMap"); private static final int SHADOW_FRUSTUM_BOUNDS = 200; - private Material shadowMapMaterial; private static final float STEP_SIZE = 50f; + private Material shadowMapMaterial; - public Camera shadowMapCamera = new OrthographicCamera(-SHADOW_FRUSTUM_BOUNDS, SHADOW_FRUSTUM_BOUNDS, SHADOW_FRUSTUM_BOUNDS, -SHADOW_FRUSTUM_BOUNDS); + public Camera shadowMapCamera = new OrthographicCamera(-SHADOW_FRUSTUM_BOUNDS, SHADOW_FRUSTUM_BOUNDS, SHADOW_FRUSTUM_BOUNDS, + -SHADOW_FRUSTUM_BOUNDS); private BackdropProvider backdropProvider; private RenderingConfig renderingConfig; @@ -149,7 +150,7 @@ public void process() { GL30.glViewport(0, 0, renderingConfig.getShadowMapResolution(), renderingConfig.getShadowMapResolution()); GL30.glEnable(GL30.GL_POLYGON_OFFSET_FILL); - GL30.glPolygonOffset(0,1); + GL30.glPolygonOffset(0, 1); // TODO: remove this IF statement when VR is handled via parallel nodes, one per eye. if (worldRenderer.isFirstRenderingStageForCurrentFrame()) { @@ -213,7 +214,8 @@ private void positionShadowMapCamera() { // The shadow projected onto the ground must move in in light-space texel-steps, to avoid causing flickering. // That's why we first convert it to the previous frame's light-space coordinates and then back to world-space. shadowMapCamera.getViewProjectionMatrix().transformPosition(mainLightPosition); // to light-space - mainLightPosition.set(Math.floor(mainLightPosition.x / texelSize) * texelSize, 0.0f,Math.floor(mainLightPosition.z / texelSize) * texelSize); + mainLightPosition.set(Math.floor(mainLightPosition.x / texelSize) * texelSize, 0.0f, + Math.floor(mainLightPosition.z / texelSize) * texelSize); shadowMapCamera.getInverseViewProjectionMatrix().transformPosition(mainLightPosition); // back to world-space shadowMapCamera.getPosition().set(mainLightPosition); shadowMapCamera.updateMatrices(); 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 dcf17c2..be090b6 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 @@ -7,14 +7,12 @@ import org.terasology.engine.entitySystem.systems.RenderSystem; import org.terasology.engine.monitoring.PerformanceMonitor; import org.terasology.gestalt.naming.Name; -import org.terasology.engine.rendering.cameras.Camera; import org.terasology.engine.rendering.dag.AbstractNode; import org.terasology.engine.rendering.dag.dependencyConnections.BufferPairConnection; import org.terasology.engine.rendering.dag.stateChanges.BindFbo; import org.terasology.engine.rendering.dag.stateChanges.DisableDepthWriting; import org.terasology.engine.rendering.dag.stateChanges.EnableBlending; import org.terasology.engine.rendering.dag.stateChanges.SetBlendFunction; -import org.terasology.engine.rendering.world.WorldRenderer; import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA; import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA; diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/ToneMappingNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/ToneMappingNode.java index 216297e..aa1999d 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/ToneMappingNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/ToneMappingNode.java @@ -78,7 +78,8 @@ public void setDependencies(Context context) { FBO initialPostProcessingFbo = getInputFboData(1); int textureSlot = 0; - addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, initialPostProcessingFbo, ColorTexture, displayResolutionDependentFboManager, TONE_MAPPING_MATERIAL_URN, "texScene")); + addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, initialPostProcessingFbo, ColorTexture, + displayResolutionDependentFboManager, TONE_MAPPING_MATERIAL_URN, "texScene")); } /** diff --git a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/UpdateExposureNode.java b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/UpdateExposureNode.java index 4092da7..f965a6b 100644 --- a/src/main/java/org/terasology/corerendering/rendering/dag/nodes/UpdateExposureNode.java +++ b/src/main/java/org/terasology/corerendering/rendering/dag/nodes/UpdateExposureNode.java @@ -4,8 +4,6 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.terasology.engine.config.Config; import org.terasology.engine.config.RenderingConfig; import org.terasology.engine.context.Context; @@ -28,8 +26,6 @@ * (1) See https://en.wikipedia.org/wiki/Luma_(video)#Use_of_relative_luminance */ public class UpdateExposureNode extends AbstractNode { - private static final Logger logger = LoggerFactory.getLogger(UpdateExposureNode.class); - @SuppressWarnings("FieldCanBeLocal") @Range(min = 0.0f, max = 10.0f) private float hdrExposureDefault = 5f; 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 fa29bdc..e9f6dcf 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 @@ -23,7 +23,6 @@ import org.terasology.engine.rendering.dag.stateChanges.SetInputTexture2D; import org.terasology.engine.rendering.dag.stateChanges.SetViewportToSizeOf; import org.terasology.engine.rendering.opengl.FBO; -import org.terasology.engine.rendering.opengl.fbms.DisplayResolutionDependentFbo; import org.terasology.engine.rendering.primitives.ChunkMesh; import org.terasology.engine.rendering.world.RenderQueuesHelper; import org.terasology.engine.world.WorldProvider;