/** Disables profiling by resetting the {@code GL20} and {@code GL30} instances with the original ones. */ public void disable () { if (!enabled) return; GL30 gl30 = graphics.getGL30(); if (gl30 != null) graphics.setGL30(((GL30Interceptor) graphics.getGL30()).gl30); else graphics.setGL20(((GL20Interceptor) graphics.getGL20()).gl20); enabled = false; }
/** Disables profiling by resetting the {@code GL20} and {@code GL30} instances with the original ones. */ public void disable () { if (!enabled) return; GL30 gl30 = graphics.getGL30(); if (gl30 != null) graphics.setGL30(((GL30Interceptor) graphics.getGL30()).gl30); else graphics.setGL20(((GL20Interceptor) graphics.getGL20()).gl20); enabled = false; }
/** * Create a new instance of GLProfiler to monitor a {@link com.badlogic.gdx.Graphics} instance's gl calls * @param graphics instance to monitor with this instance, With Lwjgl 2.x you can pass in Gdx.graphics, with Lwjgl3 use * Lwjgl3Window.getGraphics() */ public GLProfiler (Graphics graphics) { this.graphics = graphics; GL30 gl30 = graphics.getGL30(); if (gl30 != null) { glInterceptor = new GL30Interceptor(this, graphics.getGL30()); } else { glInterceptor = new GL20Interceptor(this, graphics.getGL20()); } listener = GLErrorListener.LOGGING_LISTENER; }
/** * Create a new instance of GLProfiler to monitor a {@link com.badlogic.gdx.Graphics} instance's gl calls * @param graphics instance to monitor with this instance, With Lwjgl 2.x you can pass in Gdx.graphics, with Lwjgl3 use * Lwjgl3Window.getGraphics() */ public GLProfiler (Graphics graphics) { this.graphics = graphics; GL30 gl30 = graphics.getGL30(); if (gl30 != null) { glInterceptor = new GL30Interceptor(this, graphics.getGL30()); } else { glInterceptor = new GL20Interceptor(this, graphics.getGL20()); } listener = GLErrorListener.LOGGING_LISTENER; }
/** Disables profiling by resetting the {@code GL20} and {@code GL30} instances with the original ones. */ public void disable () { if (!enabled) return; GL30 gl30 = graphics.getGL30(); if (gl30 != null) graphics.setGL30(((GL30Interceptor) graphics.getGL30()).gl30); else graphics.setGL20(((GL20Interceptor) graphics.getGL20()).gl20); enabled = false; }
/** * Create a new instance of GLProfiler to monitor a {@link com.badlogic.gdx.Graphics} instance's gl calls * @param graphics instance to monitor with this instance, With Lwjgl 2.x you can pass in Gdx.graphics, with Lwjgl3 use * Lwjgl3Window.getGraphics() */ public GLProfiler (Graphics graphics) { this.graphics = graphics; GL30 gl30 = graphics.getGL30(); if (gl30 != null) { glInterceptor = new GL30Interceptor(this, graphics.getGL30()); } else { glInterceptor = new GL20Interceptor(this, graphics.getGL20()); } listener = GLErrorListener.LOGGING_LISTENER; }
/** * Generates the Shadow Map */ private void genShadowMap() { updateViewport(); ModelCacheEntry cs = (ModelCacheEntry) currentSource; shadowLight.begin(Vector3.Zero, cs.camera3d.direction); shadowBatch.begin(shadowLight.getCamera()); shadowBatch.render(cs.modelInstance); shadowBatch.end(); shadowLight.end(); Gdx.graphics.getGL20().glViewport((int) VIEWPORT.x, (int) VIEWPORT.y, (int) VIEWPORT.width, (int) VIEWPORT.height); }
public void render(SpriteBatch sb, OrthoCamera camera) { fbo.begin(); sb.setProjectionMatrix(camera.combined); sb.setShader(defaultShader); Gdx.graphics.getGL20().glClear(GL20.GL_COLOR_BUFFER_BIT); sb.begin(); for (Light light : lights) light.render(sb); sb.end(); fbo.end(); //draw the actual scene Gdx.graphics.getGL20().glClear(GL20.GL_COLOR_BUFFER_BIT); sb.setProjectionMatrix(camera.combined); sb.setShader(finalShader); sb.begin(); fbo.getColorBufferTexture().bind(1); //this is important! bind the FBO to the 2nd texture unit ResourceManager.getInstance().getTexture("light").bind(0); //we force the binding of a texture on first texture unit to avoid artefacts /* THIS NEEDS TO BE ENDED AFTER GAME IS DRAWN sb.end(); sb.setShader(defaultShader); */ }
public GameRenderer (GameWorld gameWorld) { world = gameWorld; gl = Gdx.graphics.getGL20(); postProcessing = new PostProcessing(gameWorld); postProcessor = postProcessing.getPostProcessor(); worldRenderer = new GameWorldRenderer(world, postProcessing.isEnabled()); batchRenderer = new GameBatchRenderer(gl); if (postProcessing.isEnabled() && postProcessing.hasEffect(Effects.Ssao.name)) { Ssao ssao = (Ssao)postProcessing.getEffect(Effects.Ssao.name); ssao.setNormalDepthMap(worldRenderer.getNormalDepthMap().getColorBufferTexture()); } // initialize utils ScreenUtils.init(worldRenderer); // precompute sprite batch transform matrix xform.idt(); xform.scale(ScaleUtils.Scale, ScaleUtils.Scale, 1); }
Gdx.graphics.getGL20().glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); Engine.getSpriteBatch().setColor(color2); Engine.getSpriteBatch().setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE);