Questions tagged [shader]
For all questions related to shaders, i.e. the programmable part of the GPU pipeline. For language-specific shader questions, see also the [glsl] and [hlsl] tags.
275 questions
0 votes
1 answer
11 views
How to rotate at center of instance?
How do I rotate around the instance itself instead of the rotating the entire shader? You can see what I mean by rotating the entire shader in the images below: Here is the main.c: ...
0 votes
1 answer
55 views
Switch between different OpenGL shaders involving uniform variables
When I switch between two different OpenGL shaders instances do I need to re-upload the uniform variables. For example I have a shader that have a Project and View matrix uniforms defined: ...
0 votes
0 answers
61 views
Single vs Multiple Command Buffers for Render to Texture in Metal: Which is Better?
When should you use single command buffer vs multiple command buffers for Render to Texture (RTT) in Metal? I am implementing a Render to Texture (RTT) technique in Metal, and I’ve come across two ...
0 votes
1 answer
77 views
Applications of the outer product in shaders
I've been reading through the specification of OpenGL ES 3.20 and found a built-in "outerProduct" function for computing the outer product of two vectors, specifically, outerProduct(a,b) = $...
1 vote
2 answers
99 views
Confusion about camera ray pdf
When I was studying a code base of path tracing implementation (done in GLSL), I notice the author returned a pdf of generated camera ray: ...
0 votes
1 answer
96 views
How to achieve smooth max of two coordinates in a shader
I am trying to achieve a border effect to a square tile on a xz plane. I am using max of coordinates x and z to achieve that. Here is my ShaderLab code: ...
2 votes
0 answers
64 views
How does this wormhole effect shader create a distortion?
Below is the code for a simple wormhole effect shader made in shadertoy.com. I understand everything else except: ...
1 vote
1 answer
201 views
Vertices are mapped to UV coordinates, but how does the shader access the UV data?
So in every mesh, the vertices can have UVs, and UVs are a way to store data for each vertex. Basically, at the time of rendering, when the shader runs, it's a way to check some arbitrary data for ...