Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSolid_Spy

Posted 15 November 2013 - 09:43 PM

Hello, I created a simple shader that loads an image and displays a quad. However, I modified it to include uv manipulation, and now it wont compile. Here is my code:

#version 400

in vec3 inPosition;
in vec2 inUV;

out vec2 outUV;

uniform mat4 worldMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
uniform float uPosition;
uniform float vPosition;
uniform float uScale;
uniform float vScale;

void main(void)
{
    gl_Position = worldMatrix * vec4(inPosition, 1.0f);
    gl_Position = viewMatrix * gl_Position;
    gl_Position = projectionMatrix * gl_Position;

    inUV.x = uPosition + inUV.x;
    inUV.y = vPosition + inUV.y;
    inUV.x = uScale * inUV.x;
    inUV.y = vScale * inUV.y;
    outUV = inUV;
}

I did not edit the pixel shader. It could be just a syntax error, but i'm using notepad, so it's not so easy X3.


#1Solid_Spy

Posted 15 November 2013 - 09:42 PM

Hello, I created a simple shader that loads an image and displays a quad. However, I modified it to include uv manipulation, and now it wont compile. Here is my code:

#version 400

in vec3 inPosition;
in vec2 inUV;

out vec2 outUV;

uniform mat4 worldMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
uniform float uPosition;
uniform float vPosition;
uniform float uScale;
uniform float vScale;

void main(void)
{
    gl_Position = worldMatrix * vec4(inPosition, 1.0f);
    gl_Position = viewMatrix * gl_Position;
    gl_Position = projectionMatrix * gl_Position;

    inUV.x = uPosition + inUV.x;
    inUV.y = vPosition + inUV.y;
    inUV.x = uScale * inUV.x;
    inUV.y = vScale * inUV.y;
    outUV = inUV;
}

it could just be a syntax error, but i'm using notepad, so I cannot easilly find any.


PARTNERS