glsl Questions
2
Solved
In this Three.js shader example a function called rand() (taking a vec2 as an argument) is used to generate random numbers.
However, the function is not defined in the shader code. Instead, it see...
Dextrality asked 25/1, 2018 at 9:15
3
Solved
I am having problems getting my GLSL shaders to work on both AMD and Nvidia hardware.
I am not looking for help fixing a particular shader, but how to generally avoid getting these problems. Is it...
6
Solved
I want to shade a quad with checkers:
f(P) = [floor(Px) + floor(Py)] mod 2.
My quad is:
glBegin(GL_QUADS);
glVertex3f(0,0,0.0);
glVertex3f(4,0,0.0);
glVertex3f(4,4,0.0);
glVertex3f(0,4, 0...
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
1
Solved
I've got a texture that I want to use as a indirect radiance light.
There is a problem that when I sample this texture's lowest mip the result looks like this:
but actually should look like this:
...
2
Solved
Is this a per device sort of thing? Or is it based on the browser? Sorry for such a basic question but I cant seem to find a straight answer.
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
3
Solved
I am working at a WebGL project by TypeScript. There are many shaders written by glsl, and I want to import them as string in my ts file. Like:
import fxaa from "./shaders/fxaa";
const fxaaShader ...
Provoke asked 12/2, 2018 at 7:41
2
Solved
I am using the ARB_debug_output extension. The driver gives me this warning:
Program/shader state performance warning: Vertex shader in program 16 is being recompiled based on GL state.
So, I tri...
Desegregate asked 12/8, 2019 at 2:1
4
Solved
Trying to play around with shaders on the browser and just installed the GLSL Lint extension for VSCode, which apparently needs to know the path to a glslangValidator binary before working properly...
Germany asked 23/9, 2020 at 19:16
2
So I am still getting upvotes for my ancient comment on this question: What's the origin of this GLSL rand() one-liner?
And it got me thinking, what would a good GLSL hash function look like? ...
2
Solved
Trying to write the following recursive call:
vec3 trace(vec3 origin, vec3 direction, vec3 illum, int order)
{
float dist;
int s_index = getSphereIntersect(origin, direction, dist);
//if lig...
Sandie asked 25/4, 2017 at 4:20
2
Solved
I need to get the maximum of a vec3 in GLSL. Currently I am doing
max(max(col.r, col.g),col.b)
It works. But I am wondering if there a better way to do this with one built-in function call?
4
Solved
I need an acos() function with double precision within a compute shader. Since there is no built-in function of acos() in GLSL with double precision, I tried to implement my own.
At first, I imple...
Mahau asked 10/3, 2015 at 16:33
5
Solved
3
I am trying to add lighting to my current scene of a simple cube. After setting up my uniforms I get a 1282 error from glGetError() for this piece of code
GLuint ambientHandle = glGetUniformLocati...
2
Solved
I'm trying several ways to implement a simple particle system.
Here i am using the ping-pong technique between several textures, all attached to an unique fbo.
I think all the bindings/setup are c...
1
Solved
Example code
Here is a bare-bones compute shader to illustrate my question
layout(local_size_x = 64) in;
// Persistent LIFO structure with a count of elements
layout(std430, binding = 0) restric...
Lonilonier asked 5/12, 2017 at 20:17
3
Solved
I was confused about the VBO,
glGenBuffers(1, &positionBufferObject);
glBindBuffer(GL_ARRAY_BUFFER, positionBufferObject);
Besides GL_ARRAY_BUFFER, there are other target types: GL_ATOMIC_C...
4
Solved
I can't seem to find a clear answer on this, despite hours of googling. Can someone just tell me what's going on? I get errors saying things like, "version 140 is not supported." Is this my device ...
Ardithardme asked 15/1, 2012 at 18:16
4
Solved
I've been working on a game engine for educational purposes and I came across this issue I cannot seem to find an answer for:
Alpha channel only works for objects that have already been drawn befo...
2
I am trying to render 3D prisms in LWJGL OpenGL with flat shading. For example, I have a cube indexed as following:
I only have 8 vertices in the vertex buffer, which I have indexed as above. I...
Crescantia asked 2/2, 2020 at 1:42
3
Solved
I'm trying to write a shader that uses many bit operations. In fact they are supported since glsl 1.30, but I'm only on OpenGL 2.1.
Is there any way to use bit operations with my OpenGL version?
Cumin asked 9/7, 2011 at 11:45
3
Solved
There is no inverse command in glsl es 2.0
But I saw that I can 1.0/mat2 . But I fear it'll just divide component wisely. Or not? But if so, is there some trick for this (get 1/det fast)?
7
Solved
i'm trying to code correct 2D affine texture mapping in GLSL.
Explanation:
...NONE of this images is correct for my purposes. Right (labeled Correct) has perspective correction which i do not w...
Fajardo asked 13/9, 2012 at 20:59
1 Next >
© 2022 - 2024 — McMap. All rights reserved.