All Projects â†’ crashinvaders â†’ Gdx Vfx

crashinvaders / Gdx Vfx

Licence: apache-2.0
LibGDX post-processing visual effects

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Gdx Vfx

3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+11040.95%)
Mutual labels:  game-development, opengl, glsl, shaders
Gaiasky
Mirror of Gaia Sky repository hosted on Gitlab: https://gitlab.com/langurmonkey/gaiasky
Stars: ✭ 162 (+54.29%)
Mutual labels:  libgdx, opengl, glsl, shaders
Shadered
Lightweight, cross-platform & full-featured shader IDE
Stars: ✭ 3,247 (+2992.38%)
Mutual labels:  game-development, opengl, glsl, shaders
Shaderconductor
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
Stars: ✭ 1,146 (+991.43%)
Mutual labels:  opengl, glsl, opengl-es
Opentk
The Open Toolkit library is a fast, low-level C# wrapper for OpenGL, OpenAL & OpenCL. It also includes windowing, mouse, keyboard and joystick input and a robust and fast math library, giving you everything you need to write your own renderer or game engine. OpenTK can be used standalone or inside a GUI on Windows, Linux, Mac.
Stars: ✭ 2,284 (+2075.24%)
Mutual labels:  game-development, opengl, opengl-es
Shader-Playgrounds
A WebGL shaders editor for beginners and otherwise.
Stars: ✭ 28 (-73.33%)
Mutual labels:  shaders, glsl, opengl-es
Glmark2
glmark2 is an OpenGL 2.0 and ES 2.0 benchmark
Stars: ✭ 199 (+89.52%)
Mutual labels:  opengl, glsl, opengl-es
Pmtech
Lightweight, multi-platform, data-oriented game engine.
Stars: ✭ 478 (+355.24%)
Mutual labels:  opengl, glsl, opengl-es
Diligentcore
Core functionality of Diligent Engine
Stars: ✭ 263 (+150.48%)
Mutual labels:  opengl, shaders, opengl-es
Ouzel
C++ game engine for Windows, macOS, Linux, iOS, tvOS, Android, and web browsers
Stars: ✭ 607 (+478.1%)
Mutual labels:  game-development, opengl, glsl
Leaf3d
A lightweight 3D rendering engine based on modern OpenGL
Stars: ✭ 16 (-84.76%)
Mutual labels:  opengl, glsl, shaders
Daemon
The Dæmon game engine. With some bits of ioq3 and XreaL.
Stars: ✭ 136 (+29.52%)
Mutual labels:  game-development, opengl, glsl
Renderpipeline
Physically Based Shading and Deferred Rendering for the Panda3D game engine
Stars: ✭ 814 (+675.24%)
Mutual labels:  game-development, opengl, glsl
Nau
Nau - OpenGL + Optix 3D Engine
Stars: ✭ 18 (-82.86%)
Mutual labels:  opengl, glsl, shaders
Shaderworkshop
Interactive GLSL fragment shaders editor made with Qt
Stars: ✭ 43 (-59.05%)
Mutual labels:  opengl, glsl, shaders
Shadergen
Proof-of-concept library for generating HLSL, GLSL, and Metal shader code from C#,
Stars: ✭ 395 (+276.19%)
Mutual labels:  opengl, glsl, shaders
Starwars.android
This component implements transition animation to crumble view into tiny pieces.
Stars: ✭ 1,942 (+1749.52%)
Mutual labels:  opengl, glsl, opengl-es
Glsltuto
GLSL shaders tutorial
Stars: ✭ 168 (+60%)
Mutual labels:  opengl, glsl, shaders
Imogen
GPU Texture Generator
Stars: ✭ 648 (+517.14%)
Mutual labels:  opengl, glsl, shaders
Tess Opt
Demonstration of how we can use tessellation shaders to make faster fragment shaders.
Stars: ✭ 13 (-87.62%)
Mutual labels:  opengl, glsl, shaders

Logo

Maven Central Build Status

Flexible post-processing shader visual effects for LibGDX. The library is based on libgdx-contribs-postprocessing, with lots of improvements and heavy refactoring. The goal is to focus on stability, offer lightweight integration and provide simple effect implementation mechanism.

