Category "shader"

how to rotate and translate rectangle texture in shader

I'm trying to handle the transform of texture in fragment shader. the resolution of window is (640,360), the rotation is 30 degree, and the scale is vec2(0.5,0.

What does #pragma vertex vert_img do in a Unity shader?

While I built an idea of what vert_img does by observing results, I would like to read a more theoretical explanation that I couldn't find online. For context,

GLSL Shader does not compile, Java and LWJGL shader error

I've encountered this error a few times now when compiling my shaders. Here is the infoLog/Error Vertex shader failed to compile with the following errors: ERRO

OpenGL, diffuse shader

I'm trying to implement very simple diffuse shader in GLSL/openGL. Here's what I got: Vertex shader: #version 130 in vec3 vertPos3D; in vec3 vertNormal3D; un

Draw the midpoint lines between points

I am making generated shapes in a fragment shader and part of it involves drawing the border between objects ie the dividing line between them. Currently I have

How to colour vertices as a grid (like wireframe mode) using shaders?

I've created a plane with six vertices per square that form a terrain. I colour each vertex using the terrain height value in the pixel shader. I'm looking f