From 80af02e1f34ca42a5caee6d3be8e273648ca2f4e Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sun, 21 Feb 2016 21:53:48 -0500 Subject: [PATCH] syntax error fixes --- .../java/com/jme3/material/DefaultTechniqueDefLogic.java | 2 +- jme3-core/src/main/java/com/jme3/material/Material.java | 4 ++-- .../java/com/jme3/material/SinglePassLightingLogic.java | 4 ++-- jme3-core/src/main/java/com/jme3/material/Technique.java | 4 ++-- .../src/main/java/com/jme3/material/TechniqueDefLogic.java | 4 +++- .../src/main/java/com/jme3/renderer/RenderManager.java | 6 +++--- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/material/DefaultTechniqueDefLogic.java b/jme3-core/src/main/java/com/jme3/material/DefaultTechniqueDefLogic.java index 4edc38ee6..fb10e704e 100644 --- a/jme3-core/src/main/java/com/jme3/material/DefaultTechniqueDefLogic.java +++ b/jme3-core/src/main/java/com/jme3/material/DefaultTechniqueDefLogic.java @@ -56,7 +56,7 @@ public class DefaultTechniqueDefLogic implements TechniqueDefLogic { @Override public Shader makeCurrent(AssetManager assetManager, RenderManager renderManager, - EnumSet rendererCaps, DefineList defines) { + EnumSet rendererCaps, LightList lights, DefineList defines) { return techniqueDef.getShader(assetManager, rendererCaps, defines); } diff --git a/jme3-core/src/main/java/com/jme3/material/Material.java b/jme3-core/src/main/java/com/jme3/material/Material.java index 6f04ccef6..3fbbfbb2d 100644 --- a/jme3-core/src/main/java/com/jme3/material/Material.java +++ b/jme3-core/src/main/java/com/jme3/material/Material.java @@ -834,7 +834,7 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { return; } - Shader shader = technique.makeCurrent(renderManager, rendererCaps); + Shader shader = technique.makeCurrent(renderManager, null, rendererCaps); updateShaderMaterialParameters(renderer, shader); renderManager.getRenderer().setShader(shader); } @@ -939,7 +939,7 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { updateRenderState(renderManager, renderer, techniqueDef); // Select shader to use - Shader shader = technique.makeCurrent(renderManager, rendererCaps); + Shader shader = technique.makeCurrent(renderManager, lights, rendererCaps); // Begin tracking which uniforms were changed by material. clearUniformsSetByCurrent(shader); diff --git a/jme3-core/src/main/java/com/jme3/material/SinglePassLightingLogic.java b/jme3-core/src/main/java/com/jme3/material/SinglePassLightingLogic.java index 3f48c7bb0..75de9054d 100644 --- a/jme3-core/src/main/java/com/jme3/material/SinglePassLightingLogic.java +++ b/jme3-core/src/main/java/com/jme3/material/SinglePassLightingLogic.java @@ -76,10 +76,10 @@ public final class SinglePassLightingLogic extends DefaultTechniqueDefLogic { @Override public Shader makeCurrent(AssetManager assetManager, RenderManager renderManager, - EnumSet rendererCaps, DefineList defines) { + EnumSet rendererCaps, LightList lights, DefineList defines) { defines.set(nbLightsDefineId, renderManager.getSinglePassLightBatchSize() * 3); defines.set(singlePassLightingDefineId, true); - return super.makeCurrent(assetManager, renderManager, rendererCaps, defines); + return super.makeCurrent(assetManager, renderManager, rendererCaps, lights, defines); } /** diff --git a/jme3-core/src/main/java/com/jme3/material/Technique.java b/jme3-core/src/main/java/com/jme3/material/Technique.java index b6ab27e2c..a0c3e6f80 100644 --- a/jme3-core/src/main/java/com/jme3/material/Technique.java +++ b/jme3-core/src/main/java/com/jme3/material/Technique.java @@ -131,10 +131,10 @@ public final class Technique { * @param rendererCaps The renderer capabilities which the shader should support. * @return A compatible shader. */ - Shader makeCurrent(RenderManager renderManager, EnumSet rendererCaps) { + Shader makeCurrent(RenderManager renderManager, LightList lights, EnumSet rendererCaps) { TechniqueDefLogic logic = def.getLogic(); AssetManager assetManager = owner.getMaterialDef().getAssetManager(); - return logic.makeCurrent(assetManager, renderManager, rendererCaps, dynamicDefines); + return logic.makeCurrent(assetManager, renderManager, rendererCaps, lights, dynamicDefines); } /** diff --git a/jme3-core/src/main/java/com/jme3/material/TechniqueDefLogic.java b/jme3-core/src/main/java/com/jme3/material/TechniqueDefLogic.java index f7bab2f88..5cf6e8ab0 100644 --- a/jme3-core/src/main/java/com/jme3/material/TechniqueDefLogic.java +++ b/jme3-core/src/main/java/com/jme3/material/TechniqueDefLogic.java @@ -66,6 +66,8 @@ public interface TechniqueDefLogic { * @param renderManager The render manager for which rendering is to be performed. * @param rendererCaps Renderer capabilities. The returned shader must * support these capabilities. + * @param lights The lights with which the geometry shall be rendered. This + * list must not include culled lights. * @param defines The define list used by the technique, any * {@link TechniqueDef#addShaderUnmappedDefine(java.lang.String) unmapped defines} * should be set here to change shader behavior. @@ -73,7 +75,7 @@ public interface TechniqueDefLogic { * @return The shader to use for rendering. */ public Shader makeCurrent(AssetManager assetManager, RenderManager renderManager, - EnumSet rendererCaps, DefineList defines); + EnumSet rendererCaps, LightList lights, DefineList defines); /** * Requests that the TechniqueDefLogic renders the given geometry. diff --git a/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java b/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java index d4e6ff17f..42afc55b4 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java +++ b/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java @@ -49,7 +49,7 @@ import com.jme3.renderer.queue.RenderQueue; import com.jme3.renderer.queue.RenderQueue.Bucket; import com.jme3.renderer.queue.RenderQueue.ShadowMode; import com.jme3.scene.*; -import com.jme3.shader.Uniform; +import com.jme3.shader.Shader; import com.jme3.shader.UniformBinding; import com.jme3.shader.UniformBindingManager; import com.jme3.system.NullRenderer; @@ -483,8 +483,8 @@ public class RenderManager { * Updates the given list of uniforms with {@link UniformBinding uniform bindings} * based on the current world state. */ - public void updateUniformBindings(List params) { - uniformBindingManager.updateUniformBindings(params); + public void updateUniformBindings(Shader shader) { + uniformBindingManager.updateUniformBindings(shader); } /**