• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    Trouble with Variables in GL

    How To... ?
    1
    4
    98
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      boyexploded
      last edited by

      Hi again,

      I've shifted focus on this project to center learning how to implement controllable variable in open gl.

      This is the code I have so far:

      B 1 Reply Last reply Reply Quote 0
      • B
        boyexploded @boyexploded
        last edited by

        varying float circle;

        // ISADORA_FLOAT_PARAM(circle, circ, 0.0, 10.0, 1.0, "controls how circular");

        uniform float time;

        varying vec2 surfacePosition;

        #define PI 3.14

        #define N 100

        void main( void ) {

        float size = 0.1;

        float dist = 0.50;

        float ang = 0.0;

        vec2 pos = vec2(0,0);

        vec3 color = vec3(4.0);;

        for(int i=0; i<N; i++){

        float r = 0.5;

        ang += PI / (float(N)*-10.5)+(time/60000.0);

        pos = vec2((pow(ang, 10.0)),(ang*2.0))*ceil(tan(r))*ceil(tan(time+ang/.01));    

        dist += size / distance(pos,surfacePosition);

        vec3 c = vec3(0.05, 0.00, 0.0);

        color = c*dist;

        }

        gl_FragColor = vec4(color, 5.0);

        }

        B 1 Reply Last reply Reply Quote 0
        • B
          boyexploded @boyexploded
          last edited by

          or this should make it more clear

          B 1 Reply Last reply Reply Quote 0
          • B
            boyexploded @boyexploded
            last edited by

            I keep getting the error : "Input of fragment shader 'circle' not written by vertex shader" every time I try to input "circle" into any other part of the code.

            I've tried "#define circle 2.0" or "float circle = circle" but I either get the error message or the code compiles into a blank screen.

            Again, I would be very grateful to anybody who would be able to chat in real time about this project.

            Thanks!

            ps sorry for weird formatting

            1 Reply Last reply Reply Quote 0
            • First post
              Last post