/** * Returns a collection of all parameters set on this material. * * @return a collection of all parameters set on this material. * * @see #setParam(java.lang.String, com.jme3.shader.VarType, java.lang.Object) */ public Collection<MatParam> getParams() { return paramValues.values(); }
/** * Usually called when the shader itself changes or during any * time when the variable locations need to be refreshed. */ public void resetLocations() { if (uniforms != null) { // NOTE: Shader sources will be reset separately from the shader itself. for (Uniform uniform : uniforms.values()) { uniform.reset(); // fixes issue with re-initialization } } if (bufferBlocks != null) { for (ShaderBufferBlock shaderBufferBlock : bufferBlocks.values()) { shaderBufferBlock.reset(); } } if (attribs != null) { for (Entry<Attribute> entry : attribs) { entry.getValue().location = ShaderVariable.LOC_UNKNOWN; } } }
private void outUniforms(Uniform... uniforms) { if (!evaluated) { evaluateTechniqueDef(); } HashSet<Uniform> actualUniforms = new HashSet<>(); for (Uniform uniform : usedShader.getUniformMap().values()) { if (uniform.getName().startsWith("m_") && !IGNORED_UNIFORMS.contains(uniform.getName())) { actualUniforms.add(uniform); } } HashSet<Uniform> expectedUniforms = new HashSet<>(Arrays.asList(uniforms)); if (!expectedUniforms.equals(actualUniforms)) { Assert.fail("Uniform lists must match: " + expectedUniforms + " != " + actualUniforms); } } }
/** * Returns a collection of all parameters set on this material. * * @return a collection of all parameters set on this material. * * @see #setParam(java.lang.String, com.jme3.shader.VarType, java.lang.Object) */ public Collection<MatParam> getParams() { return paramValues.values(); }
/** * Returns a collection of all material parameters declared in this * material definition. * <p> * Modifying the material parameters or the collection will lead * to undefined results. * * @return All material parameters declared in this definition. */ public Collection<MatParam> getMaterialParams(){ return matParams.values(); }
/** * Returns a collection of all parameters set on this material. * * @return a collection of all parameters set on this material. * * @see #setParam(java.lang.String, com.jme3.shader.VarType, java.lang.Object) */ public Collection<MatParam> getParams() { return paramValues.values(); }
/** * Usually called when the shader itself changes or during any * time when the var locations need to be refreshed. */ public void resetLocations(){ // NOTE: Shader sources will be reset seperately from the shader itself. for (Uniform uniform : uniforms.values()){ uniform.reset(); // fixes issue with re-initialization } for (Entry<Attribute> entry : attribs){ entry.getValue().location = -2; } }
/** * Usually called when the shader itself changes or during any * time when the variable locations need to be refreshed. */ public void resetLocations() { if (uniforms != null) { // NOTE: Shader sources will be reset separately from the shader itself. for (Uniform uniform : uniforms.values()) { uniform.reset(); // fixes issue with re-initialization } } if (attribs != null) { for (Entry<Attribute> entry : attribs) { entry.getValue().location = ShaderVariable.LOC_UNKNOWN; } } }
private void clearTextureParam(String name) { name = checkSetParam(null, name); MatParamTexture val = getTextureParam(name); if (val == null) { throw new IllegalArgumentException("The given texture for parameter \"" + name + "\" is null."); } int texUnit = val.getUnit(); // paramValues.remove(name); paramValues.put(name, null); nextTexUnit--; for (MatParam param : paramValues.values()) { if (param instanceof MatParamTexture) { MatParamTexture texParam = (MatParamTexture) param; if (texParam.getUnit() > texUnit) { texParam.setUnit(texParam.getUnit() - 1); } } } sortingId = -1; }
int texUnit = ((MatParamTexture) matParam).getUnit(); nextTexUnit--; for (MatParam param : paramValues.values()) { if (param instanceof MatParamTexture) { MatParamTexture texParam = (MatParamTexture) param;
TechniqueDef techDef = technique.getDef(); Collection<MatParam> params = paramValues.values(); for (MatParam param : params) { if (param instanceof MatParamTexture) {