Jump to content

Question about matrix conversion to Leadwerks shaders


klepto2
 Share

Recommended Posts

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?

  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

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
  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...