View Single Post
  #1  
Old 02-06-2023, 08:49 AM
apenngrace apenngrace is offline
Member
 
Join Date: May 2015
Posts: 13
Matrix Inputs for Vertex Shader

In a vertex shader using Vizard, I understand that this GLSL pattern currently works fine:

Code:
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
However, what is the suggested way to set-up the data on the Vizard side to use GLSL code that looks more like this?

Code:
uniform mat4 projMat;
uniform mat4 viewMat;
uniform mat4 modelMat;

layout (location = 0) in vec3 position;

void main()
{
    gl_Position = projMat * viewMat * modelMat * vec4(position, 1.0);
}
Thanks for your help!
Reply With Quote