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

Processing multiple light pixel Shader in GLSL

i have written a fragment shader that works just fine with a single light. Now I am trying to adapt it to work with 8 lights, the implement it in Processing. Clearly I am doing something wrong in the math and I cannot see what it is... I have read…
eneko
  • 333
  • 4
  • 14
-1
votes
1 answer

Fragment Shader IN variable causes nothing to appear

I'm trying to send a variable from my vertex shader to my fragment shader, but when I include a specific the in variable in an if statement, it causes nothing to show up. Removing the if statement causes everything to appear and work normally.…
Daniel
  • 2,435
  • 5
  • 26
  • 40
-1
votes
1 answer

GLSL vector value size is too big on mobile platform

I have made some full screen renders using OpenGL ES 2.0 on Andorid devices. In these renders I used a custom fragment shader that uses a uniform time parameter as part of the animation. I have experienced major image tearing/massive fps drops and…
-1
votes
1 answer

how to get original fragment color in fragment shader

I am writing a tile based image viewer for my application using JOGL. The image is divided in the grid of tiles. I am rendering textures for each tile based on the current zoom scale. My each tile rendering code looks like following: double…
Amay
  • 63
  • 5
-1
votes
1 answer

Is this GLSL program correct? My cubes are solid black

My phong fragment shader is not shading anything, just making everything black. This is my fragment shader precision mediump float; varying vec3 vposition; varying vec3 vnormal; varying vec4 vcolor; varying vec3 …
samsun96
  • 320
  • 3
  • 14
-1
votes
1 answer

OpenGL Shader failed to work

I tried to use my own vertex shader and fragment shader in my OpenGL project. Both the program itself and the shader programs were compiled and linked successfully but neither the vertex shader nor the fragment shader worked. I managed to make some…
Grillnov
  • 13
  • 4
-1
votes
1 answer

Opengl glsl can't mix 2d textures and 3d textures

[Edit2]: Nothing wrong with this code. My shader class didn't load the uniforms correctly. [Edit]: It seems like I can only use GL_TEXTURE0/texture unit 0 by some reason. What I want is to draw a 2d texture and a 3d texture, but only the texture…
-1
votes
1 answer

LibGDX ShaderProgram is not compiled on Android device

I am using LibGDX and have a simple fragment shader: #ifdef GL_ES #define mediump lowp precision mediump float; #else #define lowp #endif uniform sampler2D u_texture; uniform vec2 iResolution; uniform float iGlobalTime; uniform float glow;…
Nolesh
  • 6,848
  • 12
  • 75
  • 112
-1
votes
1 answer

GLSL Shaders - Fragment shader not compiling

I just wrote this shader and it doesn't compile, I have been searching for hours and even checked validators I can not find what is the compilation error. This is my last resort, can anyone spot anything wrong here? #version 150 core uniform…
Amit Assaraf
  • 512
  • 11
  • 34
-2
votes
1 answer

Three.js - How to Rotate Shader Material?

My problem is trying to get the sky to rotate on its z-axis. For example if I rotate the sky by 180 degrees the shadow from the sun light should display in the opposite direction. The code sandbox:…
-2
votes
1 answer

WEBGL: How to Color a Fractal Design within the Fragment Shader

I am looking to color a fractal within my fragment shader in an WebGL project. Within my fragment shader, I have a vec3 called Color that contains the RGB values from 0.0-1.0. To make a fractal design similar to but in black and white, what…
-2
votes
1 answer

GLSL shader to boost the color

Is their any GLSL shader that can help me to "boost" the color of a texture ? How to write such shader ? I would like to do something like the picture below :
zeus
  • 12,173
  • 9
  • 63
  • 184
-2
votes
1 answer

converting a ShaderToy in to Webgl shader for the Three js ( need help )

Can you help me pls to translate this shader into three js! this shadertoy it tried in this way and just get a white screen! #ifdef GL_ES precision mediump float; #endif #define F length(.5-fract(gl_FragColor.xyw*=mat3(-2,-1,2, 3,-2,1,…
-2
votes
1 answer

Getting exact pixel from texture

I have a question about textures in OpenGL. I am trying to use them for GPGPU operations but I am stuck at beggining. I have created a texture like this (4x4 int matrix). OGLTexImageFloat dataTexImage = new OGLTexImageFloat(4, 4,…
Pogasta
  • 117
  • 1
  • 14
-2
votes
2 answers

How to make visible uniform variable in both shaders?

I have variable in vertex shader "uIsTeapot". uniform float uIsTeapot; Vertex shader work with it very well, but fragment shader don't see it. If I use if (uIsTeapot == 0.0) then an error occured "uIsTeapot": undeclared identifier but I defined…
Log
  • 433
  • 4
  • 19
1 2 3
99
100