public LensFlareTexturePanel() { super(); orthographicMatrix = new Matrix4f().Orthographic2D(); orthoTransform = new Transform(); setConfig(new AdditiveBlending()); setShader(LensFlareShader.getInstance()); }
public UIElement(int xPos, int yPos, int xScaling, int yScaling){ super(); setOrthographicMatrix(new Matrix4f().Orthographic2D()); getWorldTransform().setTranslation(xPos, yPos, 0); getWorldTransform().setScaling(xScaling, yScaling, 0); setOrthographicMatrix(getOrthographicMatrix().mul(getWorldTransform().getWorldMatrix())); }
public void updateUniforms(Renderable object) { bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); setUniformi("isReflection", BaseContext.getConfig().isRenderReflection() ? 1 : 0); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 0); ((GLInstancedCluster) object.getParentNode()).getModelMatricesBuffer().bindBufferBase(1); bindUniformBlock("modelMatrices", 1); setUniform("clipplane", BaseContext.getConfig().getClipplane()); setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling())); List<Integer> indices = ((InstancedCluster) object.getParentNode()).getHighPolyIndices(); for (int i=0; i<indices.size(); i++) { setUniformi("matrixIndices[" + i +"]", indices.get(i)); } } }
public void updateUniforms(Renderable object) { bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); setUniformi("isReflection", BaseContext.getConfig().isRenderReflection() ? 1 : 0); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 0); ((GLInstancedCluster) object.getParentNode()).getModelMatricesBuffer().bindBufferBase(1); bindUniformBlock("modelMatrices", 1); setUniform("clipplane", BaseContext.getConfig().getClipplane()); setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling())); @SuppressWarnings("unchecked") Material<GLTexture> material = (Material<GLTexture>) object.getComponent(NodeComponentType.MATERIAL0); setUniform("material.color", material.getColor()); // setUniformf("material.emission", material.getEmission()); // setUniformf("material.shininess", material.getShininess()); List<Integer> indices = ((InstancedCluster) object.getParentNode()).getHighPolyIndices(); for (int i=0; i<indices.size(); i++) { setUniformi("matrixIndices[" + i +"]", indices.get(i)); } } }
public void updateUniforms(Renderable object){ setUniform("clipplane", BaseContext.getConfig().getClipplane()); bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); setUniformi("isReflection", BaseContext.getConfig().isRenderReflection() ? 1 : 0); setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling())); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 0); ((GLInstancedCluster) object.getParentNode()).getModelMatricesBuffer().bindBufferBase(1); bindUniformBlock("modelMatrices", 1); @SuppressWarnings("unchecked") Material<GLTexture> material = (Material<GLTexture>) object.getComponent(NodeComponentType.MATERIAL0); glActiveTexture(GL_TEXTURE0); material.getDiffusemap().bind(); setUniformi("material.diffusemap", 0); List<Integer> indices = ((InstancedCluster) object.getParentNode()).getLowPolyIndices(); for (int i=0; i<indices.size(); i++) { setUniformi("matrixIndices[" + i +"]", indices.get(i)); } } }
public void updateUniforms(Renderable object) { bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); // setUniformi("screenWidth", CoreSystem.getInstance().getWindow().getWidth()); // setUniformi("screenHeight", CoreSystem.getInstance().getWindow().getHeight()); setUniformi("isReflection", BaseContext.getConfig().isRenderReflection() ? 1 : 0); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 0); ((GLInstancedCluster) object.getParentNode()).getModelMatricesBuffer().bindBufferBase(1); bindUniformBlock("modelMatrices", 1); setUniform("clipplane", BaseContext.getConfig().getClipplane()); setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling())); @SuppressWarnings("unchecked") Material<GLTexture> material = (Material<GLTexture>) object.getComponent(NodeComponentType.MATERIAL0); glActiveTexture(GL_TEXTURE0); material.getDiffusemap().bind(); setUniformi("material.diffusemap", 0); List<Integer> indices = ((InstancedCluster) object.getParentNode()).getHighPolyIndices(); for (int i=0; i<indices.size(); i++) { setUniformi("matrixIndices[" + i +"]", indices.get(i)); } } }
public void updateUniforms(Renderable object) { bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 0); ((GLInstancedCluster) object.getParentNode()).getModelMatricesBuffer().bindBufferBase(1); bindUniformBlock("modelMatrices", 1); setUniformi("isReflection", BaseContext.getConfig().isRenderReflection() ? 1 : 0); setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling())); setUniform("clipplane", BaseContext.getConfig().getClipplane()); @SuppressWarnings("unchecked") Material<GLTexture> material = (Material<GLTexture>) object.getComponent(NodeComponentType.MATERIAL0); glActiveTexture(GL_TEXTURE0); material.getDiffusemap().bind(); setUniformi("material.diffusemap", 0); // setUniformf("material.shininess", material.getShininess()); // setUniformf("material.emission", material.getEmission()); List<Integer> indices = ((InstancedCluster) object.getParentNode()).getHighPolyIndices(); for (int i=0; i<indices.size(); i++) { setUniformi("matrixIndices[" + i +"]", indices.get(i)); } } }
public void updateUniforms(Renderable object){ setUniform("clipplane", BaseContext.getConfig().getClipplane()); bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); setUniformi("isReflection", BaseContext.getConfig().isRenderReflection() ? 1 : 0); setUniformi("isRefraction", BaseContext.getConfig().isRenderRefraction() ? 1 : 0); setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling())); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 0); ((GLInstancedCluster) object.getParentNode()).getModelMatricesBuffer().bindBufferBase(1); bindUniformBlock("modelMatrices", 1); @SuppressWarnings("unchecked") Material<GLTexture> material = (Material<GLTexture>) object.getComponent(NodeComponentType.MATERIAL0); glActiveTexture(GL_TEXTURE0); material.getDiffusemap().bind(); setUniformi("material.diffusemap", 0); List<Integer> indices = ((InstancedCluster) object.getParentNode()).getLowPolyIndices(); for (int i=0; i<indices.size(); i++) { setUniformi("matrixIndices[" + i +"]", indices.get(i)); } } }
setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling()));
public void updateUniforms(Renderable object) { bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); bindUniformBlock("DirectionalLight", Constants.DirectionalLightUniformBlockBinding); bindUniformBlock("LightViewProjections",Constants.LightMatricesUniformBlockBinding); setUniformi("isReflection", BaseContext.getConfig().isRenderReflection() ? 1 : 0); setUniformi("isRefraction", BaseContext.getConfig().isRenderRefraction() ? 1 : 0); setUniformi("isCameraUnderWater", BaseContext.getConfig().isRenderUnderwater() ? 1 : 0); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 0); ((GLInstancedCluster) object.getParentNode()).getModelMatricesBuffer().bindBufferBase(1); bindUniformBlock("modelMatrices", 1); setUniform("clipplane", BaseContext.getConfig().getClipplane()); setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling())); @SuppressWarnings("unchecked") Material<GLTexture> material = (Material<GLTexture>) object.getComponent(NodeComponentType.MATERIAL0); glActiveTexture(GL_TEXTURE0); material.getDiffusemap().bind(); setUniformi("material.diffusemap", 0); List<Integer> indices = ((InstancedCluster) object.getParentNode()).getHighPolyIndices(); for (int i=0; i<indices.size(); i++) { setUniformi("matrixIndices[" + i +"]", indices.get(i)); } }
setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling())); setUniform("clipplane", BaseContext.getConfig().getClipplane());
- lensFlareTexture.getOrthoTransform().getScaling().getY()/2f); lensFlareTexture.setOrthographicMatrix( new Matrix4f().Orthographic2D().mul(lensFlareTexture.getOrthoTransform().getWorldMatrix()));