/** * Removes the "set-by-current-material" flag from all uniforms. * When a uniform is modified after this call, the flag shall * become "set-by-current-material". * A call to {@link #resetUniformsNotSetByCurrent() } will reset * all uniforms that do not have the "set-by-current-material" flag * to their default value (usually all zeroes or false). */ public void clearUniformsSetByCurrentFlag() { int size = uniforms.size(); for (int i = 0; i < size; i++) { Uniform u = uniforms.getValue(i); u.clearSetByCurrentMaterial(); } }
private void clearUniformsSetByCurrent(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); int size = uniforms.size(); for (int i = 0; i < size; i++) { Uniform u = uniforms.getValue(i); u.clearSetByCurrentMaterial(); } }
/** * Updates all shader's buffer blocks. * * @param shader the shader. */ protected void updateShaderBufferBlocks(final Shader shader) { final ListMap<String, ShaderBufferBlock> bufferBlocks = shader.getBufferBlockMap(); for (int i = 0; i < bufferBlocks.size(); i++) { updateShaderBufferBlock(shader, bufferBlocks.getValue(i)); } }
protected void resetUniformLocations(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); for (int i = 0; i < uniforms.size(); i++) { Uniform uniform = uniforms.getValue(i); uniform.reset(); // e.g check location again } }
/** * Resets all uniforms that do not have the "set-by-current-material" flag * to their default value (usually all zeroes or false). * When a uniform is modified, that flag is set, to remove the flag, * use {@link #clearUniformsSetByCurrentFlag() }. */ public void resetUniformsNotSetByCurrent() { int size = uniforms.size(); for (int i = 0; i < size; i++) { Uniform u = uniforms.getValue(i); if (!u.isSetByCurrentMaterial()) { u.clearValue(); } } }
protected void updateShaderUniforms(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); for (int i = 0; i < uniforms.size(); i++) { Uniform uniform = uniforms.getValue(i); if (uniform.isUpdateNeeded()) { updateUniform(shader, uniform); } } }
private void resetUniformsNotSetByCurrent(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); int size = uniforms.size(); for (int i = 0; i < size; i++) { Uniform u = uniforms.getValue(i); if (!u.isSetByCurrentMaterial()) { if (u.getName().charAt(0) != 'g') { // Don't reset world globals! // The benefits gained from this are very minimal // and cause lots of matrix -> FloatBuffer conversions. u.clearValue(); } } } }
/** * Called by the material to tell the technique that it has been made * current. * The technique updates dynamic defines based on the * currently set material parameters. */ final void notifyTechniqueSwitched() { ListMap<String, MatParam> paramMap = owner.getParamsMap(); paramDefines.clear(); for (int i = 0; i < paramMap.size(); i++) { MatParam param = paramMap.getValue(i); notifyParamChanged(param.getName(), param.getVarType(), param.getValue()); } }
int texturesSortId = 17; for (int i = 0; i < paramValues.size(); i++) { MatParam param = paramValues.getValue(i); if (!param.getVarType().isTextureType()) { continue;
@Test public void testListMap() { ListMap<String, String> listMap = new ListMap<String, String>(); listMap.put("bob", "hello"); assert "hello".equals(listMap.get("bob")); assert "hello".equals(listMap.remove("bob")); assert listMap.size() == 0; assert listMap.isEmpty(); listMap.put("abc", "1"); listMap.put("def", "2"); listMap.put("ghi", "3"); listMap.put("jkl", "4"); listMap.put("mno", "5"); assert "3".equals(listMap.get("ghi")); assert listMap.size() == 5; assert !listMap.isEmpty(); // check iteration order, should be consistent for (int i = 0; i < listMap.size(); i++) { String expectedValue = Integer.toString(i + 1); String key = listMap.getKey(i); String value = listMap.getValue(i); Entry<String, String> entry = listMap.getEntry(i); assert key.equals(entry.getKey()); assert value.equals(entry.getValue()); assert expectedValue.equals(value); } } }
MatParam param = paramValues.getValue(i); VarType type = param.getVarType();
/** * Removes the "set-by-current-material" flag from all uniforms. * When a uniform is modified after this call, the flag shall * become "set-by-current-material". * A call to {@link #resetUniformsNotSetByCurrent() } will reset * all uniforms that do not have the "set-by-current-material" flag * to their default value (usually all zeroes or false). */ public void clearUniformsSetByCurrentFlag() { int size = uniforms.size(); for (int i = 0; i < size; i++) { Uniform u = uniforms.getValue(i); u.clearSetByCurrentMaterial(); } }
protected void resetUniformLocations(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); for (int i = 0; i < uniforms.size(); i++) { Uniform uniform = uniforms.getValue(i); uniform.reset(); // e.g check location again } }
protected void resetUniformLocations(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); for (int i = 0; i < uniforms.size(); i++) { Uniform uniform = uniforms.getValue(i); uniform.reset(); // e.g check location again } }
private void clearUniformsSetByCurrent(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); int size = uniforms.size(); for (int i = 0; i < size; i++) { Uniform u = uniforms.getValue(i); u.clearSetByCurrentMaterial(); } }
private void clearUniformsSetByCurrent(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); for (int i = 0; i < uniforms.size(); i++) { Uniform u = uniforms.getValue(i); u.clearSetByCurrentMaterial(); } }
private void resetUniformsNotSetByCurrent(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); int size = uniforms.size(); for (int i = 0; i < size; i++) { Uniform u = uniforms.getValue(i); if (!u.isSetByCurrentMaterial()) { if (u.getName().charAt(0) != 'g') { // Don't reset world globals! // The benefits gained from this are very minimal // and cause lots of matrix -> FloatBuffer conversions. u.clearValue(); } } } }
protected void updateShaderUniforms(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); for (int i = 0; i < uniforms.size(); i++) { Uniform uniform = uniforms.getValue(i); if (uniform.isUpdateNeeded()) { updateUniform(shader, uniform); } } }
protected void updateShaderUniforms(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); for (int i = 0; i < uniforms.size(); i++) { Uniform uniform = uniforms.getValue(i); if (uniform.isUpdateNeeded()) { updateUniform(shader, uniform); } } }
private void resetUniformsNotSetByCurrent(Shader shader) { ListMap<String, Uniform> uniforms = shader.getUniformMap(); for (int i = 0; i < uniforms.size(); i++) { Uniform u = uniforms.getValue(i); if (!u.isSetByCurrentMaterial()) { u.clearValue(); } } }