public void updateUniforms(){ setUniformi("multisamples", BaseContext.getConfig().getMultisamples()); }
public void render() { boolean renderChunk = false; if (BaseContext.getConfig().isRenderReflection() || BaseContext.getConfig().isRenderRefraction()){ // render only first two lod's for reflection/refraction renderChunk = (isleaf && lod == 0) || (!isleaf && lod == 0);// || (!isleaf && lod == 1); } else{ renderChunk = isleaf; } if (renderChunk) { getComponents().get(NodeComponentType.MAIN_RENDERINFO).render(); } for(Node child: getChildren()) child.render(); }
@SuppressWarnings("restriction") public void init() { super.init(); bean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); UIScreen screen0 = new UIScreen(); screen0.getElements().add(new GLColorPanel(new Vec4f(0,0,0,0.5f), 0, BaseContext.getConfig().getWindowHeight()-245, 355, 250, panelMeshBuffer)); screen0.getElements().add(new GLStaticTextPanel("FPS:", 10, BaseContext.getConfig().getWindowHeight()-40, 40, 40, fontsTexture)); screen0.getElements().add(new GLStaticTextPanel("CPU:", 10, BaseContext.getConfig().getWindowHeight()-80, 40, 40, fontsTexture)); screen0.getElements().add(new GLDynamicTextPanel("000", 110, BaseContext.getConfig().getWindowHeight()-40, 40, 40, fontsTexture)); screen0.getElements().add(new GLDynamicTextPanel("000", 110, BaseContext.getConfig().getWindowHeight()-80, 40, 40, fontsTexture)); screen0.getElements().add(new GLTexturePanel("textures/logo/OpenGL_Logo.png", 0, BaseContext.getConfig().getWindowHeight()-240, 360, 160, panelMeshBuffer)); getScreens().add(screen0); }
public void updateUniforms(GLTexture pssm, boolean ssaoFlag){ bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); bindUniformBlock("DirectionalLight", Constants.DirectionalLightUniformBlockBinding); bindUniformBlock("LightViewProjections",Constants.LightMatricesUniformBlockBinding); setUniformf("sightRangeFactor", BaseContext.getConfig().getSightRange()); glActiveTexture(GL_TEXTURE1); pssm.bind(); setUniformi("pssm", 1); setUniformi("ssaoFlag", ssaoFlag ? 1 : 0); setUniformi("numSamples", BaseContext.getConfig().getMultisamples()); } }
public void updateUniforms(Renderable object){ setUniform("clipplane", BaseContext.getConfig().getClipplane()); bindUniformBlock("Camera",Constants.CameraUniformBlockBinding); bindUniformBlock("LightViewProjections",Constants.LightMatricesUniformBlockBinding); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 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){ setUniform("clipplane", BaseContext.getConfig().getClipplane()); bindUniformBlock("Camera", Constants.CameraUniformBlockBinding); bindUniformBlock("LightViewProjections", Constants.LightMatricesUniformBlockBinding); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 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); 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); 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)); } }
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)); } } }
public void updateUniforms(GLTexture texture) { glActiveTexture(GL_TEXTURE0); texture.bind(); setUniformi("texture", 0); setUniformi("width", BaseContext.getWindow().getWidth()); setUniformi("height", BaseContext.getWindow().getHeight()); setUniformi("multisamples", BaseContext.getConfig().getMultisamples()); } }
public void updateUniforms(Renderable object){ setUniform("clipplane", BaseContext.getConfig().getClipplane()); bindUniformBlock("Camera",Constants.CameraUniformBlockBinding); bindUniformBlock("LightViewProjections",Constants.LightMatricesUniformBlockBinding); ((GLInstancedCluster) object.getParentNode()).getWorldMatricesBuffer().bindBufferBase(0); bindUniformBlock("worldMatrices", 0); @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); 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) { 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){ 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(GLTexture opaqueSceneTexture, GLTexture opaqueSceneLightScatteringTexture, GLTexture transparencyLayer, GLTexture alphaMap, GLTexture transparencyLayerLightScatteringTexture) { setUniformf("width", BaseContext.getConfig().getX_ScreenResolution()); setUniformf("height", BaseContext.getConfig().getY_ScreenResolution()); glActiveTexture(GL_TEXTURE0); opaqueSceneTexture.bind(); setUniformi("opaqueSceneTexture", 0); glActiveTexture(GL_TEXTURE2); opaqueSceneLightScatteringTexture.bind(); setUniformi("opaqueSceneLightScatteringTexture", 2); glActiveTexture(GL_TEXTURE3); transparencyLayer.bind(); setUniformi("transparencyLayer", 3); glActiveTexture(GL_TEXTURE5); alphaMap.bind(); setUniformi("transparencyAlphaMap", 5); glActiveTexture(GL_TEXTURE6); transparencyLayerLightScatteringTexture.bind(); setUniformi("transparencyLayerLightScatteringTexture", 6); }
public void updateUniforms(Renderable object) setUniformi("isReflection", BaseContext.getConfig().isRenderReflection() ? 1 : 0); bindUniformBlock("modelMatrices", 1); setUniform("clipplane", BaseContext.getConfig().getClipplane()); setUniform("scalingMatrix", new Matrix4f().Scaling(object.getWorldTransform().getScaling()));