Questions tagged [fragment-shader]

The tag has no usage guidance.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
891 views

OpenGL texelFetch causes black stripes

THE SHORT VERSION In my fragment shader I'm reading (using texelFetch) multiple times the same texel from a texture (created by another fragment shader) and write it to the output render buffer. ...
5
votes
1answer
453 views

How to match Blenders polynomial lens distortion model with GLSL?

I'm trying to re-implement Blenders (libmv) polynomial lens distortion model using shadertoy, in order to apply the lens distortion in another application ideally by generating a STMap for that. I ...
5
votes
1answer
1k views

Manually fetching 8 neighboring texels from 3D texture greatly decreases performance

I'm implementing manual interpolation between texels in a 3D texture to be able to discard some of them when needed. Compared to hardware interpolation, this process takes a lot of time. If I simply ...
3
votes
0answers
82 views

Trying to optimize texture mapping

We are developing a PPI plot for a radar system, similar to the following: NOTE: 1 radial is defined as a single slice of data within the circle, and 1 range gate is defined as a single point along a ...
2
votes
0answers
112 views

Calculate the distance between two 3d points in screen coordinates

Given the Point A with the coordinates gl_FragCoord.xy, I have to find the distance to the Center of the cube face to which it belongs in screen coordinates. ...
2
votes
0answers
76 views

How can I draw a line whose position is given in UV space and its width in screen space?

In a fragment shader, I need to draw a line at a given value of u. The shader is applied to a planar polygon mesh that's being drawn in the scene with a perspective camera. (It isn't a full-screen ...
1
vote
1answer
93 views

OpenGL transparency - object behind is not rendered

I'm trying to implement voxel world using OpenGL (Core 3.3). I've come across a problem with transparency. It looks like sometimes GPU decides to not render stuff that would be important. Can you help ...
1
vote
0answers
134 views

How could I remove this colour interpolation artefact across a quad?

I've been reading up on a vulkan tutorial online, here: https://vulkan-tutorial.com. This question should apply to any 3D rendering API however. In this lesson https://vulkan-tutorial.com/...
1
vote
0answers
56 views

Anti aliasing thin features in textures

Assume I have a texture with a repeating line pattern. The lines are exactly 2 texels wide (really thin). Ans very spaced out (50 texels in between each line). I am now struggling with the ...
1
vote
0answers
118 views

Veldrid: Only execute fragment shader

Having an HLSL shader like this: ...
0
votes
0answers
12 views

Question regarding Memory-Efficient Order-Independent Transparency with Dynamic Fragment Buffer

I am currently reading the pdf regarding Memory-Efficient Order-Independent Transparency with Dynamic Fragment Buffer. in there it is proposed to do two steps before sorting the fragments: First, for ...
0
votes
0answers
51 views

Examples of cases where you write depth value in Fragment Shader?

I've very less knowledge when it comes to rasterization and typical rendering in games and other applications. So I was reading up on the rendering pipeline and found that the hardware could do early ...
0
votes
0answers
39 views

Order Independent Transparency: How to approach sorting

In an "Order Independent Transparency" implementation, one faces sorting a large amount of (as many as the number of pixels in the viewport) sets of data with relatively small number of ...
0
votes
0answers
13 views

Calculating Bounding Boxes from JFA

I am working on getting bounding boxes from images using the GPU, I am using as an example this article by demofox which has included some shadertoy examples. The JFA algorithm is like this: ...
0
votes
0answers
18 views

Rendering different array types in the same vertex/fragment shader?

I have a pretty basic widget rendering, largely based upon the learnopengl.com "hello triangle." I'm actually using a tristrip to create two triangles, forming a semi-opaque square over the ...
0
votes
0answers
46 views

GPU accelerated 2D graphics library with signed distance functions

I want to create my own 2D graphics library using signed distance functions where everything is drawn on the GPU. Browsing the web I quickly found Inigo Quilez website that describes how to draw basic ...