Libgdx shader changes texture

In my libgdx project I use a custom shader to create different color variations of a single grayscale character. I have a class “Shader” which holds static String variables for the vertex and fragment shaders. For each person I basically create a new shader, by replacing strings in the fragment shader string. For some reason, … Continue reading “Libgdx shader changes texture”

LWJGL – Uniform buffer object doesn't work

I tried to implement uniform buffer object to my game, but for some reason I haven’t got it working. I don’t think it currently sends anything to shaders. Before UBO everything worked fine. This is fully temporary system. I just wanted to get it working. My UBO class: private int ubo; public void createUBO() { … Continue reading “LWJGL – Uniform buffer object doesn't work”

Combine image with its mask with Android shaders?

I’m developing an app for android and I use GL for some behaivors and I have a problem with an specific case. I have an image of an ambient (for example, a room), and also y have a mask that is all white and marks in black the location of the a wall. Well I … Continue reading “Combine image with its mask with Android shaders?”

OpenGL LWJGL3 with Shaders gives black screen only

I have a NetBeans project (see link to zip file below) that I tried to convert from my Visual Studio project (C#). I am using the libraries from LWJGL and JOML (for Matrix classes) but no matter where I put my objects, they won’t get rendered on screen. Here’s the init method: private void init() … Continue reading “OpenGL LWJGL3 with Shaders gives black screen only”

JaxaFX Shader Issue on Ubuntu: Help translate error

An error is being reported in Java that I would like to resolve. I’m not sure what is causing the error, and I would like to understand the cause. I’m using JavaFX, Java 8 and Ubuntu OS. I’m attempting to use the getting stated guide here: https://developers.arcgis.com/java/latest/guide/display-a-scene.htm Unfortunately, I’m getting a error that I cannot … Continue reading “JaxaFX Shader Issue on Ubuntu: Help translate error”

Unable to render simple vertex array

I am in the process of migrating a 2D game from legacy -> modern OpenGL. For me, this means using shaders and vertex arrays instead of glProjection, glOrtho and glBegin / glEnd. I’ve stripped the relevant code down to a very basic example. The camera is at (0, 0, -1) looking at (0, 0, 0), … Continue reading “Unable to render simple vertex array”

LWJGL having 2 shaderprograms in the same shader class only links 1 shader

I’m working on a shader class in which I have to load 2 shader programs. (one for textures and one for no textures). I’ve got the shader that’s loaded for no textures to link but the one for textures doesn’t link. Here is my shader loading method for the 2 shader files: public void setupShader(String … Continue reading “LWJGL having 2 shaderprograms in the same shader class only links 1 shader”

Transparency issues with LWJGL “discard”, everything is invisible?

When I attempt to implement transparency for my textures in LWJGL 3, the models seem to render with full transparency, and thus are not visible at all. When I remove the check, it works fine. Any clue’s as to why? Here is the shader code where the alpha component is checked: #version 430 in vec2 … Continue reading “Transparency issues with LWJGL “discard”, everything is invisible?”

Why does the shader program fail to compile despite linking and validating successfully?

Shader program does not link despite the vertex and fragment shaders compiling successfuly. No error message is retreived using glGetProgramInfoLog(). A value of GL_FALSE is, however, retreived within the success buffer variable (the GLException is thrown with an empty message). Here is the code: private int compileProgram(String[] vertexShaderSource, String[] fragmentShaderSource) throws GLException { // compiling … Continue reading “Why does the shader program fail to compile despite linking and validating successfully?”

Opengl – GLSL – Storing 4 bytes inside one float and sending it to a shader

using: opengl es 2.0 on an android device I want to draw a lot of points. Right now I need 3 floats to store each pixels position and then 4 more floats to store its color (rgba). Instead I want to store the color inside 1 float (4 bytes). So overall I would only need … Continue reading “Opengl – GLSL – Storing 4 bytes inside one float and sending it to a shader”