Skip to content
/ VShade Public

Simplifies the integration of GLSL shaders with Java applications, offering an easy-to-use interface for defining and manipulating shader variables, bridging the gap between GLSL's C/C++ design and Java's object-oriented approach.

Notifications You must be signed in to change notification settings

basdxz/VShade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VShade

VShade is a Java library built on Java 8 and LWJGL 2.9.3, designed to simplify and streamline the integration of GLSL shaders with Java applications. It aims to provide an easy-to-use interface for defining and manipulating shader variables, bridging the gap between GLSL's C/C++ centric design and Java's object-oriented approach.

Motivation

GLSL was primarily designed with C/C++ in mind, often leaving Java developers to deal with complex and error-prone bindings. The data layouts for both attribute and uniform variables require pointers to C structs, which Java does not support natively. Furthermore, unused attributes and uniforms are removed if they don't affect the final output, and the explicit numbering of data can be cumbersome and error-prone. VShade aims to address these challenges and create a more Java-friendly shader development experience.

Approach

VShade tackles these issues by providing builders and data types for constructing shader program inputs and outputs. After compiling and linking the shader, VShade queries the program to ensure proper connections between Java and GLSL. The library also offers optional verbose logging for the process, enabling easier debugging.

Key features include:

Silent linkage of unfound uniforms during the query process, preventing fatal exceptions Automatic removal of unused vertex attributes from the layout.

An experimental implementation in the context of a Minecraft Loading Screen

Future

VShade is planned for a major rework in the future (V2), focusing on better compatibility with LWJGL 3/4 and incorporating an external SPIR-V compiler/introspection for more efficient shader development. While the core problem VShade solves will remain the same, the new version will introduce significant changes and improvements, such as:

  • Looser coupling with the LWJGL backend
  • Runtime re-compilation in development environments

By incorporating these enhancements, VShade V2 aims to provide an even more robust and developer-friendly solution for Java-based GLSL shader integration.

About

Simplifies the integration of GLSL shaders with Java applications, offering an easy-to-use interface for defining and manipulating shader variables, bridging the gap between GLSL's C/C++ design and Java's object-oriented approach.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published