Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

GLSL

Started by coderWalker Aug 14, 2011 at 3:28 PM 0 replies 1.9k views
Original Post
coderWalker
coderWalker
Simple question.

vec is basically an int right? making vec2 a struct with x and y.

so why does the following not work?


attribute vec2 position;

varying vec2 texcoord;

void main()
{
gl_Position = vec4(position, 0.0, 1.0);
texcoord = position * vec2(-0.5) + vec2(0.5);
//The following line kills it
texcoord.x = vec1(2.0);
}
If this post was helpful please +1 or like it !

Webstrand
Nanoha
Nanoha
Because there's no vec1, it's just a plain old float (vecs are floats not ints).

texcoord.x = 2.0; // Should work fine.
Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.