WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Matrix Inputs for Vertex Shader (https://forum.worldviz.com/showthread.php?t=6420)

apenngrace 02-06-2023 08:49 AM

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!


All times are GMT -7. The time now is 08:38 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC