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
0
votes
0 answers

ios opengles glsl textures

If I have 5 3D meshes in scene with 5 individual texture maps and 5 individual normal maps, do that means I have to bind all that 10 textures to Vertex Shader and Fragment Shader? If so, how do the real world practise to optimise this scenario?
sooon
  • 4,718
  • 8
  • 63
  • 116
0
votes
1 answer

Why is a texture coordinate of 1.0 getting beyond the edge of the texture?

I'm doing a color lookup using a texture to apply an effect to a picture. My lookup is a gradient map using the luminance of the fragment of the first texture, then looking that up on a second texture. The 2nd texture is 256x256 with gradients…
badweasel
  • 2,349
  • 1
  • 19
  • 31
0
votes
1 answer

OpenGL 2D introduction Android

I'm following a real complete tutorial for 2D game developing on android using OpenGL, and I encountered the following static final String VERTEX_SHADER_CODE = "uniform mat4 u_mvpMatrix;" + "attribute vec4 a_position;" + …
Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206
0
votes
3 answers

Float modulo operator that includes the upper value

I need an efficient glsl code that doesn't have if-else statement. Currently the algorithm is like this : lowp float a; if (a > 1.0) a -= 1.0; else if (a < 0.0) a += 1.0; It's similar with a floating point modulo operator : a =…
Coolant
  • 448
  • 6
  • 13
0
votes
1 answer

Assign integer values to color in opengl es 2.0

i need to set color by byte type or integer, not float values. How can i assign this type into gl_FragColor? Dividing the value by 256 wont give me the wanted precision. My main purpose is to know the specific value of each bit in the color…
user893269
  • 107
  • 2
  • 10
0
votes
1 answer

Weird GLSL float color value in fragment shader on iOS

I am trying to write a simple GLSL fragment shader on an iPad2 and I am running into a strange issue with the way that OpenGL seems to represent a 8bit "red" value onces a pixel value has been converted into a float as part of the texture upload.…
MoDJ
  • 4,309
  • 2
  • 30
  • 65
0
votes
1 answer

Unexpected behavior in fragment shader algorithm

I'm having some trouble with my fragment shader on different devices. On some devices the shader works fine but on other the algorithm produces curious results. I've checked the algorithm in Java to ensure that the algorithm itself does not contain…
user1581048
  • 107
  • 5
0
votes
1 answer

length() in GLSL bug on Samsung Galaxy S3

I made a shader in GLSL for an android game. In this shader I have to compute the length between the current pixel and the center of the FX This shader contain these lines : //compute distance between current pixel and the center of the fx highp…
Klem
  • 529
  • 1
  • 4
  • 18
0
votes
1 answer

Very slow fract operation on Galaxy SII and SIII

My terrain uses shader which itself uses four different textures. It runs fine on windows and linux machines, but on android it gets only ~25FPS on both galaxies. I thought, that textures are the problem, but no, as it appears the problem is with…
SMGhost
  • 3,867
  • 6
  • 38
  • 68
0
votes
0 answers

ios - import using openframeworks and use it glview

Just a thought, is it possible to use openframeworks to import some 3d objects then pass it to glview from ios then mess with glsl? I am using of_ios_074 at the moment and based on further reading it seems like there are still not yet porting over…
sooon
  • 4,718
  • 8
  • 63
  • 116
0
votes
3 answers

Writing to gl_FragColor causes glUseProgram to throw GL_INVALID_OPERATION

I'm trying to write a blur filter in GLSL ES 2.0 and I'm getting an Error with the line assigning gl_FragColor. I've not been able to figure out why #extension GL_OES_EGL_image_external : require precision mediump float; varying vec2…
shbi
  • 90
  • 8
0
votes
1 answer

OpenGLES2 Failing to render bitmap

This is developing a mobile application using OpenGLES2.0 on the android platform (against API 8, if it makes any difference). I'm attempting to add a UI layer over my currently working rendering system, but it's not working and I'm not sure why. …
GHC
  • 2,658
  • 5
  • 30
  • 35
0
votes
1 answer

when is the indices of vertices determined to be used in gl_VertexID

I am trying to understand the behavior of gl_vertexID in vertex shaders. For that I am trying to render 2 squares using two glDrawArrays calls one after another. And want to apply red color to only one square using gl_VertexID in vertex as : out…
user1896853
  • 107
  • 1
  • 9
0
votes
0 answers

GLSLES Losing 5-6ms using uniform float instead of e.g. 0.5

I have this fragment shader. On some "sprites" i want a different "saturation" of the texture. At the moment i only set it once but later i would set it each draw depending on the sprite beeing drawn. As noted in the code if i just write * 0.5 i…
0
votes
1 answer

Objective-C GLSL mix() equivalent

I`m trying to figure out how to write a equivalent to GLSL(ES)s mix method. I tried to add/divide rgb Values but with no luck yet. Any pointer to how the GLSL method works would be welcome.
Alex
  • 541
  • 5
  • 19
1 2 3
19
20