fragment-shader Questions
3
Solved
I want to access the depth buffer value at the currently processed pixel in a pixel shader.
How can we achieve this goal? Basically, there seems to be two options:
Render depth to texture. How c...
Poff asked 29/4, 2014 at 10:29
3
Solved
I have this:
float xExponential = pow(xPingPong, 5);
And is not working, claiming:
ERROR: 0:53: No matching overload for call to function 'pow'
Am I doin' something wrong?
Developing for i...
Bandicoot asked 6/5, 2012 at 15:3
2
Solved
I'm working on an application where I would like to take a single integer input (basically a color) and, using WebGL shaders, color a box with the given input. I planned, originally, to do this wit...
Whitefaced asked 6/4, 2014 at 14:15
2
Solved
For my game I have written a shader that allows my texture to tile nicely over multiple objects. I do that by choosing the uv not based on the relative position of the vertex, but on the absolute w...
Emulsoid asked 3/4, 2013 at 8:52
3
Solved
I would like to have two pixel shaders; the first doing one thing, and then the next doing something else. Is this possible, or do I have to pack everything into the one shader?
Industrialize asked 26/2, 2010 at 19:29
3
Solved
I'm fairly new to Shadertoy and GLSL in general. I have successfully duplicated numerous Shadertoy shaders into Blender without actually knowing how it all works. I have looked for tutorials but I'...
Stubblefield asked 3/11, 2019 at 20:27
2
Solved
I'm working on porting a ZUI from SVG over to WebGL for a few reasons, and I'd like to render a grid using a fragment shader.
Here's the basic effect I'm going for https://dl.dropboxusercontent.co...
Petrel asked 16/7, 2014 at 5:8
2
I'm using the following code taken from this tutorial to perform linear filtering on a floating point texture in my fragment shader in WebGL:
float fHeight = 512.0;
float fWidth = 1024.0;
float te...
Psalmbook asked 4/2, 2016 at 8:54
1
Solved
I would like to calculated the 2D Gaussian function and the input is X,Y texture UV coordinate and get the corresponding gaussian value.
I'm facing difficulties on how to get the corresponding Texe...
Transonic asked 26/11, 2020 at 15:59
1
Solved
In many examples over internet (such as webglfundamentals or webgl-bolerplate) authors used two triangles to cover full screen and invoke pixel shader for every pixel on canvas.
var canvas, g...
Gabriellagabrielle asked 16/3, 2019 at 13:27
3
Solved
I am following an OpenGL v3.3 tutorial that instructs me to modify a uniform attribute in a fragment shader using glUniform4f (refer to the code below). As far as I understand, OpenGL is a state ma...
Broadnax asked 27/9, 2020 at 14:34
5
Solved
I've been knocking around Shadertoy - https://www.shadertoy.com/ - recently, in an effort to learn more about OpenGL and GLSL in particular.
From what I understand so far, the OpenGL user first h...
Rixdollar asked 18/10, 2013 at 12:24
1
Solved
I'm creating a terrain mesh, and following this SO answer I'm trying to migrate my CPU computed normals to a shader based version, in order to improve performances by reducing my mesh resolution an...
Reina asked 22/6, 2020 at 17:1
1
I went through different sources and seen that we could draw a dotted line using a fragment shader. Because I am new to OpenGL I couldn't able to understand.
Can anyone share some code sample that...
Gad asked 19/2, 2020 at 5:20
1
Solved
I tried to write an application to display YUV image in OpenGL. I was successfully converted YUV to RGB in C++ using this snippet (source)
static long int crv_tab[256];
static long int cbu_tab[25...
Virge asked 18/2, 2020 at 3:56
2
Solved
In the fragment shader, values are naturally interpolated. For example, if I have three vertices, each with a color, red for the first vertex, green for the second and blue for the third. If I rend...
Sentimentalism asked 20/8, 2014 at 5:52
0
Let's consider this mcve:
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import textwrap
from string import Template
def compile(shader_type, source):
identifier = g...
Hallucinate asked 21/9, 2019 at 12:23
2
I am very new to the concept and use of shaders in SpriteKit.
I found this tutorial on how to render a Mandelbrot fractal with a custom shader file - Fractal.fsh - attached to a Color Sprite's Cus...
Battleship asked 18/12, 2018 at 7:51
1
Solved
I'm trying to write a fragment shader in Metal but can't get my head around how to pass in single values (e.g. float, float4 or half4). My shaders are as follows:
#include <metal_stdlib>
usi...
Mistymisunderstand asked 6/1, 2019 at 1:27
8
Solved
I'm wondering if anyone has complete, working, and efficient code to do bicubic texture filtering in glsl. There is this:
http://www.codeproject.com/Articles/236394/Bi-Cubic-and-Bi-Linear-Interpol...
Sidra asked 21/11, 2012 at 19:56
0
I need to draw a line between two spritnodes while hand is pointing from one node to another with rendering or animation.
The line drawing is working for me as I follow this link Bobjt's answer, An...
Sheffield asked 21/11, 2018 at 5:6
1
Solved
I am reading the red book OpenGL programming guide when I come across these two methods, which strikes me as unnecessary since we already can specify which color buffer the output is going to go to...
Mahmoud asked 25/6, 2018 at 18:51
0
Apple documentation says the MTKView current drawable default size is derived from the current view’s size, in native pixels. Is there any way to make MTKView current drawable half of the device's ...
Hardset asked 20/6, 2018 at 10:57
0
GLSL gives an error like this:
cannot convert from 'highp float' to 'highp 3-component vector of float'
T have picked the error part:
vec3 bRgb = texture2D(u_img1, vUv).rgb;
vec3 aRgb = texture2D...
Koerner asked 14/6, 2018 at 11:30
2
I would like to display thousands of points on a 3D canvas (in Processing) with a Depth of Field effect. More specifically, I would like to use a z-buffer (depth buffering) to adjust the level of b...
Obliquity asked 4/6, 2018 at 21:22
1 Next >
© 2022 - 2024 — McMap. All rights reserved.