WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 02-06-2023, 09: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 03:50 PM
Shader Trouble leoaered Vizard 8 10-03-2012 01:42 PM
Projection Matrix (onto oblique near plane) andrewjworz Vizard 1 07-13-2012 10:10 AM
Multiple Textures for Diffuse and Specularity Shader Issue shivanangel Vizard 1 05-11-2009 11:44 AM
Specular Shader Issue shivanangel Vizard 2 05-06-2009 12:08 PM

All times are GMT -7. The time now is 08:26 PM.

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