Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glsl-syntax #15

Open
vinjn opened this issue Jun 23, 2013 · 1 comment
Open

glsl-syntax #15

vinjn opened this issue Jun 23, 2013 · 1 comment

Comments

@vinjn
Copy link
Owner

vinjn commented Jun 23, 2013

glsl ref

uniform mat4 u_matViewProjection;
attribute vec4 a_position;
attribute vec2 a_texCoord0;
varying vec2 v_texCoord;

void main(void)
{
gl_Position = u_matViewProjection * a_position;
v_texCoord = a_texCoord0;
}
// Fragment shader
precision mediump float; 
varying vec2 v_texCoord; // Varying in fragment shader 
uniform sampler2D s_baseMap; 
uniform sampler2D s_lightMap; 

void main() 
{ 
vec4 baseColor; 
vec4 lightColor; 
baseColor = texture2D(s_baseMap, v_texCoord); 
lightColor = texture2D(s_lightMap, v_texCoord); 
gl_FragColor = baseColor * (lightColor + 0.25); 
}
@vinjn
Copy link
Owner Author

vinjn commented Jun 23, 2013

Built-in Variables

glsl hlsl
gl_ClipDistance SV_ClipDistance
gl_FragCoord [in]SV_Position
gl_FragDepth [out]SV_Depth
gl_FrontFacing SV_IsFrontFace
gl_GlobalInvocationID
gl_InstanceID [in]SV_InstanceID
gl_InvocationID
gl_Layer
gl_LocalInvocationID
gl_LocalInvocationIndex
gl_NumSamples
gl_NumWorkGroups
gl_PatchVerticesIn
gl_PointCoord
gl_PointSize
gl_Position [out]SV_Position
gl_PrimitiveID [in]SV_PrimitiveID
gl_PrimitiveIDIn
gl_SampleID [in]SV_SampleIndex
gl_SampleMask
gl_SampleMaskIn
gl_SamplePosition
gl_TessCoord
gl_TessLevelInner
gl_TessLevelOuter
gl_VertexID [in]SV_VertexID
gl_ViewportIndex
gl_WorkGroupID
gl_WorkGroupSize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant