Questions tagged [glsl]

The OpenGL Shading Language (GLSL) is the standard programming language for shaders in OpenGL. There are many versions of the language, with each version corresponding to a version of OpenGL. OpenGL ES 2.0 and above have separate versions of GLSL.

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

WebGL Shader, modify position according to variable

I'm following the advice in this SO post. I want this blob to turn into other 3D models and back (like this). This set me on the path of Morphing, but I want to use shaders. The SO post (first link) ...
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

GLSL raycasting fragment shader [closed]

I recently started using GLSL and wrote a small fragment shader to raycast a sphere. Shader takes as input the radius, coordinates of center, pixel's coordinates and return pixel's color. Now I want ...
1
vote
0answers
31 views

Read write an image with the GL_ARB_fragment_shader_interlock extension

I am testing whether the GL_ARB_fragment_shader_interlock extension can execute the critical section code of the same pixel position in the order of instance rendering. I used instanced rendering to ...
1
vote
1answer
36 views

How to use multiple Uniform Buffer Objects

In my OpenGL ES 3.0 program I need to have two separate Uniform Buffer Objects (UBOs). With just one UBO, things work as expected. The code for that case looks as follows: GLSL vertex shader: version ...
1
vote
1answer
34 views

Specular materials not working as intended in pygame

The problem I'm trying to make a basic specular material shader in pyglet, but it does not work as intended. It does not render the part behind the transparent cube, and just gives this wierd output ...
0
votes
0answers
17 views

shaderc on windows never calls include method?

I am trying to use shaderc on windows (it works successfully on Linux). I extended the includer class as described in the documentation: class NEShaderIncluder : public CompileOptions::...
0
votes
0answers
21 views

Do samplers that are not used at runtime in a Vulkan/GLSL shader need to be bound? [duplicate]

Please consider the following Vulkan/GLSL shader: layout(push_constant) uniform P { int flag; } p; layout(set = 0, binding = 0) uniform sampler2D S; layout(location = 0) in vec2 X; layout(...
1
vote
0answers
43 views

OpenGL - How to properly add lighting to a scene using the Blinn-Phong shading model?

Recently, I have been trying to add lighting to a simple OpenGL scene using the Blinn-Phong shading model as described in this website. I tried to follow the tutorial as closely as possible. However, ...
1
vote
1answer
45 views

How can I get a random uint or the last digit of float in HLSL/GLSL?

I just need a random uint, better ranging from 0-6, but there is no enumeration type in openGL. I learned that I can get a random float ranging 0-1 from the code below: frac(sin(dot(uv, float2(12.9898,...
0
votes
0answers
27 views

How do I get layout of struct matching between C and Vulkan/GLSL? [duplicate]

I have a struct like this host-side in C: // in myprogram.c... struct S { int a; vec3 b; float c; float d; }; and on at least one of our host platforms it is laid out as follows: ...
1
vote
1answer
20 views

How to avoid GLSL copy by value?

The following code: layout (set = 0, binding = 0) readonly buffer TestBuffer { float[32] probs; } args; void main() { const float[] ps = args.probs; } creates a deep copy of the float array, ...
1
vote
1answer
16 views

glTexImage2DMultiSample - fixedsamplelocations set on false, getting samples count

I use glTexImage2DMultiSample with fixedsamplelocations parameter set on false. Then texels may have different samples count. How can I check samples count for a texel in the fragment shader ? Is the ...
0
votes
0answers
7 views

OpenGL (with OpenTK) isn't displaying square

I'm using the following code to display multiple textured Squares in a 3D-Environment, but there is not a single Square showing up (OpenGL doesn't output any errors), but I'm able to see my Background-...
2
votes
1answer
30 views

Creating a waving surface in a shader

I created a waving surface in the vertex shader. Vertex shader: #version 300 es precision lowp float; uniform mat4 u_mvpMatrix; uniform sampler2D s_texture; in vec4 a_position; out vec2 ...

15 30 50 per page
1
2 3 4 5
493