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
-1
votes
1 answer

WebGL (Three.js) `WARNING: Output of vertex shader 'flakeUv' not read by fragment shader` warning and `flakeScale`

I've checked quetions about similar issues, but found no solution. I have declared varying vec2 flakeUv; for both vertex and fragment shaders, but for some reason it doesn't go from one to another, while other parameters (like vUv) work fine. There…
Dmitry Tabakerov
  • 441
  • 7
  • 17
-1
votes
1 answer

How to render closest vertex in OpenGL fragment shader

I want to render a 2D image rendered from a 3D model with model, view and perspective projection transforms. However for each pixel/fragment in the output image, I want to store a representation of the index of the vertex in the original mesh which…
Dave Durbin
  • 3,562
  • 23
  • 33
-1
votes
1 answer

Vertex gradient shader rotation?

I have a shader that allows me to create and rotate a 2 or 3 color gradient. My problem was that it was very heavy on the GPU, so I moved this part of the code from the fragment shader to the vertex shader: fixed4 frag (v2f i) : SV_Target …
-1
votes
2 answers

UV Sphere - Getting Rid of join/vertex "dots"

I am creating a UV sphere (similar to an Earth globe divided into lines of latitude). I am doing this by: Calculating all of the vertices around each each parallel latitude circle (e.g. 72 points per circle) Using GL_TRIANGLE_STRIP to fill in each…
SparkyNZ
  • 6,266
  • 7
  • 39
  • 80
-1
votes
1 answer

add fragment on another fragment in frame layout

I gonna add one fragment to another fragment in frameLayout but I do not want to replace. I gonna when click on button second fragment show up and when click on back key second fragment hide now . I do not want first fragment destroyed . what should…
-1
votes
1 answer

How to fix shader invert y on IOS

This is shader to make UI blur. This shader work fine with android, but the y is invert on IOS device. I try to search for an answer but I don't understand how to implement it. Because it is using MainTex, but in my case I use grabpass. This is the…
Tengku Fathullah
  • 1,279
  • 1
  • 18
  • 43
-1
votes
2 answers

how do i set UV coordination from Texture value without noise in HLSL

i have UV render pass ( RG image ) i want to set the uv pass texture value to UV Coordinate without noise when i test it the result should pixlate noise like the below image i have tested it in other shader languages like cgprogramm and…
ehsan wwe
  • 71
  • 2
  • 9
-1
votes
1 answer

Replace alpha for texture into the shader

I try to implement DOF effect in my shader. In the shader I have color texture + offset for blurring. I need to add offset for RGB and my own A channel, which I make in the shader before. How can I replace the alpha channel in one step? I can't to…
javierMarquez
  • 142
  • 2
  • 10
-1
votes
1 answer

Why is my texture mapping with my fragment shader generating lines at texture coordinate jumps?

I'm having a lot of trouble with mapping an equirectangular panorama image on to a simple plane. So far i've got the mapping correct so everything shows up exactly where it should. But my problem is that at the point where my texture coordinates…
HenrikD
  • 241
  • 2
  • 10
-1
votes
1 answer

How are colour-values interpolated in a Gouraud-shaderscript?

The gouraud-shader computes lighting at the corners of each triangle and linearly interpolates the resulting colours for each pixel covered by the triangle. How would you program this certain interpolation (in GLSL-code) ? Do you even have to code…
user1511417
  • 1,880
  • 3
  • 20
  • 41
-1
votes
1 answer

learnopengl tutorial fragment shader for 2 points light

I have been following www.learnopengl.com tutorial and tried to load models using the method described. It works until the very end where it asks you to load the nanosuit with 2 points lights. I have copied the exact code from the tutorial with:…
2A-66-42
  • 554
  • 1
  • 5
  • 18
-1
votes
2 answers

What is faster - varying or manual interpolation in fragment shader?

What is faster - letting a varying to interpolate texture coordinates (and some other gradually changing coefficients) or calculating them manually in fragment shader? One would think that the answer to this is obvious, but then I stumbled upon…
jayarjo
  • 16,124
  • 24
  • 94
  • 138
-1
votes
1 answer

OpenGL ES2.0: What's wrong with these shaders?

I'm trying to follow a FreeType2 tutorial here but I cannot get the shaders to link. Is there something wrong with these shaders? Vertex shader: attribute vec4 coord; varying vec2 texcoord; void main() { gl_Position = vec4( coord.xy, 0, 1 ); …
SparkyNZ
  • 6,266
  • 7
  • 39
  • 80
-1
votes
1 answer

GLES Shader Lookup produces all white or strange colors

I have made a simple Open GLES 2.0 shader on iOS where it works without problems and now I am attempting to do the same for GLES 3.0 on Android (5.1) compiling with the lastest NDK 10e. But now I get an all white output or really strange colors. The…
bits
  • 309
  • 2
  • 11
-1
votes
1 answer

How make a ticket booking app like BookMyShow

I am building an app which has similar functionally like booking tickets in BookMyShow app. In my application there are free seats and reserved seats which can be distinguished by color. Also if an user selects a seat that seat be highlighted(or…
1 2 3
99
100