klepto2 Posted October 12, 2014 Share Posted October 12, 2014 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? Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
shadmar Posted October 12, 2014 Share Posted October 12, 2014 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.) Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
klepto2 Posted October 13, 2014 Author Share Posted October 13, 2014 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. 1 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted October 18, 2014 Share Posted October 18, 2014 http://www.leadwerks.com/werkspace/topic/8203-internal-shader-uniforms/ Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
macklebee Posted October 18, 2014 Share Posted October 18, 2014 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... Quote 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 More sharing options...
Josh Posted October 18, 2014 Share Posted October 18, 2014 Camera draw mode is an internal variable that indicates whether wireframe, solid, textured, etc. view is being used in the editor. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
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.