WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 02-06-2023, 08:49 AM
apenngrace apenngrace is offline
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:

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?

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

glsl, shader

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shader problems Strannix Vizard 0 10-06-2016 02:50 PM
Shader Trouble leoaered Vizard 8 10-03-2012 12:42 PM
Projection Matrix (onto oblique near plane) andrewjworz Vizard 1 07-13-2012 09:10 AM
Multiple Textures for Diffuse and Specularity Shader Issue shivanangel Vizard 1 05-11-2009 10:44 AM
Specular Shader Issue shivanangel Vizard 2 05-06-2009 11:08 AM

All times are GMT -7. The time now is 07:34 PM.

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