Jump to content



Recommended Posts

Hey guys,

I'm very new to shaders so I know nothing, not even what to ask google.

I could grab this piece of code together from examples but I'm very confused with everything.
I don't even know which language this is :D

precision mediump float;
varying vec2       vTextureCoord;
varying vec4       vColor;
uniform sampler2D  uSampler;

void main( void ) {
    gl_FragColor = texture2D(uSampler, vTextureCoord);
    gl_FragColor.rgb = vec3(gl_FragColor.r, gl_FragColor.g, gl_FragColor.b);

Where does vTextureCoord, vColor come from? Can i pass my own data into the shader/how?

Can someone send a link where i can learn more about this or the documentation for which terms i can pass into it like vTextureCoord.

Thanks alot :)

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.

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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...