Questions tagged [shader]

A shader is a program to perform calculations on geometry or pixel data in computer graphics.

A shader is a program to perform calculations on geometry or pixel data in computer graphics. With the rapid progress and availability of consumer GPUs during the last decade, an initially software-only solution for high-end RenderMan workstations became widely available. Today, the term is mostly associated with , , , or , which allow convenient, hardware agnostic high-level programmability on consumer GPUs.

6931 questions
2
votes
0 answers

Shader produces bad texture

I'm trying to make a shader that will draw a tile on the roof (a mesh object generated point by point in the code). It looks pretty good on the CUBE, but it's very bad on my mesh. What am I doing wrong? For the tile I have: texture height…
DevNet
  • 57
  • 6
2
votes
1 answer

Can't read a FORMAT_R8 uniform sampler2D texture correctly from within a shader in Godot

I need to pass an array of integers to a shader as a uniform. As uniform arrays are not yet supported, I'm using a FORMAT_R8 texture/isampler2D to achieve this. If I'm correctly reading the bytes from the texture, they should be in the range [0..7]…
Petruza
  • 11,744
  • 25
  • 84
  • 136
2
votes
1 answer

OpenGL Won't Render With Shaders Mac

I'm trying to get OpenGL to render a basic triangle with shaders on my newer Macbook Pro with the M1 chip. I'm stuck using Qt Creator as well. I was able to set it up and get a basic Fixed-Pipeline scene rendering, but when I changed the version to…
devCorner
  • 193
  • 4
  • 15
2
votes
1 answer

Projecting and offseting vertices in shaders in OpenTK 3.3

I am trying to get to work a polygon class for OpenGL using OpenTK. The goal is to make an instance of the class, pass it an array of vertices in pixel coordinates, and have it drawn to the screen properly. The way I intend to achieve this is to use…
user14120696
2
votes
1 answer

how to pass shader COLOR on ALBEDO

ALBEDO is vec3 and COLOR is vec4.. I need make pass COLOR to ALBEDO on Godot.. This shader work on shadertype itemscanvas but not working on spatial material.. shader_type spatial; uniform float amp = 0.1; uniform vec4 tint_color = vec4(0.0,…
2
votes
2 answers

WebGL alpha depending on distance from origin

I have the following setup: The plane grid consists of lines, with brighter dots where lines intersect. I would like to introduce an alpha gradient on the entire scene, with the current alpha (0.2) at the very centre, linearly fading to 0.0 at the…
user11813319
2
votes
2 answers

How to draw a circle instead of an ellipse when your monitor screen resolution isn't square?

I'm working with WebGL and I'm trying to clip away what I'm drawing to draw a circle, but currently it's drawing an ellipse instead. Here is my fragment shader: void main() { vec4 c = vec4((u_matrix * vec3(u_center, 1)).xy, 0, 1); // center …
Ryan Peschel
  • 11,087
  • 19
  • 74
  • 136
2
votes
1 answer

Shader warning in 'Master': implicit truncation of vector type

I get these warnings whenever I save changes in any shader file. It does not seem to relate directly to the shader files, since it works perfectly in a new project. Unfortunately it seems impossible to open this "Master" shader and edit it, double…
Lyxodius
  • 344
  • 1
  • 5
  • 12
2
votes
1 answer

PBR shader is too transparent

I have this shader: And this is the result: How can I make the grass less transparent, I swaped over from HDRP to URP and there is only PBR shader i know how to use.
2
votes
1 answer

Is there a way to merge textures in Unity in a shader?

I'm trying to animate a 2D game object using several overlaid layers of images in one mesh renderer. I've got several layers of different textures, each is an image with a transparent background. I've found a way to programmatically create a…
Mir
  • 305
  • 8
  • 24
2
votes
1 answer

glBindImageTexture is not correctly binding a 3D texture to an image unit

I'm trying to bind a 3D texture to an image unit in OpenGL. Current shader code: #version 450 core out vec4 OutBuffer; in GS_OUT { vec3 Position; vec4 ScreenPosition; vec3 Normal; vec2 TexCoords; } fs_in; uniform uvec3…
William
  • 63
  • 1
  • 8
2
votes
1 answer

Is there a double floating point data type in Godot shaders?

I'm trying to use shaders in Godot and I need a really precise calculation (more than float). Is it possible to have a double in Godot shaders? I searched the documentation but I found nothing... Edit: I've made a Mandelbrot set explorer and with…
Billy
  • 55
  • 6
2
votes
2 answers

iOS SceneKit what is inversedTransform? (for dummies)

I'm new to the 3D rendering with Metal and SceneKit. I see that there is a specific "inverse" transform required to be passed to the renderer / shader. I printed out the transforms, and see no relationship between them. Google search results in a…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
2
votes
1 answer

Non-monotonic depth buffer; cyclical overlapping in OpenGL

Is it possible to implement custom depth buffer values so that I can implement a non-transitive ordering? E.g. Red > Green Green > Blue Blue > Red Which I imagine would be implemented in the fragment shader or something, only writing the pixel if…
Patrick
  • 677
  • 5
  • 14
2
votes
1 answer

Different OpenGL behaviour on different hardware

I have an application that uses OpenGL to draw output images. For testing purposes I'm trying to create reference images and then use precision hash to compare them to program output. While it works flawlessly within a context of a single computer…
Gaxx
  • 85
  • 7