public void render() { if (BaseContext.getConfig().isRenderRefraction() && !BaseContext.getConfig().isRenderUnderwater()){ return; } else { super.render(); } } }
public void render(){ if (!BaseContext.getConfig().isRenderReflection() && !BaseContext.getConfig().isRenderRefraction()){ super.render(); } } }
public void render() { if (!BaseContext.getConfig().isRenderUnderwater() && !BaseContext.getConfig().isRenderWireframe()){ super.render(); } } }
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(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(){ setUniformi("multisamples", BaseContext.getConfig().getMultisamples()); }
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 GLWindow() { super(GLContext.getConfig().getDisplayTitle(), GLContext.getConfig().getWindowWidth(), GLContext.getConfig().getWindowHeight()); }
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 resize(int width, int height) { glfwSetWindowSize(getId(), width, height); setHeight(height); setWidth(width); BaseContext.getConfig().setWindowWidth(width); BaseContext.getConfig().setWindowHeight(height); // TODO set camera projection } }
public void update() { if (BaseContext.getInput().isKeyPushed(GLFW.GLFW_KEY_KP_ADD)){ contrastFactor += 0.01f; } if (BaseContext.getInput().isKeyPushed(GLFW.GLFW_KEY_KP_SUBTRACT)){ contrastFactor -= 0.01f; } if (BaseContext.getInput().isKeyPushed(GLFW.GLFW_KEY_KP_MULTIPLY)){ brightnessFactor += 1f; } if (BaseContext.getInput().isKeyPushed(GLFW.GLFW_KEY_KP_DIVIDE)){ brightnessFactor -= 1f; } }
public void record(RenderList renderList){ if (isleaf){ render = true; } else { render = false; } // render only first two lod's for reflection/refraction if (BaseContext.getConfig().isRenderReflection() || BaseContext.getConfig().isRenderRefraction()){ if (lod == 0 && isleaf){ render = true; } else if(lod == 1 && isleaf){ render = true; } else if(lod == 1 && !isleaf){ render = true; } else { render = false; } } super.record(renderList); }
public VkWindow() { super(VkContext.getConfig().getDisplayTitle(), VkContext.getConfig().getWindowWidth(), VkContext.getConfig().getWindowHeight()); }
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)); } } }
if (BaseContext.getConfig().isRenderReflection() || BaseContext.getConfig().isRenderRefraction()){
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(); }