1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-29 04:20:29 +00:00
OpenMW/files/shaders/debugDraw_vertex.glsl
florent.teppe bd1bbc0ab8 removes mutex, and uses double buffering to avoid writing on a resource that will be read by the draw thread
changes when the buffers are reset -> at the end of the draw, because that's when we are certain the data isn't needed anymore

removed useless variable
fixed typo
include osg::vec3 instead of osg vec3f

compile linux

compile ?

applied clang format to the new files
2022-09-11 17:53:56 +02:00

23 lines
512 B
GLSL

#version 330 compatibility
uniform mat4 projectionMatrix;
uniform vec3 color;
uniform vec3 trans;
uniform vec3 scale;
uniform int useNormalAsColor;
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec3 aNormal;
out vec3 vertexColor;
out vec3 vertexNormal;
void main()
{
gl_Position = projectionMatrix * gl_ModelViewMatrix * vec4(aPos * scale + trans, 1.);
vertexNormal = useNormalAsColor == 1 ? vec3(1., 1., 1.) : aNormal;
vertexColor = useNormalAsColor == 1 ? aNormal : color.xyz;
}