Questions tagged [fragment-shader]

A GPU program used in rendering. It is executed for each sample taken from a rasterized primitive. The output of this process is a number of values and a floating-point depth.

Resources

1506 questions
0
votes
1 answer

basic arithmetic in iOS GLSL fragment shader

Here is my fragment shader program which runs on iOS 5.1.1 on iPhone 3g. #ifdef GL_ES precision lowp float; #endif varying vec2 v_texCoord; void main() { float offset = sin(v_texCoord.x * 10.0); // offset = offset * 1.0; // (!!!) …
lost_guadelenn
  • 447
  • 4
  • 14
0
votes
1 answer

How to add values to a floating point texture from within a fragment shader?

Is it possible in GLSL to add to a floating point texture from within a fragment shader? For example if i just want to know how often a fragment shader is called for one pixel, can i write a fragment shader that just adds 1 to the corresponding…
lenn
  • 5
  • 3
0
votes
1 answer

Chrome WebGL Fragment shader on Radeon IGP 340m

I have a old machine with Radeon IGP 340m graphic card. According manufacture spec, it only support OpenGL 1.3 and not support fragment shader, but when i run some WebGL applications in here: http://glsl.heroku.com/ (require fragment shader version…
Bình Nguyên
  • 2,252
  • 6
  • 32
  • 47
0
votes
1 answer

glAlphaFunc performance on newer GPUs

I'm almost finished with an app that only uses vertex arrays and no shaders. I draw a lot of polygons with glAlphaFunc in use and it is unexpectedly slow. Is this because it is depreciated and unsupported by the hardware or would it be just as…
spinning
  • 119
  • 1
  • 1
  • 10
0
votes
1 answer

Get current buffer depth in fragment shader in agal

Is it possible in AGAL in fragment shader get current fragment depth if any?
nikitablack
  • 4,359
  • 2
  • 35
  • 68
0
votes
1 answer

Incorrect values getting to GLSL Frag Shader

I'm working on what should be a simple OpenGl 4 project. All I am looking to do is change the alpha value around the mouse pointer and blend. After some work, I managed to get a circle to change values, but it's static (doesn't move with the…
Tubbs
  • 665
  • 1
  • 7
  • 20
0
votes
1 answer

GLSL Shader - Shadow with transparency (glasstable effect)

I´ve created a shader that is able to rotate an image about 180° and overlay it with a black gradient but now I want to create real transparency instead of using black as my background color. This is what I got so far: // Vertex Shader uniform highp…
seveves
  • 1,282
  • 4
  • 17
  • 37
0
votes
1 answer

Who computed gl_FragColor for points inside a triangle?

If we are going to generate fog using the vertex shader and the fragment shader, one of the common ways would be to compute the distance of a vertex in the vertex shader and apply the fog-mixed color in the fragment shader. My question is, since we…
peter
  • 1,034
  • 1
  • 9
  • 23
0
votes
2 answers

Mixing different Program3Ds results in some objects not rendering

I have encountered something unexpected working with Stage3D. I have made two different shader programs for my objects. One of the programs is for using textured bitmaps and uv data. The other simply uses color data. The two objects are very…
jpwrunyan
  • 530
  • 5
  • 22
-1
votes
1 answer

Why is the texture created by this fragment shader one solid color when it should have a multicolored design pattern with waves running through it?

I have an OpenGL fragment shader .fsh file with the following code constant float M_PI = 3.141592653589793; constant float M_2PI = 6.283185307179586; constant vec3 c1a = vec3(0.0, 0.0, 0.0); constant vec3 c1b = vec3(0.9, 0.0, 0.4); constant vec3…
quickj
  • 25
  • 5
-1
votes
1 answer

Draw simple triangle in c++ (glfw, glad)

Hello i just followed the youtube tutorial example but it didnt work. I think i cannot use another way becuse then the other videos of the tutorial would be different for me. I just paste the shader code here and not the window creation etc. I also…
CloudBeta
  • 1
  • 2
-1
votes
1 answer

Unable to get my software C++ glsl implementation to behave correctly

so, I am writing a couple of functions so to run GLSL fragment shaders on CPU. I implemented all the basic mathematical functions to do so. However I can't even get the simplest stuff to execute correctly. I was able to trace it down to either of…
tuxifan
  • 29
  • 5
-1
votes
2 answers

Circle in GLSL is being drawn in the wrong location

So, I have a circle in glsl that is supposed to be drawn around the mouse. The resulting circle is drawn in the wrong location. I'm drawing the circle by taking the step of the distance from st and the vector2 of the uniform mouse. I have no Idea…
Aaron Speedy
  • 3
  • 1
  • 3
-1
votes
1 answer

Linking the vertex shader 2 times works, but not linking the vertex and the fragment shader

it has been days since I'm trying to debug my project that I recently updated from LWJGL2 to LWJGL3. I found some issues, but still it wasn't working so I made a minimal project, like really minimal and compared it to a working project I found…
Thibault Abry
  • 156
  • 10
-1
votes
1 answer

METAL - Fragment shader is producing noise

I am trying to use basic lighting techniques described in Metal By Tutorials to produce a diffuse, ambient, and specular light on my models. I have used this lighting algorithm plenty of times and it works great, but the past 2 times the specular…
Jamie2020
  • 49
  • 5