Jump to content

Recommended Posts

Posted

Hi, i'm currently trying to translate a shader which is written in glsl 1.5 and i have some trouble to find the correct matrix values in Leadwerks:

 

vec4 getWorldPosition(vec2 coord)
{
vec3 view = getViewPosition(coord);
vec4 world = vec4(view.x,view.y,-view.z,1.0);
world = gl_ModelViewMatrixTranspose*world+gl_ModelViewMatrixInverse[3];
return world;
}

vec4 getCamPosition(vec2 coord)
{
vec3 view = getViewPosition(coord);
vec4 world = vec4(view.x,view.y,-view.z,1.0);
return gl_ModelViewMatrixTranspose*world;
}
gl_ModelViewProjectionMatrix

 

I know i can use transpose() and inverse() but what are

gl_ModelViewMatrix and gl_ModelViewProjectionMatrix in Leadwerks shader system?

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Posted

I think they need to be sent in OpenGL4 since alot of the gl_..'s were obsolete and they are called cameramatrix and projectioncameramatrix respectivly in Leadwerks. (I could be wrong, Josh probably knows this.)

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Posted

I know that these gl_* matrices are obsolete.

To make my question more clear:

 

What are the equal terms in Leadwerks? cameramatrix = ?, etc.

Or if not available, how to constuct or pass them to the Leadwerks Shader system?

 

Its hard to find information about this if you don't know exactly what the leadwerks matrizes are equal to in other languages.

  • Upvote 1
  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Posted

is it possible to get explanations for the uniforms? for example what is the difference between cameradrawmode vs cameraprojectionmode? I assume one sets it as ortho/perspective.. projectioncameramatrix vs cameramatrix etc...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Posted

Camera draw mode is an internal variable that indicates whether wireframe, solid, textured, etc. view is being used in the editor.

My job is to make tools you love, with the features you want, and performance you can't live without.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...