Answer the question
In order to leave comments, you need to log in
Why does the vertex shader work so differently on different devices?
I have a vertex shader that multiplies a vertex by a normal and then projects it. Its task is to triangulate lines. Normals are calculated on the CPU. Line width is set by u_width
#version 100
attribute vec4 a_position;
attribute vec2 a_normal;
uniform mat4 u_proj;;
uniform float u_width;
void main() {
vec4 delta = vec4(a_normal * u_width, 0, 0);
vec4 new_pos = a_position+delta;
gl_Position = u_proj*new_pos;
}
matrix.scale(width,width,0);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question