Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Shader GLSL > Shader AGK

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 21st Jan 2016 10:20 Edited at: 21st Jan 2016 10:39
Hi

I would like to know if there is a documentation to know how to convert some GLSL syntax to AGk shader syntax.

Examples :
// at the start of the glsl file
attribute vec3 position;
// in void main()
gl_vertex = vec4(position,1.0)


// at the start of the glsl file
uniform vec4 uvBounds0;
varying vec2 uvVarying0;
attribute vec2 uv;
// in void main()
gl_multitexcoord0.xy = uv * uvBounds0.xy + uvBounds0.zw;

// at the start of the glsl file
uniform mat4 agk_ViewProj;
uniform mat4 agk_World;
// in void main()
gl_modelviewprojectionmatrix = agk_World * agk_ViewProj


For those syntax, I'm not sur
gl_modelviewmatrix = agk_View *agk_World
gl_normalmatrix = agk_WorldNormal


// at the start of the file
attribute vec3 normal;
// in void main()
gl_normal = normal

Thanks.

EDIT : correction after some test to confirm the conversion.
AGK2 tier1 - http://www.dracaena-studio.com
MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 21st Jan 2016 18:11
thanks, that's very useful. I am reading the course of TyphoonLabs, but I have problems in mapping from standard syntax into AppGameKit one.

Login to post a reply

Server time is: 2024-11-17 02:55:09
Your offset time is: 2024-11-17 02:55:09