The library is in Beta, the code is poorly documented. Some goodies might be missing and more cool stuff is to be implemented soon.

Read more about the library at the wiki introduction page.

All the major changes are listed in the CHANGES.md file.

Demo

Visit https://crashinvaders.github.io/gdx-vfx

Or clone and play with the demo locally:

git clone https://github.com/crashinvaders/gdx-vfx.git
cd gdx-vfx
./gradlew demo:desktop:run

Alt Text

How to use

1. Add the library to the project

Maven dependency

The library's stable releases are available through maven central repo.

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        mavenCentral()
    }
}

Add the dependency:

dependencies {
    implementation 'com.crashinvaders.vfx:gdx-vfx-core:0.5.0'
    implementation 'com.crashinvaders.vfx:gdx-vfx-effects:0.5.0'    // Optional, if you need standard filter/effects.
}

HTML/GWT support

The library is fully HTML/GWT compatible, but requires extra dependency to be included to GWT module in order to work properly.
Please consider reading GWT integration guide.

dependencies {
    implementation 'com.crashinvaders.vfx:gdx-vfx-gwt:0.5.0'
}

Other integration options

There are number of ways to incorporate the library into the project. If you're looking for snapshot version artifacts or another approach, please read the general integration guide.

2. Sample code

A simple example of a LibGDX application that applies gaussian blur effect to a geometry drawn with ShapeRenderer.

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.crashinvaders.vfx.VfxManager;
import com.crashinvaders.vfx.effects.GaussianBlurEffect;

public class VfxExample extends ApplicationAdapter {
    private ShapeRenderer shapeRenderer;
    private VfxManager vfxManager;
    private GaussianBlurEffect vfxEffect;

    @Override
    public void create() {
        shapeRenderer = new ShapeRenderer();

        // VfxManager is a host for the effects.
        // It captures rendering into internal off-screen buffer and applies a chain of defined effects.
        // Off-screen buffers may have any pixel format, for this example we will use RGBA8888.
        vfxManager = new VfxManager(Pixmap.Format.RGBA8888);

        // Create and add an effect.
        // VfxEffect derivative classes serve as controllers for the effects.
        // They provide public properties to configure and control them.
        vfxEffect = new GaussianBlurEffect();
        vfxManager.addEffect(vfxEffect);
    }

    @Override
    public void resize(int width, int height) {
        // VfxManager manages internal off-screen buffers,
        // which should always match the required viewport (whole screen in our case).
        vfxManager.resize(width, height);

        shapeRenderer.getProjectionMatrix().setToOrtho2D(0f, 0f, width, height);
        shapeRenderer.updateMatrices();
    }

    @Override
    public void render() {
        // Clean up the screen.
        Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

        // Clean up internal buffers, as we don't need any information from the last render.
        vfxManager.cleanUpBuffers();

        // Begin render to an off-screen buffer.
        vfxManager.beginInputCapture();

        // Here's where game render should happen.
        // For demonstration purposes we just render some simple geometry.
        shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
        shapeRenderer.setColor(Color.PINK);
        shapeRenderer.rect(250f, 100f, 250f, 175f);
        shapeRenderer.setColor(Color.ORANGE);
        shapeRenderer.circle(200f, 250f, 100f);
        shapeRenderer.end();

        // End render to an off-screen buffer.
        vfxManager.endInputCapture();

        // Apply the effects chain to the captured frame.
        // In our case, only one effect (gaussian blur) will be applied.
        vfxManager.applyEffects();

        // Render result to the screen.
        vfxManager.renderToScreen();
    }

    @Override
    public void dispose() {
        // Since VfxManager has internal frame buffers,
        // it implements Disposable interface and thus should be utilized properly.
        vfxManager.dispose();

        // *** PLEASE NOTE ***
        // VfxManager doesn't dispose attached VfxEffects.
        // This is your responsibility to manage their lifecycle.
        vfxEffect.dispose();

        shapeRenderer.dispose();
    }
}

Result

The actual example code can be found here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].