Questions tagged [glsles]

The OpenGL ES Shading Language (also known as GLSL ES or ESSL) is based on the OpenGL Shading Language (GLSL) version 1.20.

The OpenGL ES pipeline contains a programmable vertex stage and a programmable fragment stage. The remaining stages are referred to as fixed function and the application has only limited control over their behavior. The set of compilation units for each programmable stage form a shader.

OpenGL ES 2.0 only supports a single compilation unit per shader. A program is a complete set of shaders that are compiled and linked together.

Resources:

294 questions
4
votes
2 answers

Android openGL ES 3.0 shaders are not working

I am using openGl ES 3.0 in android to render a rect on screen, and I want to use shaders to generate a mix of colors depending on vertex positions. I am sure that the problem is in the vertex and in the fragment shader code, but I don't know what…
SomeUser
  • 75
  • 7
4
votes
1 answer

OpenGL shader language; how to specify precision for vec4?

I'm writing a Qt OpenGL application, just starting out with GLSL, and am trying to compile a "simple" fragment shader I found in an example on the web: #version 320 es out vec4 fColor; void main() { fColor = vec4 (0.0, 0.0, 1.0, 1.0); } But…
Tomasso
  • 693
  • 2
  • 9
  • 17
4
votes
1 answer

Pure Depth SSAO flickering

I try to implement Pure Depth SSAO, using this tutorial, into an OpenGL ES 2.0 engine. Now I experience flickering, which looks like I read from somewhere, where I have no data. Can you see where I made a mistake or do you have an idea how to solve…
4
votes
2 answers

why opengl shader mix function for two transparent png photo become black?

Photo 1 is: Photo 2 is: Of course photo 2 is partly transparent. But when i mix them in shader such as that: vec4 add(vec4 one, vec4 two){ return mix(one, two, two.a); } They become partly black like the following: i'm so confused about why…
SDJSK
  • 1,292
  • 17
  • 24
4
votes
4 answers

How do I convert between float and vec4,vec3,vec2?

This question is very related to the question here(How do I convert a vec4 rgba value to a float?). There is some of articles or questions related to this question already, but I wonder most of articles are not identifying which type of floating…
kyasbal
  • 1,132
  • 3
  • 12
  • 27
4
votes
1 answer

Can I avoid texture gradient calculations in webgl?

We have a webgl/three.js application that makes extensive use of texture buffers for passing data between passes and for storing arrays of data. None of these has any use for mipmaps. We are easily able to prevent mipmap generation: at the…
Stephen Todd
  • 365
  • 3
  • 12
4
votes
1 answer

Android GLES 2 draw line flicker and strange effects

I am trying to draw some 3d lines in android using gles 2. But it resulted in some strange effects. Flicker happens when i rotate the scene/camera. But not only that, there is also some lines drawn in 2d (sometime dots) at random. This is the…
Dave Xenos
  • 63
  • 5
4
votes
1 answer

Manual selection lod of mipmaps in a fragment shader using three.js

I'm writing a physically based shader using glsl es in three.js. For the addition of specular global illumination I use a cubemap dds texture with mipmap chain inside (precalculate with CubeMapGen as it's explained here). I need to access this…
Ale_32
  • 648
  • 1
  • 6
  • 16
4
votes
1 answer

Vertex Shader fails to compile. Can't find the mistake

EDIT: Seems the mistake was, that I am not allowed to compile the shader in a seperate thread? Since I've been pushing the object-loading just now into a threaded environment, the error message came up. Just didn't think that it could be the reason…
damian
  • 2,001
  • 20
  • 38
4
votes
1 answer

Three.js/GLSL - Convert Pixel Coordinate to World Coordinate

I have a simple shader in my Three.js application that colors the screen red. However, I want to color all pixels to the right of a given world position to to a different color. I have seen some answers that suggest using varying vec4 worldCoord =…
Dragonseer
  • 2,874
  • 7
  • 29
  • 42
3
votes
0 answers

Gaussian blur with alpha

Is it possible to make Gaussian blur like in Photoshop via GLSL? I found just some examples of shaders which work the same. But none of them return same result as Photoshop, if half-transparent blur. I do two-pass ping-pong Gaussian blur, where i…
dt_
  • 95
  • 1
  • 10
3
votes
1 answer

CPU to GPU normal mapping

I'm creating a terrain mesh, and following this SO answer I'm trying to migrate my CPU computed normals to a shader based version, in order to improve performances by reducing my mesh resolution and using a normal map computed in the fragment…
Tim Autin
  • 6,043
  • 5
  • 46
  • 76
3
votes
1 answer

OpenGL-ES: is it possible to use an integer surface as a color attachment?

I am writing a game for Android devices which uses the Android NDK and OpenGL-ES. I am rendering an image to a framebuffer and then using that information in the CPU. More precision would be better, so I used: glTexImage2D(GL_TEXTURE_2D, 0,…
Cerulean Quasar
  • 135
  • 1
  • 9
3
votes
1 answer

OpenGL ES 3.0 / GLSL not rendering data (Kotlin)

I am trying to implement a basic shading program with OpenGL ES 3.0, and have pieced together this code from various tutorials. Everything looks correct to me, and it compiles fine, but nothing appears on my screen. It rendered fine until I added…
Jonah M
  • 300
  • 2
  • 13
3
votes
1 answer

Problem going from Shadershop functions to glsl functions

It's a bit related to how to convert shadershop formula into glsl . Only the above answer does not provide any explanation. What I try is: Where SineV is: and SineH is: This is what I have so far: #ifdef GL_ES precision mediump…
clankill3r
  • 9,146
  • 20
  • 70
  • 126
1 2
3
19 20