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.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

How to implement an openGL ES2.0 shader in threeJS

The Goal I'm attempting to convert a shader written in an Android friendly GLES20 syntax to something that will work with the likes of threeJS. Most of the uniforms for the fragment shader are ...
0
votes
0answers
28 views

I change texture's color but text in the texture disappears in WebGL

I have a icon like this. I want to change the color of the texture by using webgl shader, for example I want to change yellow. I do it but text in the texture disappears. My shader code var ...
0
votes
0answers
22 views

HBAO shader odd gradient on floor

I have been trying to implement the HBAO technique using GLSL and Vulkan however I am coming across some odd results which are not described or mentioned in the original paper. I am seeing a gradient ...
0
votes
0answers
21 views

Flatten Sampler2D to 1D WebGL

I'm encoding a large array into a texture that I can reference in my glsl shader. The array is far to long to encode in a 1d array, so I encoded it as a 2d array. Now I would like to reference each ...
0
votes
0answers
22 views

Opengl fragment shader code to flatten a circle to a rectangle

I am trying to flatten a circle shape on the input texture as a rectangle as shown in the image. Is there any way to perform that with fragment shader alone? Any help would be appreciated. Thanks
0
votes
0answers
28 views

GLSL fragmentshader like css clippath

Is there a way to "crop" of a certain part of an image with a fragmentshader like with a css clippath? I am trying to do this on a three js texture and I have gotten this from prisoner849: ...
2
votes
2answers
57 views

Optimizing pixel-swapping shader

I'm using a shader that swaps colors/palettes on a texture. The shader checks a pixel for transparency and then sets the pixel if not transparent. Is there an efficient way to ignore 0 alpha pixels ...
1
vote
1answer
54 views

GLSL : Why are my calculated normals not working properly

I am trying to follow the Ray Tracing in one Weekend tutorial and my normals do not look like i expect them to look. float hit_sphere(Sphere sphere, Ray r){ vec3 oc = r.origin - sphere.center; ...
0
votes
1answer
15 views

Three JS Palette Cycling Shader

I'm implementing a palette cycling shader in THREE.js (my first shader). All is working so far, but I'm struggling in that fact that I'm: Unable to pass a dynamically sized array of pixels into ...
0
votes
0answers
51 views

Fragment discard and early fragment tests in practice

I understand that hardware can run early fragment tests (https://www.khronos.org/opengl/wiki/Early_Fragment_Test) In particular for depth test, this means that the depth buffer can be updated already ...
0
votes
2answers
30 views

Normalized uv for shaderModifiers .fragment attached to SCNGeometry (SCNPlane)

seems quite difficult for me to get this info so I will ask here directly. Q: How do I get the correct normalized UV when dealing with shaderModifiers .fragment attached to a geometry in a SCNNode? ...
0
votes
0answers
24 views

GameMaker: Applying shader to texture

I've created 14 different color palettes of 4 colors each and I've stacked them vertically in a sprite. I want to use this sprite to swap the colors of a texture via a shader. I have this in the ...
1
vote
0answers
50 views

Runge kutta in GLSL exploding

I am trying to play with the approach in the following Shadertoy https://www.shadertoy.com/view/lsKGRW When I tried to do this myself using my own fragment shader, my Runge Kutta just kind of "...
0
votes
0answers
20 views

Depth buffer seems to render within the scene

Been implementing SSAO and I notice this grey like haze over the output image. I have assumed it's the depth buffer? Unsure as to what this actually is or what might be causing this. I am using Vulkan ...
0
votes
1answer
47 views

Translate shadertoy texture to webgl not behaving the same

I'm able to translate the code and run it, but it behaves diferrent from the orginal fork. https://www.shadertoy.com/view/llS3zc --orignal https://editor.p5js.org/jorgeavav/sketches/i9cd4lE7H - ...

15 30 50 per page
1
2 3 4 5
90