1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00
OpenMW/files/shaders/debugDraw_vertex.glsl
florent.teppe 93af569a68 can place a cube at 0,0,0 Useless for now
Arbitrarly draw cubes at certain position with a certain color

Adds exemple of how it looks in the actor update code.

draws a green cube if alive, red else
2022-09-11 17:53:41 +02:00

27 lines
491 B
GLSL

#version 330 compatibility
uniform mat4 projectionMatrix;
// vec4 mw_modelToClip(vec4 pos);
// vec4 mw_modelToView(vec4 pos);
// vec4 mw_viewToClip(vec4 pos);
uniform vec3 passColor;
uniform vec3 trans;
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 + trans, 1.);
vertexNormal = aNormal;
vertexColor = passColor.xyz;
}